用现成的dll文件可以生成lib文件吗?
重新编译需要lib文件,但是现在目录下只有dll那就用动态链接呗。 回复 2# mr_sev
dll不能用来编译
用这个可以从dll生成一个lib
http://digitalmars.com/ctg/implib.html
然而我估计这十有八九并不是你想要的。 本帖最后由 yakczh_cu 于 2017-04-18 12:18 编辑
回复 4# windoze
dm的link怎么指定lib文件?
-L参数好象不管用
-lgenerate list file -Lusing non-Digital Mars linker
stlport的放在d:\dm\stlport
测试程序
test.cpp
#include <iostream>
#include <vector>
using namespace std;
int main(){
vector<int>vi;
vi.push_back(100);
return 0;
}
dmc -c -cpp -Id:\dm\stlport\stlport -Id:\dm\includetest.cpp
可以编译通过
但是链接
link test,,,d:\dm\stlport\stlport\lib\stlp45dm_static.lib
提示File Not Found stlp45dm_static.lib
OPTLINK (R) for Win32Release 8.00.16
Copyright (C) Digital Mars 1989-2013All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
stlp45dm_static.lib
Warning 2: File Not Found stlp45dm_static.lib
SNN.lib
Warning 2: File Not Found SNN.lib
OPTLINK : Warning 23: No Stack
test.obj(test)
可以用 mingw32的dlltool,
比如我机器上的,
i586-mingw32msvc-dlltool --export-all-symbols --output-def xxx.def --output-lib xxx.lib xxx.dll
回复 4# windoze
常用这个。vs2010 编译的dll , implib 一下 给 C++builder用。
回复 6# codechurch
不同编译器导出的lib文件可以在编译时混用吗?
比如 MinGW 编译生成的dll 用dlltool导出lib文件, 然后可以用来用vc的cl来静态编译吗?
yakczh_cu 发表于 2017-04-19 10:11
回复 6# codechurch
不同编译器导出的lib文件可以在编译时混用吗?
可以。
lib本身是标准的,应该是coff格式的。
我就是这样编译出windows下的sdk给公司使用VC++的小组的。
页:
[1]