User forums > Help
trying to include a static lib in my project
maxv:
--- Quote from: dje on March 28, 2008, 12:49:56 pm ---Hi !
--- Quote from: maxv on March 28, 2008, 11:49:11 am --- -lsqlite.lib -lsqlite.lib
--- End quote ---
I think once is enough :)
--- End quote ---
umm... I've added the lib only once in the Build Options
--- Quote from: dje on March 28, 2008, 12:49:56 pm ---
--- Quote from: maxv on March 28, 2008, 11:49:11 am ---C:\Programme\CodeBlocks\MinGW\bin\ld.exe: cannot find -lsqlite.lib
--- End quote ---
Add the directory where sqlite.lib is located in the linker search directories of your project build options.
Dje
--- End quote ---
Already done but thanks for trying to help anyway
dje:
I never worked with sqlite; is sqlite.lib in ..\DatenbankAnbindung ?
I would have imagine some <...>\sqlite\lib directory...
Are you sure of your relative path ? Did you try with an absolute one (not a good practice but just to be sure it is OK) ?
Dje
maxv:
--- Quote ---I never worked with sqlite; is sqlite.lib in ..\DatenbankAnbindung ?
I would have imagine some <...>\sqlite\lib directory...
--- End quote ---
No, it's only one library you have to build yourself...
or download the *.dll
I builded the static library myself and it works fine with Borland C++ Builder 2007.
--- Quote ---Are you sure of your relative path ? Did you try with an absolute one (not a good practice but just to be sure it is OK) ?
--- End quote ---
I putted the lib in the linker options and putted the project path under Search Directories -> Linker.
So, yes I'm sure about the relative path.
dje:
--- Quote from: maxv on March 28, 2008, 05:13:24 pm ---I builded the static library myself and it works fine with Borland C++ Builder 2007.
--- End quote ---
I'm not sure it's a good idea to use a lib built with borland and link with mingw...
maxv:
I also did a rebuild, same error but,
I'll do a right now... mom (5mins :P)
Ok, needed a bit longer,
made the whole project new.
So, I rebuilded the lib as a static lib which
resulted in a *.a and a *.dll file,
when I builded a static lib with Borland I only got
a *.lib file.
Anyways, I added the *.a file under Building Options -> Linker Settings
and added the relative Project Directorie under Search Directories -> Linker.
Finally I got another error:
--- Code: ---mingw32-g++.exe -L..\DatenbankAnbindung -o bin\Debug\DatenbankAnbindung.exe obj\Debug\main.o ..\libsqlitestat.a
obj\Debug\main.o: In function `main':
C:/max/programme/der Rest/DatenbankAnbindung/DatenbankAnbindung/main.cpp:9: undefined reference to `Datenbank::open(std::string)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 13 seconds)
1 errors, 0 warnings
--- End code ---
In my opinion the last project file was corrupted and
the linker tried to link the sqlite.lib file two times which lead to the error.
For this new project I don't even have a idea about the problem.
Maybe this is an easy problem and I just don't know enough about
libraries etc ... :/
~max
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version