How to use Sqlite in cocos2d-x under visual studio2012

Dear Sir/Madam,

I would like to use Sqlite in cocos2d-x under visual studio2012.
I followed many tutorial but they are creating problem.
I am making project for windows mobile phones.

Please give me suitable guidance.
I shall be highly obliged.

Kapil Deo Mishra

Have you had a look at: A simple Tutorial How to use SQLite in cocos2d-x ……(Tutorial by YUYE)

First, thank you for your immediate response.
yes, i followed the tutorial mentioned by you.It show many errors in sqlite3.c file.

Thanks and Regards
Kapil Deo Mishra

ok, well without knowing these errors I couldn’t possibly venture a guess to help you.

Sir would you tell me from where i should download sqlite.c and sqlite.h file. Please give me proper name and link.
I downloaded .c and .h file from http://www.sqlite.org/download.html names of files sqlite-amalgamation-3080500.zip(1.44 MiB),sqlite-wp80-winrt-3080500.vsix(2.94 MiB) respectively.I also downloaded project from the link: https://github.com/yuye-liu/cocos2dxSQLite and used sqlite.c and sqlite.h file.But all experiment showing lot of errors.I am developing my project on visual studio 2012 under windows8.1 os on cocos2dx2.2.3 and making wp8 project for windows phone.
Sir first you tell me from where and which file of sqlite.c and sqlite.h to be download.
And second tell me all the steps required for the work.
I would be thankful for it

  1. you downloaded it from the right place.

  2. I cannot give you steps to make it work without knowing what your errors are.

Are you really working on WinRT?

So for more help.

  1. What os? target os?
  2. What are the errors you are seeing?
  3. How are you integrating it. Provide what you are doing.

It is very hard for anyone to help without a complete picture.

Well,

  1. I am making project on windows 8.1 os for windows mobile phones.
    2.After adding sqlite.c and sqlite.h which are downloaded from the link:www.sqlite.org/2014/sqlite-amalgamation-3080600.zip shown Errors are:
    Error    1    error D8048: cannot compile C file ‘…\Classes\sqlite3.c’ with the /ZW option    D:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\proj.wp8\cl    ConnectionNew
        2    IntelliSense: a value of type “void *” cannot be assigned to an entity of type “char *”    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    15486    7    ConnectionNew
        3    IntelliSense: identifier “AreFileApisANSI” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32073    41    ConnectionNew
        4    IntelliSense: identifier “CreateFileA” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32103    41    ConnectionNew
        6    IntelliSense: identifier “CreateFileMappingA” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32122    41    ConnectionNew
        7    IntelliSense: identifier “CreateFileMappingW” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32132    41    ConnectionNew
        5    IntelliSense: identifier “CreateFileW” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32112    41    ConnectionNew
        8    IntelliSense: identifier “CreateMutexW” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32141    41    ConnectionNew
        9    IntelliSense: identifier “GetDiskFreeSpaceA” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32218    41    ConnectionNew
        10    IntelliSense: identifier “GetDiskFreeSpaceW” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32227    41    ConnectionNew
        11    IntelliSense: identifier “GetFileAttributesA” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32236    41    ConnectionNew
        12    IntelliSense: identifier “GetFileAttributesW” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32244    41    ConnectionNew
        13    IntelliSense: identifier “GetFileSize” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32261    41    ConnectionNew
        14    IntelliSense: identifier “GetFullPathNameA” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32269    41    ConnectionNew
        15    IntelliSense: identifier “GetFullPathNameW” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32278    41    ConnectionNew
        16    IntelliSense: identifier “GetSystemInfo” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32307    41    ConnectionNew
        17    IntelliSense: identifier “GetTempPathA” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32328    41    ConnectionNew
        18    IntelliSense: identifier “GetTempPathW” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32336    41    ConnectionNew
        19    IntelliSense: identifier “GetTickCount” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32344    41    ConnectionNew
        20    IntelliSense: identifier “GetVersionExA” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32353    41    ConnectionNew
        21    IntelliSense: identifier “GetVersionExW” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32363    41    ConnectionNew
        25    IntelliSense: identifier “HeapCompact” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32417    41    ConnectionNew
        22    IntelliSense: identifier “HeapCreate” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32377    41    ConnectionNew
        23    IntelliSense: identifier “HeapDestroy” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32386    41    ConnectionNew
        24    IntelliSense: identifier “HeapValidate” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32408    41    ConnectionNew
        26    IntelliSense: identifier “LoadLibraryA” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32425    41    ConnectionNew
        27    IntelliSense: identifier “LoadLibraryW” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32434    41    ConnectionNew
        28    IntelliSense: identifier “LocalFree” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32442    41    ConnectionNew
        29    IntelliSense: identifier “LockFile” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32450    41    ConnectionNew
        30    IntelliSense: identifier “MapViewOfFile” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32472    41    ConnectionNew
        31    IntelliSense: identifier “SetFilePointer” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32500    41    ConnectionNew
        32    IntelliSense: identifier “Sleep” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32509    41    ConnectionNew
        33    IntelliSense: identifier “UnlockFile” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32522    41    ConnectionNew
        34    IntelliSense: identifier “UnmapViewOfFile” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32542    41    ConnectionNew
        35    IntelliSense: identifier “WaitForSingleObject” is undefined    d:\Tridip\ABC Mania\cocos2d-x-2.2.3\cocos2d-x-2.2.3\projects\ConnectionNew\Classes\sqlite3.c    32569    41    ConnectionNew
    3.Firstly I crated a project. After that, I downloaded sqlite.c and sqlite.h files from the link:www.sqlite.org/2014/sqlite-amalgamation-3080600.zip. i opened proj.wp8 project . After that i opened .sln projecct  then added sqlite.c and sqlite.h file to the class of project.After that i build the project and given above errors shown by the compiler.

ah, ha. I wrote about this already here: How to use Sqlite3 for Windows Phone 8 game

I did r&d and solve this problem. you can visit on the link:
http://techbirds.in/integration-sqlite-in-cocos2d-x-with-wp8-in-visual-studio2012/

Thanks for blogging about this. Very helpful to the community.