Author Topic: I am having a link problem--where do I find the information?  (Read 4074 times)

Offline chwsks

  • Single posting newcomer
  • *
  • Posts: 2
I am having a link problem--where do I find the information?
« on: January 02, 2010, 10:09:42 pm »
I get the following error when I try to create a simple "hello world" using "fltk" :
Code
ld          cannot find -lXft
=== Build finished: 1 errors, 0 warnings ===

But, the same program can be built using these commands in the terminal:

Code
g++ -Wall -o main.o -c main.cpp
g++ main.o  -lfltk -lfltk_images -o main

I know where my libraries are and I know what libraries I want to use--just do not know how to tell code blocks to use them.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7789
    • My Best Post
Re: I am having a link problem--where do I find the information?
« Reply #2 on: January 02, 2010, 10:22:59 pm »
Then fix your linker settings

Project -> Build Options
Tab "Linker Settings"
Add Libs under "Link Libraries"

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline chwsks

  • Single posting newcomer
  • *
  • Posts: 2
Re: I am having a link problem--where do I find the information?
« Reply #3 on: January 03, 2010, 12:07:18 am »
Thank you Tim S., but it did not work for me. What I had to do was:

project -> properties -> project build options [button]->linker settings [tab] -> and add the proper libraries.

I am not sure why what you suggested did not work, because both you and someone else at another forum gave me the same answer--so I am assuming that I missed something.

Thanks again.