本文介绍了错误“未定义参考";在MinGW中链接时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我已经使用 MinGW
从源代码中获得了目标文件
.
I have got the object-file
from source code using MinGW
.
但是在链接上:
ld -o test.exe test.o
我遇到错误,例如以下内容:
I get errors, for example the following:
推荐答案
我们可以通过命令查看编译器运行的命令
We can view commands ran by compiler via command
c99 -v test.o
我们会收到一些文字.包含"COLLECT_CGG_OPTIONS"的字符串之后的所有字符均为ld的参数.但是可执行文件的大小比以前的方法要大得多.
We'll get some text. All after string which contains "COLLECT_CGG_OPTIONS" will be arguments of ld.But size of executable file is much more then size of file got by previous way.
这篇关于错误“未定义参考";在MinGW中链接时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!