Solved

library conflicts

Posted on 2000-04-06
3
211 Views
Last Modified: 2013-12-14
I've created an ANSI static library in VC++6.  I want to be able to use this library on all platforms so I'm using stl for things like vectors and strings.  The problem is, I've written an MFC app to call this library, and when I create a std::string from the MFC app I get a multiply defined symbol error.  How can I get over this without rewriting the library to not use stl?
0
Comment
Question by:ch52jb
  • 2
3 Comments
 
LVL 22

Accepted Solution

by:
nietod earned 50 total points
ID: 2690175
It sounds like you are linking your static library to the static RTL.  MFC uses the DLL version of the RTL (I believe) so link you library to the DLL RTL.  (Under the project option, C/C++ tab, code generation category).

give that a try and let me know if it works.  I'm not answerign because I'm not sure that is the problem.
0
 

Author Comment

by:ch52jb
ID: 2690391
Short, sweet answer that solved my problem in seconds.  Thank you very much.
0
 
LVL 22

Expert Comment

by:nietod
ID: 2690842
Good to know.  
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand columnThat will then direct you to their download page.From that page s…
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question