#### Archived

This topic is now archived and is closed to further replies.

# DLL trouble with stl headers

This topic is 5289 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I am working on splitting a pretty big project up into some Dlls, but I get nothing but this when I compile:
...include\new(34) : error C2732: linkage specification contradicts earlier specification for ''delete''
...new(34) : see declaration of ''delete''
...include\new(35) : see declaration of ''new''
...include\new(42) : error C2733: second C linkage of overloaded function ''new'' not allowed
...new(41) : see declaration of ''new''
...include\wchar.h(700) : error C2733: second C linkage of overloaded function ''wmemchr'' not allowed
...wchar.h(699) : see declaration of ''wmemchr''
...wchar.h(702) : error C2733: second C linkage of overloaded function ''wcschr'' not allowed
...wchar.h(701) : see declaration of ''wcschr''

(removed directories to try and make the post a little more readable) I''m pretty sure I know what the problem is, there is an extern "C" around all these errors. How do I remove this/fix the problem? there are many stl headers, mostly string, list, vector, fstream, map, and algorithm. I get errors on those too, but I''m pretty sure the cause of both is the same problem. it is a MFC project using MFC in a shared dll. any help would be great

##### Share on other sites
Use the multithreaded DLL runtime (both in your project and in the DLL itself).

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.”
— Brian W. Kernighan (C programming language co-inventor)

[edited by - Fruny on January 14, 2004 7:00:15 PM]

##### Share on other sites
I am now, and I just tried the non-debug version, no change.

##### Share on other sites
How, exactly, did these headers get wrapped in extern "C" in the first place?

##### Share on other sites
I found the problem, in the DLL projects that give me this, I'm including the directx headers. If I include the DX headers at the very last, I only get a few, but I CANNOT make the few go away, no matter what I do. It seems I can only include either the DX headers, or my other DLL project's headers, not both at the same time. How do I prevent DX from doing this?

its not limited to the DX headers, just any two headers from two projects.

[edited by - billybob on January 15, 2004 6:48:40 PM]

##### Share on other sites
Would that 'dependancy of' thing when I created the project have anything to do with this? if so, how would I go about setting that after the project is created

edit: DOH i'm a friggin retard. i looked all over the Project->Settings for quite a while, and its sitting right on the menu before it.

edit again: it didn't help though, still the same errors.

[edited by - billybob on January 15, 2004 9:57:06 PM]

##### Share on other sites
try defining a unique define, and only re-include the header if its not defined...

##### Share on other sites
Platform neutral code (e.g. STL) should always be included before proprietary (e.g. DX) code on #include''s.

1. 1
2. 2
3. 3
4. 4
frob
15
5. 5

• 11
• 20
• 12
• 13
• 14
• ### Forum Statistics

• Total Topics
632144
• Total Posts
3004427

×