这是我刚才问的这个问题的后续问题.顺便说一句,谢谢尼尔·巴特沃斯的帮助,Issue compiling c++ in c++builder
简单地回顾一下。我目前正在为大学开发一个C++程序,我在我的个人电脑(Mac)上使用了NetBeans6.8,这一切都是完美的。当我在windows分区或在大学PC上使用C++Builder 2009 & 2010尝试它们时,我得到了一些编译错误,通过添加以下头文件解决了这些错误:
#include <string>然而,现在该程序确实编译,但它没有运行,只是一个空白控制台。并在编译器的事件日志中获得以下信息:
Thread Start: Thread ID: 2024. Process Project1.exe (3280)
Process Start: C:\Users\Carlos\Documents\RAD Studio\Projects\Debug\Project1.exe. Base Address: $00400000. Process Project1.exe (3280)
Module Load: Project1.exe. Has Debug Info. Base Address: $00400000. Process Project1.exe (3280)
Module Load: ntdll.dll. No Debug Info. Base Address: $77E80000. Process Project1.exe (3280)
Module Load: KERNEL32.dll. No Debug Info. Base Address: $771C0000. Process Project1.exe (3280)
Module Load: KERNELBASE.dll. No Debug Info. Base Address: $75FE0000. Process Project1.exe (3280)
Module Load: cc32100.dll. No Debug Info. Base Address: $32A00000. Process Project1.exe (3280)
Module Load: USER32.dll. No Debug Info. Base Address: $77980000. Process Project1.exe (3280)
Module Load: GDI32.dll. No Debug Info. Base Address: $75F50000. Process Project1.exe (3280)
Module Load: LPK.dll. No Debug Info. Base Address: $75AB0000. Process Project1.exe (3280)
Module Load: USP10.dll. No Debug Info. Base Address: $76030000. Process Project1.exe (3280)
Module Load: msvcrt.dll. No Debug Info. Base Address: $776A0000. Process Project1.exe (3280)
Module Load: ADVAPI32.dll. No Debug Info. Base Address: $777D0000. Process Project1.exe (3280)
Module Load: SECHOST.dll. No Debug Info. Base Address: $77960000. Process Project1.exe (3280)
Module Load: RPCRT4.dll. No Debug Info. Base Address: $762F0000. Process Project1.exe (3280)
Module Load: SspiCli.dll. No Debug Info. Base Address: $759F0000. Process Project1.exe (3280)
Module Load: CRYPTBASE.dll. No Debug Info. Base Address: $759E0000. Process Project1.exe (3280)
Module Load: IMM32.dll. No Debug Info. Base Address: $763F0000. Process Project1.exe (3280)
Module Load: MSCTF.dll. No Debug Info. Base Address: $75AD0000. Process Project1.exe (3280)对于如何解决这一问题,我非常感谢任何帮助或建议。
P.S:如果有人想知道为什么我坚持使用C++Builder是因为它是IDE教授用来评估我们的作业的。
发布于 2010-03-18 03:34:20
我假设您已经启用了调试,甚至不能使用调试器(按F7或F8)进入main(),就像程序在进入main之前就崩溃了一样。如果有一个对象的全局(或静态)实例,并且对象的构造函数代码正在崩溃,这可能是一个问题。
如果你有一个全局对象。
MyClass object;
int main()
{ .... };尝试在main()中动态分配它。
MyClass *object = 0;
int main()
{ object = new MyClass;
....
};https://stackoverflow.com/questions/2466337
复制相似问题