我得到使用gcc这个奇怪的链接错误,想,当我使用Visual Studio的代码工作正常..GCC奇怪的链接错误..适用于Visual Studio 2010的
/tmp/ccfcdCxg.o: In function `global constructors keyed to main':
codechef_permut2.cpp:(.text+0xa): undefined reference to `std::ios_base::Init::Init()'
codechef_permut2.cpp:(.text+0x19): undefined reference to `std::ios_base::Init::~Init()'
/tmp/ccfcdCxg.o: In function `ambig(unsigned long)':
codechef_permut2.cpp:(.text+0x47): undefined reference to `operator new[](unsigned long)'
codechef_permut2.cpp:(.text+0x52): undefined reference to `operator new[](unsigned long)'
/tmp/ccfcdCxg.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
collect2: ld returned 1 exit status
我力张贴任何代码,因为我认为它不是必需的,但如果有人觉得我会发布它。
在这种情况下,我不会发布答案,因为我觉得它不是必需 – jalf 2012-04-13 11:22:52
你用'gcc'或'G ++'链接? – 2012-04-13 11:23:51
你能告诉我们如何调用编译器吗?当您使用gcc而不是g ++编译C++代码时,可能会出现链接错误。 – 2012-04-13 11:23:52