FW: [odb-users] support for Windows RT

Valentina Rozov valentina.r at wrnty.com
Mon Jul 15 02:09:10 EDT 2013


Hello, Boris
You understood correctly we are interested in using ODB with SQLite in a native C++ WinRT application.
I have started working on compiling the ODB (creates new project of C++ WinRT Components) and the only problem (you were right again:)) is using the threads.

1.       sqlite3 was compiled fine, I just added SQLITE_OS_WINRT to the Preprocessor definition, removed using of precompiled headers for sqlite.c and removed /ZW option for sqlite.c (still need to verify that this doesn't cause run time problems).

2.       Libodb - after putting ODB_THREADS_NONE to odb/details/config-vc.h I still get compilation errors:

d:\dev\cpi_ver_1.00\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\mutex.ixx(19): error C3861: 'InitializeCriticalSection': identifier not found (V:\ThirdParty\odb\libodb\libodb-2.2.3\odb\details\win32\thread.cxx)
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\once.cxx(24): error C3861: 'InitializeCriticalSection': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\thread.cxx(22): error C3861: '_endthreadex': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\thread.cxx(69): error C3861: '_beginthreadex': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\thread.cxx(83): error C3861: 'WaitForSingleObject': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(54): error C2065: 'TLS_OUT_OF_INDEXES' : undeclared identifier
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(63): error C3861: 'TlsAlloc': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(65): error C2065: 'TLS_OUT_OF_INDEXES' : undeclared identifier
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(68): error C3861: 'InitializeCriticalSection': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(88): error C2065: 'TLS_OUT_OF_INDEXES' : undeclared identifier
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(90): error C3861: 'TlsFree': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(98): error C3861: 'TlsGetValue': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(165): error C3861: 'TlsGetValue': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(184): error C3861: 'TlsGetValue': identifier not found
v:\thirdparty\odb\libodb\libodb-2.2.3\odb\details\win32\tls.cxx(246): error C3861: 'TlsSetValue': identifier not found

Maybe I need to add some ifdefs for ODB_THREADS_NONE. I am not sure about the elegant way to do this.
Can you help, please?

Thanks,
Valentina


From: Lidia Kalinovsky [mailto:lidia at lemur-soft.com]
Sent: Monday, July 15, 2013 7:15 AM
To: Valentina Rozov
Subject: Fwd: [odb-users] support for Windows RT


---------- Forwarded message ----------
From: Boris Kolpackov <boris at codesynthesis.com<mailto:boris at codesynthesis.com>>
Date: Tue, Jun 25, 2013 at 2:58 PM
Subject: Re: [odb-users] support for Windows RT
To: Lidia Kalinovsky <lidia at lemur-soft.com<mailto:lidia at lemur-soft.com>>
Cc: odb-users at codesynthesis.com<mailto:odb-users at codesynthesis.com>


Hi Lidia,

Lidia Kalinovsky <lidia at lemur-soft.com<mailto:lidia at lemur-soft.com>> writes:

> Does ODB support Window RT ?
> If yes, can somebody share compilations instructions/tips ?
Hm, I haven't heard of anyone using ODB with Windows RT yet.

I, however, did a bit of reading and I think it should be possible
(I assume you are interested in using ODB with SQLite in a native
C++ WinRT application). In particular, I found this series of blog
posts very useful:

http://blogs.msdn.com/b/chuckw/archive/2012/09/17/dual-use-coding-techniques-for-games.aspx

ODB only uses Win32 functions for concurrency. While I believe
most of them are available for Windows Store applications, the one
set that is not is the thread creation/termination functions.

If you don't need to access an ODB database from multiple threads,
then it will probably be the easiest to just disable thread support
in ODB.

Alternatively, it should be possible to provide a WinRT-based
implementationw of the threading classes in ODB either using the
thread pool facility or the C++11 API.

But the first thing I would try is to disable threads and see if you
can build libodb and libodb-sqlite. And also SQLite. BTW, have you
tried that already?

For libodb, I would try these steps:

1a. See if you can add a new target (for Windows RT/ARM) to the
    existing VS 2012 project.

1b. If that doesn't work, then I guess we will need to create a
    new project from scratch (could be easier to make it a static
    library to start with).

2.  Edit the odb/details/config-vc.h file and change ODB_THREADS_WIN32
    to ODB_THREADS_NONE.

3.  Try to build the library and see what happens.

I couldn't try these steps myself since apparently to develop a
WinRT application you need Windows 8 (all my current VMs are Win 7).
I can try to find time and give it a shot if there is interest.

Boris



--
Software integration and outsourcing services,
Lemur-Soft, Giv'at Nili
Israel, 37825
Phone : (+972) 545748325
Fax : (+972) 775345383
Email : lidia at lemur-soft.com<mailto:lidia at lemur-soft.com>
Web: www.lemur-soft.com<http://www.lemur-soft.com>


More information about the odb-users mailing list