[LLVMbugs] [Bug 20106] New: Cannot link to DLLs if an RTTI class in the binary derives from an RTTI class defined in a DLL

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 23 07:33:04 PDT 2014


http://llvm.org/bugs/show_bug.cgi?id=20106

            Bug ID: 20106
           Summary: Cannot link to DLLs if an RTTI class in the binary
                    derives from an RTTI class defined in a DLL
           Product: clang
           Version: unspecified
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Frontend
          Assignee: unassignedclangbugs at nondot.org
          Reporter: ehsan at mozilla.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

This bug hits us when building ICU as a DLL on Windows:

$ cat type.h
#ifdef DLL
#define API __declspec(dllexport)
#else
#define API __declspec(dllimport)
#endif

struct API VFoo {
virtual ~VFoo();
};

$ cat type.cpp
#include "type.h"

VFoo::~VFoo() {};

$ cat test.cpp
#include "type.h"

class XYZ : public VFoo {};

int main() {
  new XYZ();
}

$ clang-cl -GR type.cpp -DDLL -link -dll -out:type.dll
   Creating library type.lib and object type.exp

$ clang-cl -GR test.cpp type.lib -D_HAS_EXCEPTIONS=0
test-97d7d3.obj : error LNK2001: unresolved external symbol "struct VFoo `RTTI
Type Descriptor'" (??_R0?AUVFoo@@@8)
test-97d7d3.obj : error LNK2001: unresolved external symbol "VFoo::`RTTI Class
Hierarchy Descriptor'" (??_R3VFoo@@8)
test.exe : fatal error LNK1120: 2 unresolved externals
clang-cl.exe: error: linker command failed with exit code 1120 (use -v to see
invocation)

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140623/e526cbbd/attachment.html>


More information about the llvm-bugs mailing list