Author Topic: Adding libraries  (Read 3980 times)

Offline nathanf534

  • Single posting newcomer
  • *
  • Posts: 3
Adding libraries
« on: August 03, 2010, 11:11:34 pm »
I am new to both Ubuntu (9.10) and code::blocks, so I am having some trouble including a library.

Code
-------------- Build: Debug in test ---------------

g++ -Wall -fexceptions  -g     -c /home/nathan/test/main.cpp -o obj/Debug/main.o
g++ -L/usr/lib  -o bin/Debug/test obj/Debug/main.o    file:///usr/lib/libpcap.a
g++: file:///usr/lib/libpcap.a: No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings

libpcap.a is located in usr/lib

any suggestions of how I can fix this, or any more information you need to help me?

Thank you very much.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Adding libraries
« Reply #1 on: August 04, 2010, 06:32:13 am »
g++ -L/usr/lib  -o bin/Debug/test obj/Debug/main.o    file:///usr/lib/libpcap.a
Remove the "file://" protocol handler in you linker options. I am not aware that GCC can handle this.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ