Ticket #3090: testcase.txt

File testcase.txt, 1.5 KB (added by jkp@…, 13 years ago)

Small test-case to illustrate the issue: compile the code into a dll using VS2005

Line 
1########################################
2# nested.h
3########################################
4
5#pragma once
6
7static inline void function()
8{
9 class Nested
10 {
11 Nested(){
12 }
13 ~Nested()
14 {}
15 };
16}
17
18########################################
19# first_source.cpp
20########################################
21
22#include "nested.h"
23
24void first_caller()
25{
26 function();
27}
28
29########################################
30# second_source.cpp
31########################################
32
33#include "nested.h"
34
35void second_caller()
36{
37 function();
38}
39
40########################################
41# output
42########################################
43
441>------ Build started: Project: NestedTest, Configuration: Debug Win32 ------
451>Compiling...
461>first_source.cpp
471>second_source.cpp
481>Generating Code...
491>Linking...
501>second_source.obj : error LNK2005: "private: __thiscall `void __cdecl function(void)'::`2'::Nested::Nested(void)" (??0Nested@?1??function@@YAXXZ@AAE@XZ) already defined in first_source.obj
511>second_source.obj : error LNK2005: "private: __thiscall `void __cdecl function(void)'::`2'::Nested::~Nested(void)" (??1Nested@?1??function@@YAXXZ@AAE@XZ) already defined in first_source.obj
521>C:\Users\Administrator\Desktop\NestedTest\Debug\NestedTest.dll : fatal error LNK1169: one or more multiply defined symbols found
531>Build log was saved at "file://c:\Users\Administrator\Desktop\NestedTest\NestedTest\Debug\BuildLog.htm"
541>NestedTest - 3 error(s), 0 warning(s)
55========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========