473,598 Members | 2,916 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Static library linker problem

Hi,

I'm having a similar problem as Scott. A static library
with managed C++ functions fails to link in.

See http://groups.google.be/groups?q=managed+C%2B%
2B+static+libra ry&start=10&hl= en&lr=&ie=UTF-8&oe=UTF-
8&selm=uXE2ZMiq DHA.2644%40TK2M SFTNGP09.phx.gb l&rnum=14
(BTW why can I find scott's post with Google and not using
the msdn web-interface? It seems to have vanished)

I've created a static library using VC++ 7.0. I builds
fine, but when I try to use it the linker complains about
unresolved externals. I've traced the linker progress to
make sure that the .lib file was found. Curiuously free
functions are found, while class member functions are not.

Is this a compiler problem? Something with the name
mangling? I've dumped the contents of the produced lib
using dumpbin and it appears that the symbols are in there.

Any help is appreciated,

Joske
Nov 16 '05 #1
2 2121
Joske,

Has anyone responded to you on this? I'm ready to call MS Support to get an
answer.

Scott L.

"Joske" <jo***@work.t v> wrote in message
news:3e******** *************** *****@phx.gbl.. .
Hi,

I'm having a similar problem as Scott. A static library
with managed C++ functions fails to link in.

See http://groups.google.be/groups?q=managed+C%2B%
2B+static+libra ry&start=10&hl= en&lr=&ie=UTF-8&oe=UTF-
8&selm=uXE2ZMiq DHA.2644%40TK2M SFTNGP09.phx.gb l&rnum=14
(BTW why can I find scott's post with Google and not using
the msdn web-interface? It seems to have vanished)

I've created a static library using VC++ 7.0. I builds
fine, but when I try to use it the linker complains about
unresolved externals. I've traced the linker progress to
make sure that the .lib file was found. Curiuously free
functions are found, while class member functions are not.

Is this a compiler problem? Something with the name
mangling? I've dumped the contents of the produced lib
using dumpbin and it appears that the symbols are in there.

Any help is appreciated,

Joske

Nov 16 '05 #2
Sorry that I don't have a better answer, but static libs of MC++ code are
not supported at all in the 7.0 and 7.1 releases.

Due to the implementation of IJW in those releases the linker cannot handle
resolving references to managed functions from a static lib.

Ronald Laeremans
Visual C++ team

"Scott" <Sc*********@Un iversalComputer Sys.Com> wrote in message
news:e5******** ******@tk2msftn gp13.phx.gbl...
Joske,

Has anyone responded to you on this? I'm ready to call MS Support to get an answer.

Scott L.

"Joske" <jo***@work.t v> wrote in message
news:3e******** *************** *****@phx.gbl.. .
Hi,

I'm having a similar problem as Scott. A static library
with managed C++ functions fails to link in.

See http://groups.google.be/groups?q=managed+C%2B%
2B+static+libra ry&start=10&hl= en&lr=&ie=UTF-8&oe=UTF-
8&selm=uXE2ZMiq DHA.2644%40TK2M SFTNGP09.phx.gb l&rnum=14
(BTW why can I find scott's post with Google and not using
the msdn web-interface? It seems to have vanished)

I've created a static library using VC++ 7.0. I builds
fine, but when I try to use it the linker complains about
unresolved externals. I've traced the linker progress to
make sure that the .lib file was found. Curiuously free
functions are found, while class member functions are not.

Is this a compiler problem? Something with the name
mangling? I've dumped the contents of the produced lib
using dumpbin and it appears that the symbols are in there.

Any help is appreciated,

Joske


Nov 16 '05 #3

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

Similar topics

2
1614
by: Bramz | last post by:
Hi all, I have a rather strange linker (?) problem. At least, I think it's a linker problem, but I'm not so sure. It's a bit lengthy to describe ... I've implemented a generic factory similar to the one in 'modern c++ design' (page 208). To initialize this factory with the different products, I'm using the same technique on page 204-205 that bassicly looks like: namespace
1
2243
by: adeht | last post by:
In his book, "Modern C++ Design", Andrei Alexandrescu presents a Generic Object Factory class (Loki::Factory). One of its advantages (also mentioned in the book) is being able to register the class in the factory without having a central place that needs to be modified each time we add a new type. For example, the registration can be done in the same compilation unit as the class implementation: (code like this has been presented in...
1
3000
by: Torsten Mueller | last post by:
I have to create a shared library containing C++ classes with static member variables on HPUX with aCC. I can compile and link the library and a test application but when I start the program I get errors like these: /usr/lib/dld.sl: Unresolved symbol: namespaces (data) from /beda/lib/libLogicalValidation.sl /usr/lib/dld.sl: Unresolved symbol: m_mapFielTypeIDsUBSHaben__Q2_10Validators9CBaseCopy (data) from...
3
10935
by: mpatnam | last post by:
I have an executable which links to a static library (.a). I want to provide a hook by overriding a function part of this static library. Eg: I have a function "int blkstart(int i)" in this static library. I want to override this by having another function which is exactly similar in signature including name. When somebody call this function, control should automatically come to my overriddent function. Inside this function, based on...
4
5831
by: Scott | last post by:
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...
3
1474
by: Eric W | last post by:
MS VC++ 7.1 - I have a project with static libs A, B and C where A depends on B anc C, also B depends on C. If I set this up in the project dependency dialog for A the Build environment puts B and C in the command line (seen in the Librarian view of the project settings for A) an as a result I get LNK4006 warnings all over the place. So I am trying to establish dependencies such that A gets rebuilt if source in B or C changes. What I...
3
1920
by: Kevin Frey | last post by:
I am working on a test migration of our project to Visual Studio 2005 Beta 2 as a precursor to the availability of the full release of VS2005. The most onerous problem so far concerns the requirement by LINK.EXE that if an object file has used precompiled headers, then the resulting "precompiled header object file" must also be one of the objects in the link. (Whilst it does not affect my problem - I would dearly like to know why this...
5
6767
by: Jesper Schmidt | last post by:
When does CLR performs initialization of static variables in a class library? (1) when the class library is loaded (2) when a static variable is first referenced (3) when... It seems that (1) holds for unmanaged C++ code, but not for managed code. I have class library with both managed and unmanaged static variables that are not referenced by any part of the program. All the
14
2564
by: Jeroen | last post by:
Hi all, I've got a question about writing a library. Let me characterize that library by the following: * there is a class A which is available to the user * there is a class B that is used in severel 'underwater operations' * there is a list which stores objects of class B There are several issues I'm not sure about:
0
8284
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8392
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6711
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5847
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3938
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2410
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1500
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1245
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.