2010-03-17 77 views
1

这是我之前询问的这个问题的后续问题。顺便说一句感谢尼尔·巴特沃思的帮助 Issue compiling c++ in c++builderC++ Builder编译问题


快速回顾一下。我目前正在为大学开发一个C++程序,我在个人计算机(Mac)上使用Netbeans 6.8,并且这一切都很完美。当我尝试他们在我的Windows分区或在大学电脑使用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

就像我知道的CodeGear(Borland公司过去)有自己的编译器,通常可以很有点问题。你有没有尝试在调试模式下运行你的程序?它停在哪里? – Adi 2010-03-17 22:52:04

+0

@Adi:它不停止。 “检查项目依赖关系...” “编译Project1.cbproj(调试配置)” “成功” – Carlos 2010-03-17 23:04:26

+1

好的。但是,你是否试图在代码的开头放置一个断点,例如FormCreate()事件或main()函数? – Adi 2010-03-17 23:09:46

回答

1

我假设你已经启用了调试, ,你甚至无法用调试器(按[F7]或[F8]), 进入main(),就像程序在进入之前崩溃一样主要。 如果您有一个对象的全局(或静态)实例,并且该对象的构造函数代码崩溃,则这可能会造成问题。

如果你有一个全局对象I.e.

MyClass object; 
int main() 
{ .... }; 

尝试在main()中动态分配它。

MyClass *object = 0; 
int main() 
{ object = new MyClass; 
.... 
};