Closed pierre-aimi closed 1 year ago
I just successfully built a VS 2022 Debug x86 shared libs build by the way. Looks like the AppVeyor build got a 504 anyway. I haven't got the meson build working properly yet (it's not part of my PR). I managed to build a DLL but none of the symbols are exported. This is probably down to my lack of meson build script experience.
I restarted the ci build I'll try to take a look, but don't hesitate to ping me!
I just successfully built a VS 2022 Debug x86 shared libs build by the way. Looks like the AppVeyor build got a 504 anyway. I haven't got the meson build working properly yet (it's not part of my PR). I managed to build a DLL but none of the symbols are exported. This is probably down to my lack of meson build script experience.
let me check it, I had another solution which was to make a define in the CPP files so we did not depend on the build system, but this is also a good solution, I will try to check your solution and post the suggested meson changes.
the meson.build
would require the following changes:
if required I can do the changes on another PR
@SRombauts I think we might be good to go now. Meson build works, plus a few things fixed up.
Hello, I merged other PRs and since this branch has been in conflict, would you be able to rebase, please?
All done!
Oh, this is not working for MinGW: https://github.com/SRombauts/SQLiteCpp/actions/runs/4341176692/jobs/7580682901
../src/Column.cpp:21:25: error: external linkage required for symbol 'SQLite::INTEGER' because of 'dllexport' attribute 21 | SQLITECPP_API const int INTEGER = SQLITE_INTEGER;
@SRombauts I just installed MinGW and fixed it.
Because gcc is defined, I had to add
#if defined(_WIN32)&& !defined(__GNUC__) && defined(SQLITECPP_COMPILE_DLL)
in order to exclude MinGW from the Windows import/export defines.
I also added -Wno-attributes to the Meson build because the exported const items already have internal linkage and therefore generate loads of warnings. See this for more details - https://stackoverflow.com/questions/26025708/warning-visibility-attribute-ignored-symbol-visibility-c-gcc
Thanks a lot for your contribution! It's awesome to finally have this in, good job
Happy to help!
This is a working version of Windows DLL imports/exports. I've tested using CMake only currently, but it should work with the following #defines:
#define SQLITECPP_COMPILE_DLL
is necessary when creating DLLs#define SQLITECPP_DLL_EXPORT
will export symbols, otherwise it will import symbolsUsing CMake, all that is necessary is BUILD_SHARED_LIBS turned on. All that CMake does is turn on exporting when building the DLL and then use importing when compiling the example.
Happy to make modifications, just thought I'd have this first pass reviewed first.