473,378 Members | 1,498 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Managed C++ MFC Problem

I'm trying to upgrade a large MFC C++ application to Managed C++.

I get a strange link error (at end of message). It appears to be
duplicate STL string symbols between the MFC DLL and one of my classes.
I've commented the class file down to a minimalist stub file. It should
compile/link but won't run correctly. I still get this strange error. I
can't really pare this down much more for testing purposes. Any ideas?

msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: class
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator<wchar_t> > & __thiscall std::basic_string<wchar_t,struct
std::char_traits<wchar_t>,class std::allocator<wchar_t>
::erase(unsigned int,unsigned int)" (?erase@?$basic_string@_WU?$char_traits@_W@std@@V? $allocator@_W@2@@std@@QAEAAV12@II@Z)
already defined in DomainDataMgr.obj
msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: unsigned int
__thiscall std::basic_string<wchar_t,struct
std::char_traits<wchar_t>,class std::allocator<wchar_t>::size(void)const " (?size@?$basic_string@_WU?$char_traits@_W@std@@V?$ allocator@_W@2@@std@@QBEIXZ)
already defined in DomainDataMgr.obj
msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: __thiscall
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator<wchar_t> >::basic_string<wchar_t,struct
std::char_traits<wchar_t>,class std::allocator<wchar_t> >(class
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator<wchar_t> > const &)"
(??0?$basic_string@_WU?$char_traits@_W@std@@V?$all ocator@_W@2@@std@@QAE@ABV01@@Z)
already defined in DomainDataMgr.obj
msvcprtd.lib(MSVCP71D.dll) : error LNK2005: "public: unsigned int
__thiscall std::basic_string<wchar_t,struct
std::char_traits<wchar_t>,class std::allocator<wchar_t>::max_size(void)const "

(?max_size@?$basic_string@_WU?$char_traits@_W@std@ @V?$allocator@_W@2@@std@@QBEIXZ)
already defined in DomainDataMgr.obj
Nov 17 '05 #1
1 1497
Tommy Vercetti wrote:
I'm trying to upgrade a large MFC C++ application to Managed C++.


I need to use MFC/runtime as a DLL since I'm using Boost threads (which
won't work with a statically linked runtime). Might this have something
to do with it? Has anyone gotten a Boost/MFC app ported to Managed C++?
I guess a simple test would be worth a shot.
Nov 17 '05 #2

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

Similar topics

22
by: Alper AKCAYOZ | last post by:
Hello Esteemed Developers and Experts, I have been using Microsoft Visual C++ .NET for 1 year. During this time, I have searhed some topics over internets. Most of the topics about .NET is...
5
by: Adam McKee | last post by:
We are using Visual Studio.NET 2003 in our project with .NET framework 1.1. One of our libraries is a mixed-mode dll assembly consisting of one managed C++ library, and several unmanaged C++...
6
by: Omid Hodjati | last post by:
Hi All, I implemented an encryption algorithm using C#, native C++ and managed C++. Then I measured the CPU time used for executing this algorithm in all implementation. The managed version of...
3
by: Ben Terry | last post by:
I have imported a legacy C++ project into a VisualStudio.NET 2003 solution. I have some new C# projects in the solution as well. I am using the managed extensions in my C++ project so that I can...
4
by: | last post by:
I am stuck in a situation and I do believe that this should work, but it doesn't. I have a unmanaged dll, that uses MFC. This works great. Now I recompile the unmanaged dll so it contains...
5
by: Gerhard Menzl | last post by:
When creating a Managed C++ DLL using the Visual Studio 7.1 Solution Explorer (by selecting Add New Project and then either choosing Class Library (.NET) or Windows Control Library (.NET)), the IDE...
3
by: Steve Marsden | last post by:
Hi I am an experienced C programmer and we have a large app written in C which I have just recompiled with /clr to start to add in managed code to use .NET framework and windows forms bit by...
3
by: Adam | last post by:
I can't seem to find one spot on the net that specifies exactly what I need to do. Situation: Native dll needs to hold a static reference to a managed class in .net 2.0 (whidbey) which needs to...
87
by: Robert Seacord | last post by:
The SEI has published CMU/SEI-2006-TR-006 "Specifications for Managed Strings" and released a "proof-of-concept" implementation of the managed string library. The specification, source code for...
2
by: Kevin Sun | last post by:
I have a problem about non-managed code and managed code.Could you like to give me some suggestion? In a non-managed MFC application project, I add some managed codes and these files are setted...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.