未从Visual C ++ 6.0内部加载时程序崩溃 [英] Program crashes when not loaded from inside Visual C++ 6.0

查看:79
本文介绍了未从Visual C ++ 6.0内部加载时程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,我在这里的第一篇文章,我非常需要帮助! :)


当我运行Visual C ++ 6.0并打开我的.cpp文件时,我编译,构建并运行程序,一切正常。但是,如果我关闭Visual并尝试从Debug文件夹运行程序.exe,它会在程序中途崩溃:(我不明白为什么..i将不会发布我的程序的代码,因为它很长很乱。希望有人知道解决方案。

Hi guys, my first post here, im desperately in need of help! :)

When i am running Visual C++ 6.0 and have my .cpp file opened, i compile, build and run the program, it all works fine. But if i close Visual and try to run the program .exe from the Debug folder, it crashes half way through the program :( i dont understand why ..i will refrain from posting the code for my program since its quite long and messy.. hope anyone knows a solution.

推荐答案


大家好,我的第一篇文章,我非常需要帮助!:)


当我运行Visual C ++ 6.0并打开我的.cpp文件时,我编译,构建并运行程序,一切正常。但是,如果我关闭Visual并尝试从Debug文件夹运行程序.exe,它会在程序中途崩溃:(我不明白为什么..i将不会发布我的程序的代码,因为它很长很乱。希望有人知道解决方案。
Hi guys, my first post here, im desperately in need of help! :)

When i am running Visual C++ 6.0 and have my .cpp file opened, i compile, build and run the program, it all works fine. But if i close Visual and try to run the program .exe from the Debug folder, it crashes half way through the program :( i dont understand why ..i will refrain from posting the code for my program since its quite long and messy.. hope anyone knows a solution.



你知道崩溃的地方吗?尝试使用print语句作为调试语句(即:cout<<<" Reached'' double calculate_average()''function\\\
";),你可以看到它的位置。


我猜你编码了一条相对路径,然后从一个不同的位置,但这只是一个疯狂的猜测提供的信息......

Do you know where it crashes? Try using print statements as debug statements (ie: cout << "Reached ''double calculate_average()'' function\n";), you can see where it goes down.

I''m guessing you coded a relative path, and then are executing from a different location, but that''s just a wild guess with the information provided...


感谢您的回复非常快!:)


我猜你编码了一条相对路径,然后从不同的位置执行,但这只是对所提供信息的疯狂猜测......


-sorry,我甚至不知道我知道这意味着什么:o当我第一次开始制作程序时,我做了通常的win32控制台应用程序+ C ++源文件的事情。然后选择桌面作为保存它的目标。所以我的程序有一个文件夹,里面是我的程序的.exe,我只是双击,这就是它崩溃的一半。但是,当我双击.cpp文件并编译+ build + run时,它不会崩溃:/非常奇怪..以及关于使用cout<<为了能够确切地看到它崩溃的地方,thx的建议,将尝试,可能明天,因为我今天有这个;)呵呵..但据我所知,它是这样的:(在程序中) 要解决使用QR,按1:

解决使用正规方程式,按2:


所以当我按1或2时,它在我按下回车后直接崩溃..但是就像香港专业教育学院所说当它从Visual C ++里面加载时,它会继续使用上面选择的方法进行计算,就像它应该......反正这已经很久了:P


thx给任何对我有更多建议的人!
thanks for a really fast reply! :)

"I''m guessing you coded a relative path, and then are executing from a different location, but that''s just a wild guess with the information provided..."

-sorry, im not even sure i know what that means :o when i first started making the program i did the usual "win32 console application + C++ source file thing" and then chose the desktop as the destination to save it. So there is a folder for my program and inside it is the .exe for my program which i just double click, and thats when it crashes half way through. But when i double click the .cpp file and compile+build+run it doesnt crash :/ very strange ..and about using cout<< to be able to see exactly where it crashes, thx for the advice, will try that, probably tomorrow since ive had it for today with this ;) hehe ..but as far as i can see its like this : (in the program) "to solve using QR, press 1:
to solve using normal equations, press 2:"

So when i press 1 or 2, it crashes directly after i press enter.. but like ive said when its loaded from inside Visual C++, it proceeds to calculate using the chosen method from above, like it should.. anyways, this is getting long :P

thx to anyone who has more advice for me!


我怀疑你手动执行的程序不是由VC 6.0编译的程序。


执行此操作:


1)在您选择的新路径上创建新的C ++控制台应用程序项目。

2)移动您的。 cpp和.h文件到该项目文件夹

3)将.cpp文件添加到t他的项目

4)构建项目

5)执行VC 6.0中的代码

6)导航到该项目的Debug文件夹

7)双击
I suspect the program you are executing manually is not the program being compiled by VC 6.0.

Do this:

1) Create new C++ Console Application project on a new path YOU SELECT.
2) Move your .cpp and .h files to that project folder
3) Add the .cpp files to the project
4) Build the project
5) Execute the code in VC 6.0
6) Navigate to the Debug folder for that project
7) Execute the .exe by double clicking


这篇关于未从Visual C ++ 6.0内部加载时程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆