void start() {
stuff(); //code before mainCRTStartup
mainCRTStartup();
}
int main()
{
//other code
}
在 Visual C++ 中,它编译得很好,并且函数“stuff()”在 main 之前被调用。如何在“mainCRTStartup()”之前调用“stuff()”?在 Mingw(操作系统:Windows NT)上?它似乎忽略了“void start()”。
您可以使用ld
(链接器)的 -e 参数来指定start
您的入口点。
我不确定如何为ld
使用 mingw 提供参数;也许有人可以编辑我的答案来提供。
The real entry point is always start()
.
start()
calls mainCRTStartup()
that initializes CRT functions and call main()
, so in stuff()
, you can not use CRT functions.