[regex]Using regex in x64 exe with VC 8.0
I was able to successfully compile the boost libraries for x64 under VC 8.0
using the following line:
bjam "-sTOOLS=vc-8_0-amd64"
As far as I can tell everything was successful (see note at end of message).
There was, of course, a vast quantity of warnings, but all of the lib files
seem to be there.
Then I tried creating an app using regex. The test code essentially boils
down to this:
#include
Bill Buklis wrote:
I was able to successfully compile the boost libraries for x64 under VC 8.0 using the following line:
bjam "-sTOOLS=vc-8_0-amd64"
As far as I can tell everything was successful (see note at end of message). There was, of course, a vast quantity of warnings, but all of the lib files seem to be there.
Then I tried creating an app using regex. The test code essentially boils down to this:
#include
bool testregex( const char* StringToMatch ) { return( boost::regex_match( StringToMatch, boost::regex("[A-Z]+") ) ); }
It compiles fine, but fails to resolve three regex related functions in the linker. Paraphrasing to make it a little more readable (if you want to see the full text, let me know):
basic_regex
::do_assign
re_detail::perl_matcher<...>::match
re_detail::perl_matcher<...>::perl_matcher [constructor]
All three of these functions reference boost::w32_regex_traits. Perhaps this is where the problem lies? Should it be w64_regex_traits?
Am I missing a define somewhere? Any ideas?
No ideas I'm afraid. There is no w64_regex_traits: the w32_* version is intended for all Windows platforms. Things to try: 1) Make sure you're actually linking to the 64-bit lib's, are the 32-bit ones lurking on anywhere on your hard drive and getting picked out instead? 2) Try defining BOOST_REGEX_NO_LIB when building your test app and adding all the regex source files directly to the app's project. If this succeeds it indicates that the lib's you're linking against aren't correctly built. 3) If (2) fails you could try again with BOOST_REGEX_NO_EXTERNAL_TEMPLATES defined (the errors all relate to template instantiations that are normally placed in the lib file). Oh and one other suggestion: are you selecting the lib to link against manually rather than let the auto-link code select it by any chance? You could see errors like that if you link against the regex dll import lib, without defining BOOST_REGEX_DYN_LINK so it knows to add __declspec(dllimport) to the codes defs (or vices versa: setting that define then linking against the static link lib). HTH, John.
Maybe using wchar_t as a built in the library but not your project?
From: "John Maddock"
Reply-To: boost-users@lists.boost.org To: Subject: Re: [Boost-users] [regex]Using regex in x64 exe with VC 8.0 Date: Fri, 11 Aug 2006 09:47:33 +0100 Bill Buklis wrote:
I was able to successfully compile the boost libraries for x64 under VC 8.0 using the following line:
bjam "-sTOOLS=vc-8_0-amd64"
As far as I can tell everything was successful (see note at end of message). There was, of course, a vast quantity of warnings, but all of the lib files seem to be there.
Then I tried creating an app using regex. The test code essentially boils down to this:
#include
bool testregex( const char* StringToMatch ) { return( boost::regex_match( StringToMatch, boost::regex("[A-Z]+") ) ); }
It compiles fine, but fails to resolve three regex related functions in the linker. Paraphrasing to make it a little more readable (if you want to see the full text, let me know):
basic_regex
::do_assign
re_detail::perl_matcher<...>::match
re_detail::perl_matcher<...>::perl_matcher [constructor]
All three of these functions reference boost::w32_regex_traits. Perhaps this is where the problem lies? Should it be w64_regex_traits?
Am I missing a define somewhere? Any ideas?
No ideas I'm afraid. There is no w64_regex_traits: the w32_* version is intended for all Windows platforms.
Things to try:
1) Make sure you're actually linking to the 64-bit lib's, are the 32-bit ones lurking on anywhere on your hard drive and getting picked out instead? 2) Try defining BOOST_REGEX_NO_LIB when building your test app and adding all the regex source files directly to the app's project. If this succeeds it indicates that the lib's you're linking against aren't correctly built. 3) If (2) fails you could try again with BOOST_REGEX_NO_EXTERNAL_TEMPLATES defined (the errors all relate to template instantiations that are normally placed in the lib file).
Oh and one other suggestion: are you selecting the lib to link against manually rather than let the auto-link code select it by any chance? You could see errors like that if you link against the regex dll import lib, without defining BOOST_REGEX_DYN_LINK so it knows to add __declspec(dllimport) to the codes defs (or vices versa: setting that define then linking against the static link lib).
HTH, John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Happy to say, I found the problem. Despite going to great lengths to make sure that the x64 lib files were in the right place and the 32-bit lib files were in the right place, I still managed to copy the 32-bit files to the 64-bit directory. Figures. So it was indeed trying to link with the 32-bit lib files. I'm surprised that the compiler didn't give me a more informative message - something like "that's not a 64-bit library file, dummy!" Then I would have seen it right away. -- Bill --
-----Original Message----- From: boost-users-bounces@lists.boost.org [mailto:boost-users- bounces@lists.boost.org] On Behalf Of John Maddock Sent: Friday, August 11, 2006 8:02 AM To: boost-users@lists.boost.org Subject: Re: [Boost-users] [regex]Using regex in x64 exe with VC 8.0
Alan Gray wrote:
Maybe using wchar_t as a built in the library but not your project?
Shouldn't be an issue: the lib contains both wchar_t and unsigned short specializations, so it should link whatever.
John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (3)
-
Alan Gray
-
Bill Buklis
-
John Maddock