dlang-community / d2sqlite3

A small wrapper around SQLite for the D programming language
Boost Software License 1.0
75 stars 26 forks source link

Must use release-debug, or debug mode #46

Open wilsonjord opened 6 years ago

wilsonjord commented 6 years ago

If I want to compile my program in debug mode, d2sqlite3 must also have been compiled in debug mode (e.g. dub - b "debug" or dub -b "release-dubug").

If I build d2sqlite3.lib without the -debug flag, and I compile my program in debug mode, I get:

dmd -m64 main.d -Id2sqlite\source -Ld2sqlite3.lib sqlite3.lib -debug
lld-link.exe: warning: obj\debug\main.obj: undefined symbol: _D9d2sqlite38database8Database7Payload9__xtoHashFNbNeKxSQCcQBvQBpQBjZm
lld-link.exe: warning: obj\debug\main.obj: undefined symbol: _D9d2sqlite38database8Database7Payload11__xopEqualsFKxSQCbQBuQBoQBiKxQpZb

If I compile my program without -debug (and d2sqlite.lib is also without -debug), everything is fine.

biozic commented 6 years ago

You should build your program and the library in the same mode, probably using dub for both.