News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

rev. 2056: linking libraries from global compiler options (bug?)

Started by ASJ, February 21, 2006, 10:59:34 PM

Previous topic - Next topic

ASJ

In rev. 2056 under Linux, there is a small change in how libraries should be specified:
the "-l" has to be prepended to the library name because it is not prepended automatically in the compiler line.

Could this be a small bug?

mandrav

Be patient!
This bug will be fixed soon...

ASJ

It is independent of the specific library (I tried it with more then 10 different libraries that are all in the searchpath).
For example the library libMagick.a (an ImageMagick library), the output of the compiler is shown below from the case that I just enter Magick in the "link library" list in the global compiler settings:
g++ -L/usr/lib -L/usr/local/lib -L/usr/lib -L/home/sjaak/Projects/fobs-src/lib -L/usr/local/lib  -o wxSmith_project .objs/app.o .objs/mainframe.o   `wx-config --libs` `wx-config --unicode=yes --debug=no --libs`  Magick
g++: Magick: Onbekend bestand of map
Process terminated with status 1 (0 minutes, 24 seconds)

and no executable was linked.
When I looked carefully I thought the -l was missing. So when I entered -lMagick in the "link library" list I got the following compiler output:
g++ -L/usr/lib -L/usr/local/lib -L/usr/lib -L/home/sjaak/Projects/fobs-src/lib -L/usr/local/lib  -o wxSmith_project .objs/app.o .objs/mainframe.o   `wx-config --libs` `wx-config --unicode=yes --debug=no --libs`  -lMagick
Process terminated with status 0 (1 minutes, 21 seconds)

and a executable was created without problems.

Maybe to complete my previous message, I am running revision 2056 on a SuSE 10 system.

mandrav

Are you sure you 're adding "Magick" in the "Link libraries" box (at the left) and not in "Other options"?

Go to "Settings->Compiler->Other", click "Advanced options" and verify the settings in the "Others" page. Specifically, verify that the "Link library" box contains -l (that's a lower L)...
Be patient!
This bug will be fixed soon...

ASJ

I double checked, and I am indeed adding to the "Link Libraries box" at the left. Also the "Link Library" option on the "Others" page was set at -l (as it should be).
By double checking and testing I came across the following:

  • Choosing Settings->Environment makes CodeBlocks crash immediately (after showing something about a debug report)
  • it seems that the settings from the "Global Compiler Settings" are not always saved when the dialog is closed. I could however not find any order where it went wrong, so probably it is just me......


mandrav

QuoteChoosing Settings->Environment makes CodeBlocks crash immediately

If you 're building using autotools (configure and friends), after running svn update to get the newest version, run "make clean-zipfiles" before invoking the usual build procedure.
It seems that the resource zips are not recreated automatically.
In other words, it crashes because the code references a widget in the dialog that is not present in your installed zip resources.
Be patient!
This bug will be fixed soon...

ASJ

I compiled the latest revision (2061) with this tip, and indeed the crash is gone now.

However, I still have to enter "-lMagick" in the "Link Libraries" box to make the linking succeed.....