Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I need to run C++ code via eclipse which has SQlite. I can run it via terminal with typing g++ test.cpp -lsqlite3 . but how can I run it via Eclipse? how should pur the command "-lsqlite3" in its configuration? thanks

this is the begging of the code

#include <sqlite3.h> #include <stdlib.h> #include <string.h> // g++ test.cpp -lsqlite3
share|improve this question

1 Answer 1

up vote 2 down vote accepted

According to the Eclipse FAQ on adding libraries:

Adding C/C++ External Libraries

How do I add an external library to my C++ project?  

Go to Your Project's Properties by right clicking on project's name and selecting   
properties. Click on "C/C++ Build". Under Tool Settings Tab, click on Directories.   
Click on The Add Button and Select FileSystem. Select the folder with C/C++ libraries.  
Apply and then Ok. The new library is included.  

The option commented before didn't work when I tried it. I solve it including the  
external library I want to add (libwsock32.a in my case) in Project->Properties->Tool   
Settings Tab->C++ Linker->Miscellaneous.  

14:26, 18 December 2007 (EST): Neither of these worked for me under Linux. I had to open  
up the project's properties and go to "C/C++ Build" -> "Settings" and then hit the  
"Libraries" item under "GCC C++ Linker" heading in the list on the right. Then, I  
entered the libraries as I would in the command line ("pthread" for libpthread, etc...).  
(Dustin Oprea)
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.