473,624 Members | 2,298 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

problem with multiple symbols when using a static lib

Hi,

i am using a third party static library (.lib) that wraps a class interface
around an old C-style dll. in the static library they use the STL for some
stuff i don't know about.

in my own code, i also use the STL, for basic_string for example.

at link time, i get a lot of errors like:
msvcprtd.lib(MS VCP71D.dll) : error LNK2005: "public: __thiscall
std::basic_stri ng<char,struct std::char_trait s<char>,class
std::allocator< char> >::~basic_strin g<char,struct
std::char_trait s<char>,class std::allocator< char> >(void)"
(??1?$basic_str ing@DU?$char_tr aits@D@std@@V?$ allocator@D@2@@ std@@QAE@XZ)
already defined in ErrorHandling.o bj
ErrorHandling.o bj is the object file for the source file that contains my
errorhandling code. There is some basic_string stuff in there.

i can work around this by using /FORCE:MULTIPLE but this looks inelegant and
also gives lots of warnings. another way is to set project C++ options for
using runtime libraries in a dll instead of static. this works but i guess
this will only work if i don't have to link against multiple statis libs
that use the same functionality.

is there a better way to handle this problem?

kind regards and happy newyear to all of you,
Bruno.
Nov 17 '05 #1
1 1102
Hello Bruno,

It is likely because your project uses the MSVC runtime library dynamically.
That is, it uses the DLL version of the MS runtime library.

Try changing your project options to using the static version of the MS
runtime lib.

- Bio.

"Bruno van Dooren" wrote:
Hi,

i am using a third party static library (.lib) that wraps a class interface
around an old C-style dll. in the static library they use the STL for some
stuff i don't know about.

in my own code, i also use the STL, for basic_string for example.

at link time, i get a lot of errors like:
msvcprtd.lib(MS VCP71D.dll) : error LNK2005: "public: __thiscall
std::basic_stri ng<char,struct std::char_trait s<char>,class
std::allocator< char> >::~basic_strin g<char,struct
std::char_trait s<char>,class std::allocator< char> >(void)"
(??1?$basic_str ing@DU?$char_tr aits@D@std@@V?$ allocator@D@2@@ std@@QAE@XZ)
already defined in ErrorHandling.o bj
ErrorHandling.o bj is the object file for the source file that contains my
errorhandling code. There is some basic_string stuff in there.

i can work around this by using /FORCE:MULTIPLE but this looks inelegant and
also gives lots of warnings. another way is to set project C++ options for
using runtime libraries in a dll instead of static. this works but i guess
this will only work if i don't have to link against multiple statis libs
that use the same functionality.

is there a better way to handle this problem?

kind regards and happy newyear to all of you,
Bruno.

Nov 17 '05 #2

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

Similar topics

68
4335
by: Marco Bubke | last post by:
Hi I have read some mail on the dev mailing list about PEP 318 and find the new Syntax really ugly. def foo(x, y): pass I call this foo(1, 2), this isn't really intuitive to me! Also I don't like the brackets.
7
4374
by: Torbak | last post by:
I got some question about symbols in libraries ... In libraries, there is public symbols and "not public" symbols (private, static)... In C when we use the "static" keyword on the declaration of a function, the function is not public in the library. 1- When I use a class, all is symbols are put in the public section of the library. How can I change that. The keyword "private" in a class is only for the langage or does it change (like...
1
2328
by: Torbak | last post by:
I got some question about symbols in libraries ... In libraries, there is public symbols and "not public" symbols (private, static)... In C when we use the "static" keyword on the declaration of a function, the function is not public in the library. 1- When I use a class, all is symbols are put in the public section of the library. How can I change that. The keyword "private" in a class is only for the langage or does it change (like...
7
1931
by: Ittay Dror | last post by:
Hi I have this peculiar situation. I have a library of utility classes, which I use to compile a binary. I want to reimplement a method in class. The class is only a collection of static methods. So I copy the source and header files to another place, change the include path so this location will precede the location of the headers of the library, change the method (details after) and compile.
3
2288
by: Doug | last post by:
I'm having problems w/ the VS2005 debugger with C#. It blows past any breakpoints in even the simplest "Hello World" console application. I can't do any step-by-step debugging. I've provided the code and debugging output later in this post. I've seen a number of threads with similar problems that I'll address below. The one that's the largest concern is this one, which talks about the same problem trying to use the debugger with SQL...
4
5799
by: Al Norman | last post by:
We have two separate DLLs that do not interact (directly, at least). One is an MFC extension DLL that was built back in VC++ 6 days (but has been recompiled with VS2005). The other is a DLL that contains .Net functions wrapped in C++ (as described by Paul DiLascia -- see http://msdn.microsoft.com/msdnmag/issues/06/06/CAtWork/default.aspx). Both DLLs specify 'Use MFC in a shared DLL'. Since we have an old VC 6 application (large) that we...
3
2010
by: ozzyfb | last post by:
Hi, As you may figure out from my source code, I dont think i have a really bright future in java... I'm supposed to write this password creating program using the method of ; public static String passwordGenerator(int n, int m) i would much appreciate it if someone can have an eye on it.. import javax.swing.JOptionPane; public class PasswordMethodA { public static void main(Stringargs) {
6
2612
by: Richard | last post by:
1. Are there any problems with having, for instance, POSIX's "open" function #defined more than once. In my case, these would be in different static libraries: #ifdef __cplusplus extern "C" { #endif #define open myOpenFunction1
2
1643
by: Jeff | last post by:
Hey ..NET 2.0 I'm developing an application which will perform some webservice calls and I believe having those calls in a separate thread may help the app run smoother No user are waiting for the result of these webservice calls, Each night this code calls some webservices, which return a result I need to store in
0
8177
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8629
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
8488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7170
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
6112
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
5570
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
4084
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4183
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1793
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.