I have a decent understanding of C#. I've been asked to make a SDK along with our program so that a customer can make his own UI using our functions. In C#, I did this by adding a DLL. I had to use a database file (.db) to hold commands, and it went successfully. Now I've been asked to do the same in C++. I'm very new to C++. But here's what I read from MSDN and did:
- I created a library project.
- Added database as a resource file, sqlite3 header file and library file(I got from giving lib command on command prompt).
- Created a header file with functions and wrote in a .cpp file with all function definitions.
- Built it and got the library file from lib command.
So far, so good. Now when I try to use this library file and header, I'm getting the following errors during build time.
error C2059: syntax error : '<'
error C2018: unknown character '0x7'
error C2018: unknown character '0x60'
error C2018: unknown character '0x7'
error C2018: unknown character '0x2'
error C2018: unknown character '0x1e'
error C2018: unknown character '0x18'
I struggled with this for sometime when I remembered that these errors were the same I got a few days ago. I actually asked the question in SE and got the answer (Error while including database file in C++ project).
So I inferred that the compiler is trying to read the database file saved in the library file and hence I got these errors.
Now I have three questions:
- Am I right? Is the compiler trying to read the .db file stored in .lib file?
- If so, can anyone please give any suggestions
- Also, if you think I'm wrong, I would appreciate any other explanations.
I'm using Visual Express C++ 2010. I used command prompt that comes with Visual Studio to create .lib file. My reference for creating .lib file was https://msdn.microsoft.com/en-us/library/ms235627.aspx#BKMK_CreateAppToRefTheLib.