这是我之前提到的这个问题的后续问题。顺便说一句,感谢Neil Butterworth的帮助 Issue compiling c++ in c++builder
快速回顾一下。我正在为大学开发一个C ++程序,我在我的个人电脑(Mac)上使用了Netbeans 6.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教授用来评估我们的作业。
答案 0 :(得分:1)
我假设您已启用调试, 你甚至无法使用调试器进入main()(按[F7]或[F8]), 就像程序在进入main之前崩溃一样。 如果您有一个对象的全局(或静态)实例,并且该对象的构造函数代码崩溃,则可能会出现问题。
如果你有一个全局对象I.e.
MyClass object;
int main()
{ .... };
尝试在main()中动态分配它。
MyClass *object = 0;
int main()
{ object = new MyClass;
....
};