【发布时间】:2017-07-02 09:36:46
【问题描述】:
我有这个 CL.exe 命令
cl -Fesample.dll -Oi -LD -D NO_TRACE=1 -MT sample.cpp sample_dll.def
我想用 MinGW 在 Linux 上编译它,这就是我目前所拥有的
i586-mingw32msvc-gcc -Fesample.dll -shared -D NO_TRACE=1 sample.cpp sample_dll.def
跟踪 cl 命令选项
-Oi is optimisation -> not important at this point
-LD is for generating a dll -> replaced with -shared
-D is for setting a constant in the source -> same on both
-MT is for multithreading -> i was not able to find the mingw option for this as it seems it is not fully supported.
我错了吗?
但它不会编译,我真的不知道为什么。 我从测试中得到的错误是以太
-Cannot export samplefunction@4: symbol not defined
或者通过猜测改变命令时
-Error: invalid Suffix
-Warning: ‘somevariable’ initialized and declared ‘extern’
如果你能帮助我,请这样做。谢谢。
【问题讨论】:
-
我和你有类似的情况,正在阅读wyw.dcweb.cn/stdcall.htm
标签: c++ windows gcc compilation mingw