jeudi 4 février 2016

/src/DB/sqlite3.dll: file not recognized: File format not recognized

I am trying to include a sqlite3 in my cpp project but while compilation it gives below error:

g++ -c -std=c++11 -g src/Main.cpp -I"C:/Mycode/src/DB" -L"C:/Mycode/src/DB" -lsqlite3

g++ -g -o Main.exe Main.o Data.o SqliteApi.o -lws2_32 -L"C:/Mycode/src/DB" -lsqlite3

C:/Mycode/src/DB/sqlite3.dll: file not recognized: File format not recognized

collect2.exe: error: ld returned 1 exit status

make: ***[Mycode.exe] Error 1

I feel during final linking time it gives error. I am using my own make file for compilation, below is the make command I am using:

DB_DIR="C:/Mycode/src/DB"

clean:
    rm Main.o Main.exe

Main.exe: Main.o Data.o SqliteApi.o 
    g++ -g -o Main.exe Main.o Data.o SqliteApi.o -lws2_32 -L${DB_DIR} -lsqlite3 

Main.o: src/Main.cpp
    g++ -c -std=c++11 -g src/Main.cpp -I${DB_DIR} -lsqlite3

Data.o: src/Data.cpp
    g++ -c -std=c++11 -g src/Data.cpp

SqliteApi.o: src/SqliteApi.cpp
    g++ -c -std=c++11 -g src/SqliteApi.cpp

I have googled but I couldn't find any solution or suggestion for this error. Any help will be much appreciated.

Aucun commentaire:

Enregistrer un commentaire