JuliaInterop / libcxxwrap-julia

C++ library for backing CxxWrap.jl
Other
85 stars 43 forks source link

Link error in Debug configuration #166

Open mind6 opened 5 months ago

mind6 commented 5 months ago

I'm on Windows using MSVC. The Julia and compiler versions are the same as in the CI workflows. I get a link error when compiling the libcxxwrap-julia/examples/ directory, using latest version 0.13.2 under Debug configuration.

[build]   test_module.vcxproj -> C:\Users\kirby\MyDrive\Documents\TWS_API\build\bin\test_module.exe
[build]      Creating library C:/Users/kirby/MyDrive/Documents/TWS_API/build/libcxxwrap-julia/examples/Debug/functions.lib and object C:/Users/kirby/MyDrive/Documents/TWS_API/build/libcxxwrap-julia/examples/Debug/functions.exp
[build] functions.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl jlcxx::detail::BasicArg<0>::BasicArg<0>(char const *)" (__imp_??0?$BasicArg@$0A@@detail@jlcxx@@QEAA@PEBD@Z) referenced in function init_test_module [C:\Users\kirby\MyDrive\Documents\TWS_API\build\libcxxwrap-julia\examples\functions.vcxproj]
[build] functions.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl jlcxx::detail::BasicArg<1>::BasicArg<1>(char const *)" (__imp_??0?$BasicArg@$00@detail@jlcxx@@QEAA@PEBD@Z) referenced in function init_test_module [C:\Users\kirby\MyDrive\Documents\TWS_API\build\libcxxwrap-julia\examples\functions.vcxproj]
[build] C:\Users\kirby\MyDrive\Documents\TWS_API\build\bin\libfunctions.dll : fatal error LNK1120: 2 unresolved externals [C:\Users\kirby\MyDrive\Documents\TWS_API\build\libcxxwrap-julia\examples\functions.vcxproj]

But everything compiles in Release configuration.

I'm also getting a link error compiling my own library, in either Debug or Release configuration. The library previously worked under version 0.12.x

[build] Dll.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) class std::unordered_map<struct std::pair<class std::type_index,unsigned __int64>,struct jlcxx::CachedDatatype,struct std::hash<struct std::pair<class std::type_index,unsigned __int64> >,struct std::equal_to<struct std::pair<class std::type_index,unsigned __int64> >,class std::allocator<struct std::pair<struct std::pair<class std::type_index,unsigned __int64> const ,struct jlcxx::CachedDatatype> > > & __cdecl jlcxx::jlcxx_type_map(void)" (__imp_?jlcxx_type_map@jlcxx@@YAAEAV?$unordered_map@U?$pair@Vtype_index@std@@_K@std@@UCachedDatatype@jlcxx@@U?$hash@U?$pair@Vtype_index@std@@_K@std@@@2@U?$equal_to@U?$pair@Vtype_index@std@@_K@std@@@2@V?$allocator@U?$pair@$$CBU?$pair@Vtype_index@std@@_K@std@@UCachedDatatype@jlcxx@@@std@@@2@@std@@XZ) referenced in function "private: void __cdecl jlcxx::Module::add_copy_constructor<struct TagValue>(struct _jl_datatype_t *)" (??$add_copy_constructor@UTagValue@@@Module@jlcxx@@AEAAXPEAU_jl_datatype_t@@@Z) [C:\Users\kirby\MyDrive\Documents\TWS_API\build\TestCppClientLib.vcxproj]

I noticed in version 0.13 there have been changes around type maps, but I cannot understand the code so I have no way to narrow down the issue further.