Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: matejuh 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
-
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...