dllwrap是GNU在明明市.It中使用的工具,可以用来构建.dll文件,如GCC或g++.but,我发现它在下面这样做时效果不佳:
hello3.cpp
#include<iostream>
extern "C" void MyDllSay( void )
{
}hello3.def
LIBRARY hello3.dll
EXPORTS
MyDllSay @1
hello = MyDllSay @2 编译器代码是
g++.exe -c -O3 hello3.cpp dllwrap.exe -o hello3.dll hello3.o --def hello3.def -output-lib libhello3.a
错误报告是
hello3.o:hello3.cpp:(.text+0x8):对
std::ios_base::Init::~I nit()' hello3.o:hello3.cpp:(.text.startup+0xc): undefined reference tostd::ios_base::Init::Init()‘收藏品2.exe:错误: ld返回1退出状态的未定义引用
如果我像这样设置hello3.cpp
//#include<iostream>
#include<fstream>
extern "C" void MyDllSay( void )
{
}或者像这样
//#include<iostream>
extern "C" void MyDllSay( void )
{
}百事大吉。如何使包装与碘流工作?
提前感谢您的帮助!
发布于 2015-01-28 15:58:36
我刚刚测试了.It中的a选项,效果很好,我会进一步检查它。但我在旧维基里找不到解释
选择是
-lstdc++新编译器是dllwrap.exe -o hello3.dll hello3.o --def hello3.def -output- libhello3.a -lstdc++
https://stackoverflow.com/questions/28195981
复制相似问题