http://llvm.org/bugs/show_bug.cgi?id=10301
Summary: Link errors: C++ new operators with MSVC C++ Linker
Product: clang
Version: trunk
Platform: PC
OS/Version: Windows NT
Status: NEW
Severity: normal
Priority: P
Component: LLVM Codegen
AssignedTo: [email protected]
ReportedBy: [email protected]
CC: [email protected]
Windows, LLVM and clang
For the following simple C++ code:
//////////////////////////////
class DUMMY
{
public:
DUMMY() { val1 = 0, val2 = 0.f; }
int val1;
float val2;
};
int main()
{
int* a = new int[10];
DUMMY* b = new DUMMY();
return a[0] + b->val1;
}
//////////////////////////////
clang and linking with MSVC C++ linker gives link errors:
new.o : error LNK2019: unresolved external symbol __Znaj referenced in function
_main
new.o : error LNK2019: unresolved external symbol __Znwj referenced in function
_main
LINK : error LNK2001: unresolved external symbol _mainCRTStartup
new.exe : fatal error LNK1120: 3 unresolved externals
After simple searching, this is due to clang or LLVM didn't correctly emit some
C++ operator functions.
Of course, linking with g++ (MinGW) is okay.
--
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs