|
Boost Users : |
From: John Maddock (john_at_[hidden])
Date: 2007-12-18 09:10:20
Andrea Galeazzi wrote:
>> Hi everybody,
>> I'm trying to use boost in a .NET project written in C++ managed.
>> When I build it in Debug version it's everything alright, but when I
>> do it in Release version I've got this error:
>> error LNK2001: unresolved external symbol "char __cdecl
>> boost::re_detail::w32_toupper(char,unsigned long)" (?w32_toupper@
>> re_detail_at_boost@@$$FYADDK_at_Z).
>> In particular the error above is generated by the following row:
>> regex_replace(std::string(p1, p2), transformer,
>> replace_string,boost::format_all).
>> So now I'm in a bind because I've completed my application but I
>> cannot distribute it due to the fact that .NET allows to deliver
>> only release version.
>> Can some help me?
Well we can try, but I've not seen that one before: "w32_toupper" is fully
defined in w32_regex_traits.cpp so this shouldn't be a problem.
How did you build the regex lib: as a native code library using bjam or as a
managed code library? And just double checking the obvious, I hope you
don't have either BOOST_ALL_NO_LIB or BOOST_REGEX_NO_LIB defined when
building, or if you do that your project references the regex lib in some
way?
If you're in a rush, then one quick thing you could try is:
* Add the #define BOOST_REGEX_NO_LIB to your project settings (so the
auto-linking code is disabled).
* Add the regex source code directly to your application (it's
libs/regex/src/*.cpp)
Then try rebuilding, if that works but bloats your application (does the
.NET linker automatically remove unused code?), then try building regex as a
managed code static library from within your IDE, and then add that project
as a dependency to your app.
I suspect that the original issue is caused by some weird build-settings
interaction, but it might be hard to track down by anything except trial and
error. Do let me know if you find the cause though, and I'll fix it if it's
possible.
Unless anyone else has seen this before...?
HTH, John.
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net