Hi all,
I'm new to this IDE and I've got a little problem
including a static library in my project.
Exactly: I'm trying to include a static sqlite lib.
I putted the lib in the Linker Options and included the
header File.
I may compile the whole Project without an error,
but when the Linker trys to link the files:
C:\Programme\CodeBlocks\MinGW\bin\ld.exe: cannot find -lsqlite.lib
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings
The file sqlite.lib is in the Project Directory.
So, what can I do about this?
Thanks in advance,
Max
PS: sry for my bad english :S
So, I added the Directory under Build Options -> Search Directories -> Linker,
hope that was what you meant.
There's a different error now:
mingw32-g++.exe: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
mingw32-g++.exe -L"C:\Dokumente und Einstellungen\Max\Desktop\DatenbankAnbindung\" -o bin\Debug\DatenbankAnbindung.exe obj\Debug\main.o obj\Debug\Datenbank.o -lsqlite.lib -lsqlite.lib
mingw32-g++.exe: no input files
Compiling: main.cpp
Compiling: Datenbank.cpp
Linking console executable: bin\Debug\DatenbankAnbindung.exe
mingw32-g++.exe: no input files
Process terminated with status 1 (0 minutes, 5 seconds)
0 errors, 0 warnings
Sorry, my last post was ....
I'm currently not at home so, I'm working with my
notebook and other compiler settings :S
Here are the new and right ones:
mingw32-g++.exe -Wall -fexceptions -g -c "C:\max\programme\der Rest\DatenbankAnbindung\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe -Wall -fexceptions -g -c "C:\max\programme\der Rest\DatenbankAnbindung\Datenbank.cpp" -o obj\Debug\Datenbank.o
mingw32-g++.exe -L..\DatenbankAnbindung -o bin\Debug\DatenbankAnbindung.exe obj\Debug\main.o obj\Debug\Datenbank.o -lsqlite.lib -lsqlite.lib
C:\Programme\CodeBlocks\MinGW\bin\ld.exe: cannot find -lsqlite.lib
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 11 seconds)
1 errors, 0 warnings
~Max
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:
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
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