473,386 Members | 1,791 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,386 software developers and data experts.

Errors when linking VC6 library

Hello everybody,

I'm a C# programmer that recently was forced to look into Managed C++.
Please forgive me if I might be asking stupid questions ;-)

I currently have to write a wrapper class around a VC6 DLL, which exposes a
few classes. I need to wrap those classes and expose them as a .Net assembly
so they can be used from other .Net languages.

When I try to link to the lib file, I get a whole bunch of linking errors.
Here are two typical ones:

"already defined" error:
ManagedCPP error LNK2005: "public: __thiscall std::locale::locale(void)"
(??0locale@std@@QAE@XZ) already defined in
InspectorProject.lib(XmlGenerator.obj)

"unresolved external symbol" error:
ManagedCPP error LNK2001: unresolved external symbol "__int64 const
std::_Fpz" (?_Fpz@std@@3_JB)

I googled for quite a while and I came across a couple of postings that were
talking about msvcrt.dll, about incompatibilities between versions, using
STD, etc. This lib does not pass around any STD objects, just char*, so I
figured it can't be that problem. Does anybody have an idea where I have to
start searching for the problem?

Thanks, Christoph
Nov 17 '05 #1
1 1736
Make sure you use exactly the same C runtime library and the same C++
library in everything you link together into one images. E.g. do mix
versions from 6.0 with versions form 7.0 or 7.1 (or any other combination)
and don't mix debug and non debug, static or dynamic and single threaded or
multithreaded.

Ronald Laeremans
Visual C++ team

"Christoph Wienands" <cw*******@gmx.de> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
Hello everybody,

I'm a C# programmer that recently was forced to look into Managed C++.
Please forgive me if I might be asking stupid questions ;-)

I currently have to write a wrapper class around a VC6 DLL, which exposes
a
few classes. I need to wrap those classes and expose them as a .Net
assembly
so they can be used from other .Net languages.

When I try to link to the lib file, I get a whole bunch of linking errors.
Here are two typical ones:

"already defined" error:
ManagedCPP error LNK2005: "public: __thiscall std::locale::locale(void)"
(??0locale@std@@QAE@XZ) already defined in
InspectorProject.lib(XmlGenerator.obj)

"unresolved external symbol" error:
ManagedCPP error LNK2001: unresolved external symbol "__int64 const
std::_Fpz" (?_Fpz@std@@3_JB)

I googled for quite a while and I came across a couple of postings that
were
talking about msvcrt.dll, about incompatibilities between versions, using
STD, etc. This lib does not pass around any STD objects, just char*, so I
figured it can't be that problem. Does anybody have an idea where I have
to
start searching for the problem?

Thanks, Christoph

Nov 17 '05 #2

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

Similar topics

0
by: Xiaofeng Zhang | last post by:
when I compile my project setting, there are many LINK errors. But when I compile my project under debug setting, everything is OK. How can I deal with it? The errors is followed. Linking......
1
by: Aravind | last post by:
we have two files: 1. rc4.c (defines one function "create_pin()") 2. MyImpl.c(calling the function "create_pin()"),This implements JNI method. 1.When I am trying to create .dll file with one...
3
by: rich | last post by:
Hi there, I've been working with dynamic libraries for a quite big software and now and then I may get some weird linking errors, like following MSVCRTD.lib(MSVCR71D.dll) : error LNK2005:...
1
by: Maxwell | last post by:
Hello, I having having oodles of trouble using the std lib in my MC++ (VS.NET 2003) Class library. I figured out a simple sample to reproduce the errors I am having. Create a MC++ (VS.NET 2003)...
0
by: Adam Clauss | last post by:
I have managed C++ library (is bridging between a Win32 .dll and a C# application). All was well when compiled under VS2003, but I am running into a series of linking errors when compiling...
3
by: walkeraj | last post by:
I'm trying to compile an open source game called IVAN , and I'm able to compile it from a makefile, but not from an IDE. I have attempted to recreate the way the makefile compiles the project as...
0
by: Philip Lowman | last post by:
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...
2
by: Angus | last post by:
Hello I am using some classes from a third party and have included them in my projecxt and am compiling and linking with them. Everything compiles ok but I get these link errors: I added...
2
by: 2b|!2b==? | last post by:
I am having linkage errors in my release build as ff: ------ Build started: Project: myModule, Configuration: Release Win32 ------ Linking... Creating library c:\mypath\myModule.lib and object...
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: 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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

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.