configuração do Eclipse (versão C ++) para executar o SQLite?

1

Eu preciso executar o código C ++ via eclipse, que tem SQlite. Eu posso executá-lo via terminal digitando g ++ test.cpp -lsqlite3. mas como posso executá-lo via Eclipse? como deve pur o comando "-lsqlite3" em sua configuração? obrigado

este é o começo do código

#include <sqlite3.h> #include <stdlib.h> #include <string.h> // g++ test.cpp -lsqlite3
    
por ePezhman 01.02.2012 / 07:12

1 resposta

2

De acordo com as Perguntas frequentes sobre o Eclipse sobre como adicionar bibliotecas:

Adicionando Bibliotecas Externas C / C ++

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)
    
por RobotHumans 01.02.2012 / 10:28