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

Managed C++ Static Link Library problem

We are trying to build a managed C++ static link library containing several classes which are members of a namespace. The build of this library seems to work OK. No errors.

We then try to use this library in a managed C++ application and get the following linker error.

LINK : error LNK2020: unresolved token (06000002) TestLib.TestClass::GetTemp
LINK : fatal error LNK1120: 1 unresolved externals

A verbose build listing shows that the linker is searching the lib - so it is referenced correctly in the build process.

"TestLib" is the name of the .lib file and is also the name of the namespace. "TestClass" is the name of the class and GetTemp is a method of that class.

It's the PERIOD between the namespace and the class that I believe is the problem. Its not proper namespace scoping syntax for C++. Is this a known linker problem? Is there a workaround?

Any help would be appreciated. I'm going bald over this one.

Scott L.
Nov 16 '05 #1
4 5823

I have the same problem.

The answer seems to be :
not supported by MS
(see one of the last threads)
phil
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message64252.html

Nov 17 '05 #2
That is correct. Static libraries containing managed code do not work due to
the way support for IJW is implemented in the linker.

The period between the namespace is correct. It is unrelated to the scope
operator in C++ being '::'.

Ronald Laeremans
Visual C++ team

"phil" <ph********@mail.mcse.ms> wrote in message
news:ph********@mail.mcse.ms...

I have the same problem.

The answer seems to be :
not supported by MS
(see one of the last threads)
phil
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message64252.html

Nov 17 '05 #3
Hi Ronald,

Unfortunately I have the same link problem, since I have managed code
in a static library. What options exist to solve this problem? Could
you give me any hints in this regard?

Thanks in advance.

Regards,
Roger

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message news:<eW*************@tk2msftngp13.phx.gbl>...
That is correct. Static libraries containing managed code do not work due to
the way support for IJW is implemented in the linker.

The period between the namespace is correct. It is unrelated to the scope
operator in C++ being '::'.

Ronald Laeremans
Visual C++ team

"phil" <ph********@mail.mcse.ms> wrote in message
news:ph********@mail.mcse.ms...

I have the same problem.

The answer seems to be :
not supported by MS
(see one of the last threads)
phil
------------------------------------------------------------------------
Posted via http://www.mcse.ms
------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message64252.html

Nov 17 '05 #4
Moving that code to a separate assembly is the most likely workaround.

Ronald

"roger" <me*****@all-consulting.ch> wrote in message
news:9e**************************@posting.google.c om...
Hi Ronald,

Unfortunately I have the same link problem, since I have managed code
in a static library. What options exist to solve this problem? Could
you give me any hints in this regard?

Thanks in advance.

Regards,
Roger

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message

news:<eW*************@tk2msftngp13.phx.gbl>...
That is correct. Static libraries containing managed code do not work due to
the way support for IJW is implemented in the linker.

The period between the namespace is correct. It is unrelated to the scope operator in C++ being '::'.

Ronald Laeremans
Visual C++ team

"phil" <ph********@mail.mcse.ms> wrote in message
news:ph********@mail.mcse.ms...

I have the same problem.

The answer seems to be :
not supported by MS
(see one of the last threads)
phil

------------------------------------------------------------------------ Posted via http://www.mcse.ms

------------------------------------------------------------------------
View this thread: http://www.mcse.ms/message64252.html

Nov 17 '05 #5

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

Similar topics

3
by: Michael Howes | last post by:
I have some old C code that uses MFC and some C Run Time Library. I need to be able to call this from C# I thought i'd be able to create a Managed C++ DLL, tell the project it was using MFC, ...
2
by: Jacob Cohen | last post by:
Under VC7.1, I am trying to wrap a native-C++ DLL that contains C++ objects in a Managed-C++ class library for use in a C# project. I created and compiled the native DLL under VC7.1 as a Win32...
1
by: Carl | last post by:
I have a managed c++ web service that uses ATL. Everything worked fine with VC 7.0, but when I recompile with VC 7.1 I get the following link warning: LINK : warning LNK4243: DLL containing...
8
by: Drew | last post by:
I have recently converted all of my native C++ dll's to be compiled with the /CLR switch. After doing this, I notcied a very strange and frustrating issue. One of my managed dll's calls another...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
1
by: Adam Clauss | last post by:
I have an unmanaged C++ library that I need to use through C#. I created a Managed C++ class library and through it wrote a wrapper class to call what I need. However, one of the methods (an...
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...
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)...
5
by: =?Utf-8?B?aWduaGVucnk=?= | last post by:
I have a managed C++ project and two C# projects. All are class library projects. The C++ project links with native C++ static libraries and references to one C# project. The projects structure...
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:
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...
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.