Find the answer to your Linux question:
Results 1 to 6 of 6
hello all. I have a simple question: if I have a library (eg libjpeg.a) compiled form source with the debugging option -g, can I use it in order to compile ...
  1. #1
    Just Joined!
    Join Date
    Mar 2005
    Posts
    6

    using library compiled with -g option

    hello all.
    I have a simple question: if I have a library (eg libjpeg.a) compiled form source with the debugging option -g, can I use it in order to compile other programs?

    Thanks a lot!!!

  2. #2
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Quote Originally Posted by melalec View Post
    hello all.
    I have a simple question: if I have a library (eg libjpeg.a) compiled form source with the debugging option -g, can I use it in order to compile other programs?

    Thanks a lot!!!
    What's the exact problem?

    You should be able to use it as long as you instruct the programs you are compiling to use that version of libjpeg (in case that it's not the one installed on your base system).

    If that's not what you needed to know, try to be more specific on what the actual problem is.

  3. #3
    Just Joined!
    Join Date
    Mar 2005
    Posts
    6
    Quote Originally Posted by i92guboj View Post
    What's the exact problem?

    You should be able to use it as long as you instruct the programs you are compiling to use that version of libjpeg (in case that it's not the one installed on your base system).

    If that's not what you needed to know, try to be more specific on what the actual problem is.
    my question arises from my embedded system experience, because if you compile a program for a MCU with the debug option, generally you won't be able to use this program "stand alone" but only within a debugger environment.

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    In the ordinary Linux environment, programs and libraries compiled with the -g option are perfectly usable in a non-debugging environment; the extra debugging information in the compiled code is ignored in that situation.
    --
    Bill

    Old age and treachery will overcome youth and skill.

  5. #5
    Linux Guru
    Join Date
    Nov 2007
    Location
    Córdoba (Spain)
    Posts
    1,513
    Now I understand your concern.

    But, as wje_lf already told you, you don't need to worry about that. In linux you don't have any problem with debug builds. You can use them just like a regular build. The only "problems" are that it will usually be a bit (or a lot) slower and that the output to sdtout/sdterr will be much versobe sometimes.

  6. #6
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    it will usually be a bit (or a lot) slower
    I don't understand. The only way it would be made slower is that the object code takes longer to read (or swap) into main memory, because of the extra object file information.
    output to sdtout/sdterr will be much versobe sometimes
    This is not correct. The only difference is that there is extra debugging information in the object files for use by the debugger. If you're not running a debugger, exactly the same code gets executed with or without the -g option.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...