Code::Blocks
October 01, 2014, 04:14:40 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!
 
   Home   Help Search Login Register  :: WebsiteWiki  
Pages: [1]   Go Down
  Send this topic  |  Print  
Author Topic: linking static library in code::blocks  (Read 1575 times)
matejuh
Newcomer
*
Offline Offline

Posts: 2


« on: April 24, 2010, 02:21:05 pm »

Hi, I'm writing a program using flow-tools library libft.a and I'm not able to link it in this IDE. When I compile it in terminal its OK.
Terminal: g++ -g -Wall -pedantic -o test testKompilace.cpp -lft -lz
OK
Code::Blocks with all possible options where to link it:

-------------- Build: Debug in IPTree ---------------

g++ -L/usr/lib/  -o bin/Debug/IPTree obj/Debug/iptree.o obj/Debug/iptreenode.o obj/Debug/main.o   -lft -lnsl -lz -pg  -lft -lz /usr/lib/libft.a
obj/Debug/main.o: In function `main':
/home/matej/Programming C++/IPTree/main.cpp:48: undefined reference to `ftio_init(ftio*, int, int)'
/home/matej/Programming C++/IPTree/main.cpp:50: undefined reference to `fterr_errx(int, char const*, ...)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
2 errors, 0 warnings
Logged
matejuh
Newcomer
*
Offline Offline

Posts: 2


« Reply #1 on: April 24, 2010, 03:02:52 pm »

After two hours looking of problem its solved... I was linking the library right all the time, but ftlib is c library, so I needed use extern "C"... Stupid...
Logged
Pages: [1]   Go Up
  Send this topic  |  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!