472,967 Members | 1,787 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,967 software developers and data experts.

linking errors in 2005 only with /MT option, nothing else

I am in the process of trying to migrate a couple of build solutions to
Visual Studio Express 2005 from VS 2003 Professional and I am running
into a weird C/C++ runtime library linking issue when using the /MT
compilation option. Our debug solution's /MTd flag works fine and
using /MD also seems to work ok. For some reason I can't fathom, when
I use /MT, linking the static excutable completely dies (problems
resolving symbols in the STL, etc.)

I have tried using the /NODEFAULTLIB: option to tweak what I link
against using this webpage which hasn't helped:
http://msdn.microsoft.com/library/de...ary/en-us/vcco...

I also tried explicitly forcing the linking of only the libraries
libcmt.lib and libcpmt.lib by disallowing implicit linking against
everything else and specifying them manually.

Here is the output from the build:

------ Rebuild All started: Project: WTF, Configuration: Release Win32
------
Deleting intermediate and output files for project 'WTF', configuration
'Release|Win32'
Compiling...
stdafx.cpp
Compiling...
WTF.cpp
Linking...
libcpmt.lib(locale0.obj) : error LNK2005: "public: static unsigned int
const std::ctype<char>::table_size" (?table_size@?$ctype@D@std@@2IB)
already defined in WTF.obj
libcpmt.lib(ios.obj) : error LNK2005: "public: void __thiscall
std::ios_base::clear(int,bool)" (?clear@ios_base@std@@QAEXH_N@Z)
already defined in WTF.obj
WTF.obj : error LNK2019: unresolved external symbol ___CxxFrameHandler3
referenced in function __ehhandler$_wmain
Sys.lib(SysHost.obj) : error LNK2001: unresolved external symbol
___CxxFrameHandler3
WTF.obj : error LNK2001: unresolved external symbol "public: __thiscall
std::exception::exception(class std::exception const &)"
(??0exception@std@@QAE@ABV01@@Z)
Sys.lib(SysHost.obj) : error LNK2001: unresolved external symbol
"public: __thiscall std::exception::exception(class std::exception
const &)" (??0exception@std@@QAE@ABV01@@Z)
WTF.obj : error LNK2019: unresolved external symbol "public: virtual
__thiscall std::exception::~exception(void)" (??1exception@std@@UAE@XZ)
referenced in function
__unwindfunclet$??0runtime_error@std@@QAE@ABV01@@Z $0
Sys.lib(SysHost.obj) : error LNK2001: unresolved external symbol
"public: virtual __thiscall std::exception::~exception(void)"
(??1exception@std@@UAE@XZ)
WTF.obj : error LNK2019: unresolved external symbol "public: __thiscall
std::exception::exception(void)" (??0exception@std@@QAE@XZ) referenced
in function "public: __thiscall std::runtime_error::runtime_error(class
std::basic_string<char,struct std::char_traits<char>,class
std::allocator<char> > const &)"
(??0runtime_error@std@@QAE@ABV?$basic_string@DU?$c har_traits@D@std@@V?$allocator@D@2@@1@@Z)
....
Sys.lib(SysHost.obj) : error LNK2001: unresolved external symbol
_memcpy_s
WTF.obj : error LNK2019: unresolved external symbol _memmove_s
referenced in function "public: static char * __cdecl
std::char_traits<char>::_Move_s(char *,unsigned int,char const
*,unsigned int)" (?_Move_s@?$char_traits@D@std@@SAPADPADIPBDI@Z)
Sys.lib(SysHost.obj) : error LNK2001: unresolved external symbol
_memmove_s
Z:\proj\Release\WTF.exe : fatal error LNK1120: 11 unresolved externals

I have trimmed down my compile flags for the "Release" configuration as
much as sensible to match the "Debug" configuration which does link.
The only thing that seems to matter is the choice of /MT vs. /MTd.

The only two projects involved are "Sys" and "WTF". Sys is a static
library being compiled with /MT and WTF is a Console app linking to
Sys.lib and also being compiled with /MT. I have obviously done full
rebuilds of both projects many times.

Anybody have any ideas what might cause this?

Jun 27 '06 #1
0 2499

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wolfgang | last post by:
I have a problem with linking my CPP Code under a irix6 machine (sgi, UNIX). In my CPP code I use some Functions which are written in Python. So its a kind of CPP wrapper for my Python functions In...
10
by: Douglas Buchanan | last post by:
I am using the following code instead of a very lengthly select case statement. (I have a lot of lookup tables in a settings form that are selected from a ListBox. The data adapters are given a...
2
by: bobnotbob | last post by:
I have created an application and am trying to call functions from a previously existing dll. I can call some functions fine, but I get a link error an when I try to call any function that takes...
1
by: Daveyk0 | last post by:
Hello there, I have a front end database that I have recently made very many changes to to allow off-line use. I keep copies of the databases on my hard drive and link to them rather than the...
1
by: Venky | last post by:
I'm compiling a C program that is using Interbase 6.0 APIS. Getting the following errors at the time of linking. Linking test.exe: Linker Warning: No module definition file specified: using...
6
by: SandySears | last post by:
I am trying to use a stored procedure to insert a record using VS 2005, VB and SQL Server Express. The code runs without errors or exceptions, and returns the new identifer in the output...
2
by: pssraju | last post by:
Hi, At present application was built on solaris 9 using sun studio 9 (Sun C++ 5.6) & rouguewave sorce pro 5. We are planning to port the same application onto SuSE Linux 9.5.0 using GCC 3.3.3 & RW...
0
by: Tarik Monem | last post by:
I have been working on an all AJAX/DOM web site which is set to go live today and I thought I'd share my discoveries with all of you whom have helped me when I have encountered different issues along...
4
by: rhivka | last post by:
I'm going to try to keep this question within the student posting guidelines. I've been working on a class file, and I'm not sure I've constructed it correctly. I'm getting several errors concerning...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.