Author Topic: rev. 2056: linking libraries from global compiler options (bug?)  (Read 6239 times)

Offline ASJ

  • Multiple posting newcomer
  • *
  • Posts: 46
rev. 2056: linking libraries from global compiler options (bug?)
« on: February 21, 2006, 10:59:34 pm »
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?

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: rev. 2056: linking libraries from global compiler options (bug?)
« Reply #1 on: February 21, 2006, 11:02:17 pm »
I can't confirm this...
What's the library's name?
Be patient!
This bug will be fixed soon...

Offline ASJ

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: rev. 2056: linking libraries from global compiler options (bug?)
« Reply #2 on: February 22, 2006, 01:54:07 pm »
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:
Code
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:
Code
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.

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: rev. 2056: linking libraries from global compiler options (bug?)
« Reply #3 on: February 22, 2006, 02:13:23 pm »
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...

Offline ASJ

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: rev. 2056: linking libraries from global compiler options (bug?)
« Reply #4 on: February 22, 2006, 03:16:43 pm »
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......


Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Re: rev. 2056: linking libraries from global compiler options (bug?)
« Reply #5 on: February 22, 2006, 03:20:05 pm »
Quote
Choosing 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...

Offline ASJ

  • Multiple posting newcomer
  • *
  • Posts: 46
Re: rev. 2056: linking libraries from global compiler options (bug?)
« Reply #6 on: February 22, 2006, 05:25:02 pm »
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.....