Replying to myself... The issue is still not resolved, but I got a bit further. The slight difference in the mangled function signatures is a rather significant one. (Just found out what the undname.exe program in VC++ bin dir does.) It seems that the boost serialization library contains save/load definitions for single-byte character strings, not the wide char versions. "G" demangled seems to be "unsigned short" while "D" stands for "char". So, how do I make my application use the single-byte version of std::string? -Topi- Topi Mäenpää wrote:
Hi,
I have struggled to get the boost libraries link into my application with no success so far. I was able to compile most of the demo programs with bjam, but it seems that only static linking is used there. I'm using the dynamic versions. The libraries compiled fine with MSVC.NET 7.1. However, whenever I try to link them to an application, every symbol seems to be undefined. I turned on the diagnostics to see that the automatic linking is happening (with the nonstandard preprocessor stuff). I also added the libraries to my project manually without success. The funny (?) thing is that the lib file has a definition for the "missing" functions, except for one minor difference. This is the mangled symbol the linker complains about:
__imp_?save@?$xml_oarchive_impl@Vxml_oarchive@archive@boost@@@archive@boost@@QAEXABV?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@std@@@Z
(Omitting namespaces this one decrypts to xml_oarchive_impl
::save(basic_string& const)) This is what seems to be in the library:
__imp_?save@?$xml_oarchive_impl@Vxml_oarchive@archive@boost@@@archive@boost@@QAEXABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z
The only difference is that the library symbol contains a "D" and the linker is looking for "G" in a couple of places. I have found no way of going any further. Since the demos are built in debug mode and with static libraries, I found no useful information by inspecting the commands bjam uses in building them. Everything is just like I have in my own project.
I have defined BOOST_SERIALIZATION_DYN_LINK, if you happen to think about that. I even managed to link my app with mingw, but got strange run-time errors. Everything works fine with gcc on Linux.
Any advice?
-Topi-