boost regex library problem with release build

M

maggie.nguyen

Hi,

I use Visual Studios 2005.

In my project file, I include the library in linker:
"Additional Library Directories: ..\..\boost\lib"

I have these libs in the boost\lib directory:

libboost_date_time-vc80-mt-1_33_1.lib
libboost_date_time-vc80-mt-gd-1_33_1.lib
libboost_regex-vc80-mt-1_33_1.lib
libboost_regex-vc80-mt-gd-1_33_1.lib
libboost_thread-vc80-mt-1_33_1.lib
libboost_thread-vc80-mt-gd-1_33_1.lib

When I build my project as a debug build. it compiles fine.

However, if I change to release build, it gives me this error:

Error 1 fatal error LNK1104: cannot open file
'libboost_regex-vc80-mt-s-1_33_1.lib'

Please let me know what I need to do to have it point to
"libboost_regex-vc80-mt-1_33_1.lib" instead of
"libboost_regex-vc80-mt-s-1_33_1.lib".

Thanks very much,
Maggie
 
M

mlimber

I use Visual Studios 2005.

In my project file, I include the library in linker:
"Additional Library Directories: ..\..\boost\lib"

I have these libs in the boost\lib directory:

libboost_date_time-vc80-mt-1_33_1.lib
libboost_date_time-vc80-mt-gd-1_33_1.lib
libboost_regex-vc80-mt-1_33_1.lib
libboost_regex-vc80-mt-gd-1_33_1.lib
libboost_thread-vc80-mt-1_33_1.lib
libboost_thread-vc80-mt-gd-1_33_1.lib

When I build my project as a debug build. it compiles fine.

However, if I change to release build, it gives me this error:

Error 1 fatal error LNK1104: cannot open file
'libboost_regex-vc80-mt-s-1_33_1.lib'

Please let me know what I need to do to have it point to
"libboost_regex-vc80-mt-1_33_1.lib" instead of
"libboost_regex-vc80-mt-s-1_33_1.lib".

This is probably a problem with your environment configuration, so
follow-ups will need to go to a Microsoft-specific forum (cf.
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9).
<OT>I'm not intimate with VC++8, but I'd guess that your release and
debug builds have a different project settings. In particular, you're
linker directory settings are likely different between the two.</OT>

Cheers! --M
 
M

maggie.nguyen

I have checked the project setting for debug and release, they have the
same directory path to the boost lib directory.

My project configurationt type is "Dynamic Library (.dll)".

I wonder why boost lib points to the lib file with -s instead the one
with only -mt

"libboost_regex-vc80-mt-1_33_1.lib" ------> for release ???
"libboost_regex-vc80-mt-s-1_33_1.lib" ------> statically link
"libboost_regex-vc80-mt-gd-1_33_1.lib" -----> debug

- Maggie
 
K

kwikius

I have checked the project setting for debug and release, they have the
same directory path to the boost lib directory.

My project configurationt type is "Dynamic Library (.dll)".

I wonder why boost lib points to the lib file with -s instead the one
with only -mt

"libboost_regex-vc80-mt-1_33_1.lib" ------> for release ???
"libboost_regex-vc80-mt-s-1_33_1.lib" ------> statically link
"libboost_regex-vc80-mt-gd-1_33_1.lib" -----> debug

- Maggie

Try the boost users list:

You will need to subscribe as detailed here:

http://lists.boost.org/mailman/listinfo.cgi/boost-users

regards
Andy Little
 
M

maggie.nguyen

Yes, I have... still waiting for pending approval. Appparently, it's a
moderated list. I can't post it right away.

I try with this flag: BOOST_REGEX_DYN_LINK
on: http://www.boost.org/libs/regex/doc/configuration.html

but it gives me this error:
Error 1 fatal error C1189: #error : "Mixing a dll boost library with a
static runtime is a really bad
idea..." c:\workspace\tools\project_test\main\boost\boost\config\auto_link.hpp 281

I also post on a windows microsoft group.

Thanks for your help.
Maggie
 
M

Maggie

I fixed the problem.

For debug: my project setting as:
C/C++ > Code Generation > Runtime LIbrary as "Multi-threaded DLL (/MD)"

But in my release setting:
C/C++ > Code Generation > Runtime LIbrary as "Multi-threaded (/MT)"

When I changed it to "Multi-threaded DLL (/MD)", then it works!

FYI,
Maggie
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top