hoangduit / csharp-sqlite

Automatically exported from code.google.com/p/csharp-sqlite
Other
0 stars 0 forks source link

WINDOWS_PHONE + SQLITE_THREADSAFE does not work? #108

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi,

I just downloaded the version csharp-sqlite_3_7_5_30 and tried to compile to 
use it for Windows Phone 7 with SQLITE_THREADSAFE, but it does not work. I'm 
getting a lot of compiler errors about mutex and so on.

Steps:
1. I created a WP7 class library.
2. Added all source files.
3. Added following Conditional Compilation symbols:

WINDOWS_PHONE SQLITE_SILVERLIGHT TRUE WIN32 _MSC_VER NDEBUG NO_TCL SQLITE_ASCII 
SQLITE_DISABLE_LFS SQLITE_HAS_CODEC SQLITE_MEM_POOL SQLITE_MUTEX_OMIT 
SQLITE_OMIT_AUTHORIZATION SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE 
SQLITE_OMIT_INCRBLOB SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE 
SQLITE_OMIT_UTF16 SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN 
SQLITE_SYSTEM_MALLOC VDBE_PROFILE_OFF SQLITE_THREADSAFE

SQLITE_MUTEX_OMIT and SQLITE_THREADSAFE does not work together. So after 
removing SQLITE_MUTEX_OMIT the compiler does not know about sqlite3_mutex and 
that leads to other compiler errors and so on.

Can someone tell me how to compile WP7 with threadsafe feature?

Thx,
Buju

PS: WP7 SDK is free for download and use (~400 mb) and it will automatically 
integrate into existing Visual Studio installations --> 
http://create.msdn.com/en-us/resources/downloads

Original issue reported on code.google.com by buj...@gmail.com on 29 Mar 2011 at 5:07

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi,

I checked out the project from the repository now and it has the same compiler 
errors as the zip.

First there are 5 compiler errors when I compile without SQLITE_THREADSAFE.

They are all in os_win_c.cs --> 

[line 2567] The type or namespace name 'IsolatedStorage' could not be found 
(are you missing a using directive or an assembly reference?)

These are easy to fix:

change IsolatedStorage.IsolatedStorageFileStream to 
System.IO.IsolatedStorage.IsolatedStorageFileStream

Now if I add SQLITE_THREADSAFE and remove SQLITE_MUTEX_OMIT i get the same 
errors as i first posted --> sqlite3_mutex could not be found. After adding 
SQLITE_MUTEX_W32 the compiler can't find Mutex.

To clarify again:
It is possible to compile for Windows Phone 7 without SQLITE_THREADSAFE 
(although not fully tested yet if it works as expected).

But however it is not possible to compile for Windwos Phone 7 with 
SQLITE_THREADSAFE and SQLITE_MUTEX_W32 because System.Threading.Mutex is not 
available in Silverlight and Windows Phone (that's why I created a new Issue). 

Or maybe did I use the wrong Conditional Compilation symbols:
WINDOWS_PHONE SQLITE_SILVERLIGHT TRUE WIN32 _MSC_VER NDEBUG NO_TCL SQLITE_ASCII 
SQLITE_DISABLE_LFS SQLITE_HAS_CODEC SQLITE_MEM_POOL SQLITE_OMIT_AUTHORIZATION 
SQLITE_OMIT_DEPRECATED SQLITE_OMIT_GET_TABLE SQLITE_OMIT_INCRBLOB 
SQLITE_OMIT_LOOKASIDE SQLITE_OMIT_SHARED_CACHE SQLITE_OMIT_UTF16 
SQLITE_OMIT_VIRTUALTABLE SQLITE_OMIT_WAL SQLITE_OS_WIN SQLITE_SYSTEM_MALLOC 
VDBE_PROFILE_OFF SQLITE_THREADSAFE SQLITE_MUTEX_W32

There is also a minor bug in the Community.CsharpSqlite.Silverlight VS 
solution. The file "ctime_cs.cs" is added instead of "ctime_c.cs" --> not 
compilable when checked out of repository.

Original comment by buj...@gmail.com on 30 Mar 2011 at 8:53

GoogleCodeExporter commented 9 years ago
I'll check into this and make sure the windows phone compilation is compatible

Original comment by noah.hart@gmail.com on 30 Mar 2011 at 3:38

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 984375164533.

Original comment by noah.hart@gmail.com on 30 Mar 2011 at 3:48