3

我想在 Eclipse 中将 C++ 代码包装到 Perl。现在我得到以下错误:

12:49:51 **** Incremental Build of configuration Debug for project TestDLLCPP ****
Info: Internal Builder is used for build
g++ "-LC:\\work\\Perl-5.12.4-Build1205-64Bit\\lib\\CORE" -shared -o libTestDLLCPP.dll interface_wrap.o example.o -lperl512 
interface_wrap.o: In function `SWIG_croak_null':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1036: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1036: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1040: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1040: undefined reference to `Perl_sv_isobject'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1041: undefined reference to `Perl_croak_nocontext'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1043: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1043: undefined reference to `Perl_sv_2pv_flags'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1043: undefined reference to `Perl_croak_nocontext'
interface_wrap.o: In function `SWIG_Perl_ConvertPtrAndOwn':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1129: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1129: undefined reference to `Perl_mg_get'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1132: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1132: undefined reference to `Perl_sv_isobject'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1138: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1138: undefined reference to `Perl_mg_find'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1141: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1141: undefined reference to `Perl_sv_isobject'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1143: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1143: undefined reference to `Perl_sv_2iv_flags'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1150: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1150: undefined reference to `Perl_sv_2iv_flags'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1201: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1201: undefined reference to `Perl_hv_common_key_len'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1203: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1203: undefined reference to `Perl_gv_add_by_type'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1208: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1208: undefined reference to `Perl_hv_common'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1209: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1209: undefined reference to `Perl_hv_common'
interface_wrap.o: In function `SWIG_Perl_MakePtr':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1225: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1225: undefined reference to `Perl_newSV'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1226: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1226: undefined reference to `Perl_newSV_type'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1228: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1228: undefined reference to `Perl_sv_setref_pv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1232: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1232: undefined reference to `Perl_hv_common_key_len'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1234: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1234: undefined reference to `Perl_gv_init'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1235: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1235: undefined reference to `Perl_gv_add_by_type'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1236: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1236: undefined reference to `Perl_newSViv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1236: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1236: undefined reference to `Perl_hv_common'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1238: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1238: undefined reference to `Perl_sv_magic'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1239: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1239: undefined reference to `Perl_sv_free2'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1239: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1239: undefined reference to `Perl_sv_free'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1240: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1240: undefined reference to `Perl_newRV_noinc'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1241: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1241: undefined reference to `Perl_sv_setsv_flags'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1242: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1242: undefined reference to `Perl_sv_free2'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1242: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1242: undefined reference to `Perl_sv_free'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1243: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1243: undefined reference to `Perl_sv_bless'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1246: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1246: undefined reference to `Perl_sv_setref_pv'
interface_wrap.o: In function `SWIG_Perl_NewPointerObj':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1252: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1252: undefined reference to `Perl_sv_newmortal'
interface_wrap.o: In function `SWIG_Perl_MakePackedObj':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1265: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1265: undefined reference to `Perl_sv_setpv'
interface_wrap.o: In function `SWIG_Perl_NewPackedObj':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1270: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1270: undefined reference to `Perl_sv_newmortal'
interface_wrap.o: In function `SWIG_Perl_ConvertPacked':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1282: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1282: undefined reference to `Perl_sv_2pv_flags'
interface_wrap.o: In function `swig_create_magic':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1353: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1353: undefined reference to `Perl_sv_magic'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1354: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1354: undefined reference to `Perl_mg_find'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1355: undefined reference to `_imp__win32_malloc'
interface_wrap.o: In function `SWIG_Perl_GetModule':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1371: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1371: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1373: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1373: undefined reference to `Perl_sv_2iv_flags'
interface_wrap.o: In function `SWIG_Perl_SetModule':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1385: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1385: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1386: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1386: undefined reference to `Perl_sv_setiv'
interface_wrap.o: In function `SWIG_AsVal_double':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1574: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1574: undefined reference to `Perl_sv_2nv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1577: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1577: undefined reference to `Perl_sv_2iv_flags'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1580: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1580: undefined reference to `Perl_sv_2pv_flags'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1584: undefined reference to `_imp__win32_errno'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1586: undefined reference to `_imp__win32_errno'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1587: undefined reference to `_imp__win32_errno'
interface_wrap.o: In function `SWIG_CanCastAsInteger':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1614: undefined reference to `_imp__win32_errno'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1614: undefined reference to `_imp__win32_errno'
interface_wrap.o:C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1615: more undefined references to `_imp__win32_errno' follow
interface_wrap.o: In function `SWIG_AsVal_long':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1641: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1641: undefined reference to `Perl_sv_2uv_flags'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1648: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1648: undefined reference to `Perl_sv_2iv_flags'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1656: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1656: undefined reference to `Perl_sv_2pv_flags'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1660: undefined reference to `_imp__win32_errno'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1662: undefined reference to `_imp__win32_errno'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1663: undefined reference to `_imp__win32_errno'
interface_wrap.o: In function `SWIG_From_long':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1706: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1706: undefined reference to `Perl_newSViv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1709: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1709: undefined reference to `Perl_sv_2mortal'
interface_wrap.o: In function `swig_magic_readonly':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1732: undefined reference to `Perl_croak_nocontext'
interface_wrap.o: In function `wrap_new_Foo':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1752: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1752: undefined reference to `Perl_Istack_sp_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1752: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1752: undefined reference to `Perl_Imarkstack_ptr_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1752: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1752: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1755: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1755: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1755: undefined reference to `Perl_sv_setpvf_nocontext'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1757: undefined reference to `Foo::Foo()'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1758: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1758: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1759: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1759: undefined reference to `Perl_Istack_sp_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1759: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1759: undefined reference to `Perl_Istack_base_ptr'
interface_wrap.o: In function `wrap_delete_Foo':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1772: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1772: undefined reference to `Perl_Istack_sp_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1772: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1772: undefined reference to `Perl_Imarkstack_ptr_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1772: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1772: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1775: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1775: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1775: undefined reference to `Perl_sv_setpvf_nocontext'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1777: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1777: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1779: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1779: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1779: undefined reference to `Perl_sv_setpvf_nocontext'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1782: undefined reference to `Foo::~Foo()'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1783: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1783: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1783: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1783: undefined reference to `Perl_sv_newmortal'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1785: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1785: undefined reference to `Perl_Istack_sp_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1785: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1785: undefined reference to `Perl_Istack_base_ptr'
interface_wrap.o: In function `wrap_Foo_bar':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1803: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1803: undefined reference to `Perl_Istack_sp_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1803: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1803: undefined reference to `Perl_Imarkstack_ptr_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1803: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1803: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1806: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1806: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1806: undefined reference to `Perl_sv_setpvf_nocontext'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1808: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1808: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1810: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1810: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1810: undefined reference to `Perl_sv_setpvf_nocontext'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1813: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1813: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1815: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1815: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1815: undefined reference to `Perl_sv_setpvf_nocontext'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1818: undefined reference to `Foo::bar(int)'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1819: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1819: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1822: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1822: undefined reference to `Perl_Istack_sp_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1822: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:1822: undefined reference to `Perl_Istack_base_ptr'
interface_wrap.o: In function `boot_example':
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2111: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2111: undefined reference to `Perl_Istack_sp_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2111: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2111: undefined reference to `Perl_Imarkstack_ptr_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2111: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2111: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2120: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2120: undefined reference to `Perl_newXS'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2129: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2129: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2133: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2133: undefined reference to `Perl_sv_setiv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2141: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2141: undefined reference to `Perl_get_sv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2144: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2144: undefined reference to `Perl_sv_setiv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2147: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2147: undefined reference to `Perl_sv_setnv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2150: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2150: undefined reference to `Perl_sv_setpv'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2165: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2165: undefined reference to `Perl_Istack_base_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2165: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2165: undefined reference to `Perl_Isv_yes_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2166: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2166: undefined reference to `Perl_Istack_sp_ptr'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2166: undefined reference to `Perl_get_context'
C:\Users\sesc3661\workspace\TestDLLCPP\Debug/../interface_wrap.cxx:2166: undefined reference to `Perl_Istack_base_ptr'
collect2: ld gab 1 als Ende-Status zurück

12:49:52 Build Finished (took 1s.224ms)

代码如下所示:

/*
 * example.cpp
 *
 *  Created on: 13.11.2012
 *      Author: sesc3661
 */
#include "example.h"

class FooProxy {
private:
      int   x;
public:
      FooProxy() {
      }
     ~FooProxy() {
      }
      int bar(int x) {
            return x;
      }
      int x_get() {
            return this->x;
      }
      void x_set(int x) {
            this->x = x;
      }
};

这是头文件:

class Foo {
public:
      Foo();
     ~Foo();
      int  bar(int x);
};

这是接口文件:

/* example.i */
%module example
%{
 /* Lazzy example, add header in the .i and not much work needed from now on */
#include "example.h"
%}

%include "example.h"

我的目标是将 C++ - 代码包装为 Perl 可执行代码。因此,我需要 SWIG 作为包装器来创建 .dll 和 Perl 代码之间的接口。

4

1 回答 1

0

我犯了一个错误:这是错误的(64 位)Perl 版本,我必须将生成的 .dll 文件重命名为 example.dll。

于 2012-11-14T13:31:38.747 回答