0

Hey guys I have some questions to You connected with including sql precompiled binaries or sql libraries to my c++ code. First of all I tried to include just a library from the https://www.sqlite.org/download.html (simple - #include "sqlite3.h") after adding my .h file to the properties, give a path to it. Then I copy-pasted a very very simple part of code from http://www.tutorialspoint.com/sqlite/sqlite_c_cpp.htm and I got errors like "function sqlite3_open... ,sqlite3_free are not defined" or something like that, so algorithm doesnt work. Then I read about adding to my source code sqlite precompiled binaries. I did it but, theses files are ".c" and my project is written in c++. So when I changed in properties of these ".c" files to compile them like a c++ (otherwise compiling as C, I get: "Error 10 error C1853: 'Debug\mutualcepepe.pch' precompiled header file is from a previous version of the compiler, or the precompiled header is C++ and you are using it from C (or vice versa) ") I get a lot of errors like - Error 3 error C2440: '=' : cannot convert from 'void *' to 'char *' - Error 4 error C3861: 'sqlite3_malloc64': identifier not found

I spent a few hours, and still can't go further with my project without using sqlite3 in it. Hope that someone will help me, if I wasn't clear in something above please ask. Thank You in advance!

theCember
  • 71
  • 1
  • 7
  • Your question is pretty unreadable. Put some more efforts in formatting please. – πάντα ῥεῖ Jan 07 '16 at 12:11
  • You need to tell the linker about the static library. Since you have the binary (static lib) you do not need the source of it (.c files are not needed). See http://stackoverflow.com/questions/10049640/linking-a-static-library-to-my-project-on-visual-studio-2010 for an example of how to tell visual studio about the static library. – Selçuk Cihan Jan 07 '16 at 12:23
  • You have to decide on your language. In C, `void*` is implicitly convertible to any pointer type. In C++ it is not. The tutorial seems to use the language C/C++, which doesn't exist. – Bo Persson Jan 07 '16 at 12:24

0 Answers0