Re: problems in combining release and debug libraries to get and executable



On Mar 27, 10:00 pm, Ulrich Eckhardt <dooms...@xxxxxxxx> wrote:
wolverine wrote:
Assume i have a library "libabc.a" which is build in debug ( -g
flag) mode and another library "libxyz.a" which is build in release (-
O2 flag) mode.

Often, the difference is not just the -O2/-g but also a -DNDEBUG in release
mode. If this changes anything in the interface(!) of the library, this
will lead to problems.

Then if i link these 2 libraries like

1) g++ -g test.cpp -labc -lxyz (debug build)

2) g++ -O2 test.cpp -labc -lxyz (release build)

Will any of the above 2 builds result in a incorrect executable ?

From what you said, not necessarily.

Why did you say "From what you said" ?. Is there any case in which
linking debug and release build libraries can cause problems ?



Uli

--http://www.erlenstar.demon.co.uk/unix/


.



Relevant Pages

  • Re: port seahorse wont upgrade properly
    ... gnome-applets everytime I do a portupgrade gnome-applets: ... checking for C compiler default output file name... ... checking if cc static flag -static works... ... checking whether the cc linker supports shared libraries... ...
    (freebsd-questions)
  • Re: A question about Makefile(s)!!
    ... compiler targeted at your specific platform. ... > need to add a GUI interface to a program. ... > is the flag that different libraries use. ...
    (alt.comp.lang.learn.c-cpp)
  • [Fwd: RE: :Oracle on Solaris 9/10 and Oracle 10g]
    ... I got it working on a different machine a few months ago with DBD-Oracle-1.16, my hacked Makefile, and pointing at ... DBD::Oracle on one of our Solaris systems. ... libraries, I had to make the following changes to the generated Makefile: ... I don't know if there is a flag to pass into Makefile.PL to fix this or ...
    (perl.dbi.users)
  • Re: ld -r works differently?
    ... It is also missing '-shared' flag. ... Besides from these warnings things seems to work out fine. ... the -static-libgcc and perhaps a conflict between the other libraries that I ...
    (comp.unix.aix)
  • Re: [OT] A question about Makefile(s)!!
    ... "Maya" wrote in message ... > need to add a GUI interface to a program. ... > is the flag that different libraries use. ...
    (alt.comp.lang.learn.c-cpp)