embedding a library in Windows

2017-01-30 Thread Nestor via Digitalmars-d-learn
Hi, In Windows, is it possible embed a dll library into an application (in this particular case, sqlite3.dll)? Notice I don't mean storing the resource in the application to extract it at runtime, but rather to produce a static self-contained application. If it's possible, please provide a

Re: embedding a library in Windows

2017-01-30 Thread Kagamin via Digitalmars-d-learn
In general case the library can depend on it being a dll, then it can't be linked statically.

Re: embedding a library in Windows

2017-01-30 Thread Nestor via Digitalmars-d-learn
On Monday, 30 January 2017 at 13:22:45 UTC, Kagamin wrote: In general case the library can depend on it being a dll, then it can't be linked statically. OK, and in case I have a sqlite3.a file, what parameters should I pass to dmd to build a static application?

Re: embedding a library in Windows

2017-01-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 30 January 2017 at 13:29:20 UTC, Nestor wrote: OK, and in case I have a sqlite3.a file Just pass the sqlite3.a file instead of sqlite3.lib and the compiler should do the rest... worst case is you might need to edit the source of my sqlite.d to comment out the pragma(lib) line to e

Re: embedding a library in Windows

2017-01-30 Thread Kagamin via Digitalmars-d-learn
On Monday, 30 January 2017 at 13:29:20 UTC, Nestor wrote: OK, and in case I have a sqlite3.a file, what parameters should I pass to dmd to build a static application? If it's an import library, you will link against the dll dynamically (the library only contains bindings to dll). If it's a st

Re: embedding a library in Windows

2017-01-30 Thread Nestor via Digitalmars-d-learn
On Monday, 30 January 2017 at 13:58:45 UTC, Adam D. Ruppe wrote: On Monday, 30 January 2017 at 13:29:20 UTC, Nestor wrote: OK, and in case I have a sqlite3.a file Just pass the sqlite3.a file instead of sqlite3.lib and the compiler should do the rest... worst case is you might need to edit t

Re: embedding a library in Windows

2017-01-30 Thread Kagamin via Digitalmars-d-learn
That looks compiled for linux.

Re: embedding a library in Windows

2017-01-30 Thread kinke via Digitalmars-d-learn
You'll probably be more successful with a static .lib library generated with the MS compiler (Visual Studio). I'd suggest compiling sqlite yourself and then using DMD with the `-m32mscoff` switch (32-bit) or `-m64` for 64-bit. Google is your friend in case you don't know how to build a static C

Re: embedding a library in Windows

2017-01-30 Thread biozic via Digitalmars-d-learn
On Monday, 30 January 2017 at 13:00:15 UTC, Nestor wrote: Hi, In Windows, is it possible embed a dll library into an application (in this particular case, sqlite3.dll)? Notice I don't mean storing the resource in the application to extract it at runtime, but rather to produce a static self-co

Re: embedding a library in Windows

2017-01-30 Thread biozic via Digitalmars-d-learn
On Monday, 30 January 2017 at 16:40:47 UTC, biozic wrote: You could also try https://code.dlang.org/packages/d2sqlite3 with option "--all-included". This wasn't tested much though. Sorry, this uses a dll on Windows.

Re: embedding a library in Windows

2017-01-30 Thread Nestor via Digitalmars-d-learn
On Monday, 30 January 2017 at 16:40:47 UTC, biozic wrote: As an alternative, you could build an object file from Sqlite's source code (e.g. the amalgamation file from Sqlite's website) with a C compiler. Then you just build your D application with: dmd app.d sqlite3.d sqlite3.o[bj] No dll. Sq

Re: embedding a library in Windows

2017-01-30 Thread biozic via Digitalmars-d-learn
On Monday, 30 January 2017 at 17:25:13 UTC, Nestor wrote: On Monday, 30 January 2017 at 16:40:47 UTC, biozic wrote: As an alternative, you could build an object file from Sqlite's source code (e.g. the amalgamation file from Sqlite's website) with a C compiler. Then you just build your D appli