Opened 11 years ago

Closed 11 years ago

#6330 closed Bugs (worksforme)

Sucess to build when use stlport 5.2.1, but link error.(MSVC8-10)

Reported by: nightmare.qntal@… Owned by: John Maddock
Milestone: To Be Determined Component: regex
Version: Boost 1.48.0 Severity: Problem
Keywords: Cc:

Description

Boost 1.48.0 success to build when use stlport 5.2.1, but when link to the library with following error: error LNK2001: unresolved external symbol "void cdecl boost::re_detail::raise_runtime_error(class stlpd_std::runtime_error const &)" (?raise_runtime_error@re_detail@boost@@YAXAEBVruntime_error@stlpd_std@@@Z) E:\WorkSpaces\Visual Studio 2010\boost_test\boost_test\main.obj error LNK2001: unresolved external symbol "class stlpd_std::basic_string<char,class stlpd_std::char_traits<char>,class stlpd_std::allocator<char> > cdecl boost::re_detail::w32_transform(unsigned int,char const *,char const *)" (?w32_transform@re_detail@boost@@YA?AV?$basic_string@DV?$char_traits@D@stlpd_std@@V?$allocator@D@2@@stlpd_std@@IPEBD0@Z) E:\WorkSpaces\Visual Studio 2010\boost_test\boost_test\main.obj

building configure for boost 1.48.0: set PYTHON=D:
Program Files (x86)
Python32 set INCLUDE=%STLPORT%\stlport;%PYTHON%
include;%INCLUDE%; set LIB=%STLPORT%
lib;%PYTHON%
libs;%LIB%; b2 --toolset=msvc-10.0 --build-type=complete stdlib=stlport --stagedir=stlport

I have define _STLP_DEBUG and STLPORT_DEBUG in my project.During in the building progress of boost, I found the b2 have used the headers of msvc, and link to stplort's libraries.

Change History (1)

comment:1 by John Maddock, 11 years ago

Resolution: worksforme
Status: newclosed

This sort of issue is normally caused by some kind of binary incompatibilty between the libraries and your executable - unfortunately it's next to impossible to diagnose from a distance. The usual and easiest fix is to:

  • Create a static lib or dll project for the regex source in Your IDE and add all of libs/regex/src/*.cpp to it. Build using the same options as your executable.
  • Add the define BOOST_REGEX_NO_LIB to your applications project settings.
  • Add the lib/dll project as a dependency and rebuild.

HTH, John.

Note: See TracTickets for help on using tickets.