[llvm-bugs] [Bug 27966] New: clang++ linker errors: Undefined reference to 'typeinfo for class '(MinGW target)

via llvm-bugs llvm-bugs at lists.llvm.org
Wed Jun 1 10:23:46 PDT 2016


https://llvm.org/bugs/show_bug.cgi?id=27966

            Bug ID: 27966
           Summary: clang++ linker errors: Undefined reference to
                    'typeinfo for class '(MinGW target)
           Product: clang
           Version: 3.8
          Hardware: PC
                OS: Windows NT
            Status: NEW
          Severity: release blocker
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: hua.andy at gmail.com
                CC: llvm-bugs at lists.llvm.org
    Classification: Unclassified

Created attachment 16449
  --> https://llvm.org/bugs/attachment.cgi?id=16449&action=edit
testcase

D:\home>clang++ --target=x86_64-pc-windows-gnu -v
clang version 3.8.0 (branches/release_38)
Target: x86_64-pc-windows-gnu
Thread model: posix
InstalledDir: D:\mingw64\clang\bin
===============compile the tests======================
D:\home\tests>clang++ -o liba.dll -shared -fPIC -Wl,--out-implib=liba.dll.a
b.cpp -DBUILDING_DLL --target=x86_64-pc-windows-gnu
D:\home\tests>clang++ -o c.exe c.cpp -L. -la
C:\Users\xxxx\AppData\Local\Temp\c-bc7c5f.o:(.rdata[_ZTI1B]+0x10): undefined
reference to `typeinfo for A'
clang++.exe: error: linker command failed with exit code 1 (use -v to see
invocation)

but i use the following command to compile the program:
clang++ -o liba.dll -shared -fPIC -Wl,--out-implib=liba.dll.a b.cpp
-DBUILDING_DLL --target=x86_64-pc-windows-gnu
g++ -o c.exe c.cpp -L. -la

Is ok.

g++ -o liba.dll -shared -fPIC -Wl,--out-implib=liba.dll.a b.cpp -DBUILDING_DLL
clang++ -o c.exe c.cpp -L. -la

Is ok.

-- 
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/20160601/bd5f1eca/attachment.html>


More information about the llvm-bugs mailing list