need linux tips

Discussion in 'Linux & BSD' started by FishBoy, Mar 18, 2005.

  1. hey i need help in a couple of things on linux, when i compile a c++ or c program i get the binary file but when i try to open it on the shell (eg: a.out) it tells me bad command name or somethng like that, and also how do i compile in debug mode i remember it was something like gbd? but i odnt know how to use it thx all
  2. X-Istence

    X-Istence * Political User

    if a.out is in your current directory you need to execute it with:


    unless you added "." to your $PATH with is really bad. Now, for some tips:

    c++ file.cpp -o file

    will create the executable "file" in your current directory which can be executed like so:


    To create a file with debugging symbols built in, you need to add the -g flag to c++

    c++ -g file.cpp -o file

    Then you can use gdb:

    gdb ./file

    In GDB you need to type "run" and the program will run, google for tutorials on how to use gdb, as it is a huge program with so many different abilities, that i can't explain them even in 5 replies.
    FishBoy likes this.
  3. awesome thx X i executed the output file, and good thing i didn't have to use gdb it compiled :D i got the errors fixed out
  4. hey how do i get my sound to work each time i load linux, coz everytime i load it ihave to go to SuSE Hardware Tool and delete and re-add the sound card and the card will work again, SuSE Linux 9.1
  5. AcftMecH

    AcftMecH OSNN Addict

    have you tried this:

    YasT -> System -> SysEditor -> Hardware -> Soundcard -> LOAD_SEQUENCER = YES

    if this one doesn't work. You may have to add a line to the .conf file, but being new myself, I am not for sure what it is called. But it is something along these line probably. Good luck!
  6. no i had a check box called "start sequncer" which is alwasy checked
  7. how do i examine an error in depth using gdb
    it's telling this:

    Program received signal SIGSEGV, Segmentation fault.
    0x40184705 in strncpy () from /lib/tls/
    that strncpy() worked in another place in my code but i wanna know why it's failling this specific time

    well i got it i replace the strncpy() with a for loop to copy the string and i still go the error but this time it told me that i was going out of bound so i was able to fix it :D
  8. how come ntfs writting on linux is dangerous, how could i make it so i could write to it.
  9. Ohzopants

    Ohzopants My mom thinks I'm cool

    fishboy, for linux help you're in the wrong forum, you should go to: < Here I have found a post (a very often solutions) about my linux problems
    or if you're using a fedora distro check out: < Even more useful for me than linuxquestions

    (No offense to osnn or it's members, for windows and mac togther we're pretty great, but in linux matters we're sub par.)
  10. no i think X-Istence is pretty good in linux and programming i always count on him when i need help/tips in these 2 things
    but yea i know about but im more used to this forum i think i did register on that site long time ago

    i'll give it a go though :D
  11. NetRyder

    NetRyder Tech Junkie Folding Team

    New York City
  12. oh
    see how encouraging that is... im getting 2nd thoughs, coz all of my media files are in there lol

    cool but there are drivers for ext2 and ext3 for windows
  13. NetRyder

    NetRyder Tech Junkie Folding Team

    New York City
    Yeah, I wouldn't do it if I were you. ;)
  14. yea im just gonna try and make a small fat32 partition for like "transfers" between the 2 OS and that should be great

    i also posted question on if you guys wanna see
  15. does the disk affect the OS performance and 'stubborness' in anyway? coz my linux seems to not be acting as it used to long time ago and on my friend's computer
  16. hey i didn't wanna make a new thread about this i thought just squeeze it in this thread i just wanted to know how do i restore GRUB coz i dont exactly know what happened but i know that it's not working anymore (SuSE 9.1) i think i cna access the command line thingy when i inster cd1 so any way i could restore GRUB from there? thx all