0
votes

My build requires that I issue the following commands:

$ g++ sniff.cpp -o sniff -lcrafter 

However, in my Eclipse build, all the complier gets is:

g++  -o "sniffer_crafter"  ./src/sniffer_crafter.o 

After getting these commands it complains that I have an undefined reference to the library Crafter.

How can I resolve this linking issue using Eclipse? I have seen others answers to similar questions, but they don't seem to address Eclipse's current layout. I'm using the most recent edition of Eclipse Kepler.

1

1 Answers

3
votes

Include libraries:-

right click on the project -->

  1. Goto Properties
  2. then goto --> C/C++ Build --> Settings

There you will find Linker and sub type Libraries.

Add the library path in Library Search Path on right hand side (where your .so file is located) and give the lib name in libraries

for libcrafter.so path --> /opt/myLib/lib

give path as /opt/myLib/lib and library name as crafter