Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

I am creating a library in C# using SQLite. I would like to have not more than one (lib.dll) or two DLL (lib.dll and System.Data.SQLite.dll) in the end.

First I decided to use only the x86 version of the System.Data.SQLite.dll, however on the official website it's said [^]:

Using Native Library Pre-Loading
... Generally, x86 binaries will work on an x64 machine running Windows (using WoW64). However, there is a problem when using managed code. If the executable that starts the process consists entirely of managed code, it will run with the native processor architecture of the machine, which will be x64 on an x64 machine. ... 


So it seems to be important to also have a x64 version.

I saw things about the interop files (SQLite.Interop.dll), but they require subdirectories and more dll.

Consequently, I though about creating a x86 version of my library and a x64 version, with a different System.Data.SQLite.dll file for each.

I have the following questions:
- where can I find x64 and x86 versions of System.Data.SQLite.dll ?
- how can I compile them myself from source code?
- is there an easy way to have the System.Data.SQLite.dll file as an embedded resource, so I'll only have to distribute one dll in the end ?

Thanks for your help, please ask any questions if needed.

What I have tried:

I found some informations but I'm lost about the general procedure, and where I can find the files.

About versions: https://stackoverflow.com/questions/18163354/sqlite-dll-for-x86-x64-architectures
About embedded resources: https://stackoverflow.com/questions/15852061/how-i-make-a-single-executable-with-system-data-sqlite-merge
Download page: https://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki
Posted
Updated 7-Nov-17 0:37am
v3
Comments
Richard MacCutchan 7-Nov-17 6:49am    
You cannot use a single dll for both x86 and x64.
SheepSpeech 8-Nov-17 5:03am    
This is not what I am asking for, I would like to have one dll for x64 and then create a x64 version of my library, and in an other projet, a dll for x86 and then create a x86 version of my library.
Richard MacCutchan 8-Nov-17 5:28am    
OK, so what is the problem?
SheepSpeech 9-Nov-17 3:20am    
Here it is:
I have the following questions:
- where can I find x64 and x86 versions of System.Data.SQLite.dll ?
- how can I compile them myself from source code?
- is there an easy way to have the System.Data.SQLite.dll file as an embedded resource, so I'll only have to distribute one dll in the end ?
Richard MacCutchan 9-Nov-17 3:47am    
Those questions can be answered at System.Data.SQLite Downloads Page[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900