Author Topic: linking error? where to check?  (Read 3425 times)

Offline pawelk

  • Single posting newcomer
  • *
  • Posts: 5
linking error? where to check?
« on: March 27, 2009, 09:51:51 am »
On fedora 10, c::b v 8.02,
I'm using the FLTK library and get an error that seems strongly to refer to x lib, or rather, not having x lib linked.  Where in c::b do I check the linker line/settings?

btw the Project menu | Build Options item | Linker Settings tab | Link Libraries box is empty, (and `fltk-config --ldstaticflags`is in the Other linker options box).

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: linking error? where to check?
« Reply #1 on: March 27, 2009, 10:51:39 am »
Change "Settings -> Compiler and debugger... -> Global compiler settings -> [the compiler you use] -> Other settings(rightmost tab)" "Compiler logging" to "Full commandline" and you get the commandline cretaed by C::B in the build log.

Offline pawelk

  • Single posting newcomer
  • *
  • Posts: 5
Re: linking error? where to check?
« Reply #2 on: March 27, 2009, 01:40:27 pm »
Thanks.

Offline pawelk

  • Single posting newcomer
  • *
  • Posts: 5
Re: linking error? where to check?
« Reply #3 on: March 27, 2009, 02:33:07 pm »
I've read somewhere that the order of libraries being linked can be relevant. 
If I've added libX11.so via Project > Build Options > Linker Settings > Link Libraries so that the Build Log then shows:

Code
g++  -o bin/Release/one obj/Release/main.o   /usr/lib/libfltk.a   /usr/lib/libX11.so 

How could i put the libX11 lib before the fltk lib?

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: linking error? where to check?
« Reply #4 on: March 27, 2009, 02:51:47 pm »
I've read somewhere that the order of libraries being linked can be relevant. 
If I've added libX11.so via Project > Build Options > Linker Settings > Link Libraries so that the Build Log then shows:

Code
g++  -o bin/Release/one obj/Release/main.o   /usr/lib/libfltk.a   /usr/lib/libX11.so 

How could i put the libX11 lib before the fltk lib?

Did you remove the
Code
`fltk-config --ldstaticflags`

On the commandline you should should get something like this:
Code
jens@debian-inspiron:~$ fltk-config --ldstaticflags
/usr/lib/libfltk.a -lXft -lfontconfig -lXinerama -lm -lX11

The wizard-projects works fine for me (with installed dev-package of course).

We come away from the scope of this forum, so I lock this topic now, sorry.