![](/img/trans.png)
[英]C++ error: "Unable to start program 'filepath.exe' The system cannot find the file specified
[英]Unable to Start Program: The system cannot find the file specified. (C++ BTW)
抱歉,代码中包含大量注释。 这些要么是提醒,便笺,要么是失败的补充,如果我最终使用它们,我想保留它们。
从一开始,我就一直在努力解决这个问题,但我无能为力,也找不到任何在线有效的方法。 我的代码构建很好,取得了100%的成功,但是每次我调试/运行我的代码时(这是visual studio 2015 btw),我都会收到以下消息:
无法启动程序'C:\\ Users \\ moodyg \\ Documents \\ Visual Studio 2015 \\ Projects \\ floatingballtry2 \\ Debug \\ floatingballtry2.exe'。
该系统找不到指定的文件。
该文件确实位于该位置。 我进去检查了无数次,并且在该确切位置有一个用于代码的调试exe文件。
感谢所有!
码:
#include <iostream>
//#include SerialClass.h
#include 'stdafx.h'
using namespace std;
#define _USE_MATH_DEFINES
#include <math.h>
#include <stdio.h>
#include <tchar.h>
//#include "SerialClass.h" // Library described above
#include <string>
//#include "LpmsSensorManagerI.h"
//include "LpmsSensorI.h"
using std::cout;
using std::endl;
//LpmsSensorManagerI* manager = SensorManagerFactory();
//LpmsSensorI* lpms = manager->addSensor(DEVICE_LPMS_B,'00:11:22:33:44:55');
void main() {
//Serial* SP = new Serial("\\\\.\\COM3"); // adjust as needed
//a = arduino('com4', 'UNO');
bool isspinning = true;
int moz = 4;
int moth = 0 ;
int moph = 0;
//set water release time
while (isspinning == true) {
//pitch = lpms->GET_PITCH();
//yaw = lpms->GET_YAW();
//moth += yaw;
//moph += pitch;
if (moth > (2 * M_PI)) {
moth = 0;
}
if (moph > (2 * M_PI)) {
moph = 0;
}
cout << "Radius: " + moz << endl;
cout << "Theta: " + moth << endl;
cout << "Phi: " + moph << endl;
if (moth >= (M_PI / 2) - (M_PI / 8) && moth <= (M_PI / 2) + (M_PI/
8))
{
if (moph >= (M_PI / 2) - (M_PI / 8) && moph <= (M_PI / 2) + (M_PI /
8))
{
//release water
isspinning = false;
}
}
else {
isspinning = false;
}
}
cout << "Radius: " + moz << endl;
cout << "Theta: " + moth << endl;
cout << "Phi: " + moph << endl;
}
您很可能缺少DLL。 尝试直接从Windows控制台运行生成的.exe
文件,因为它通常会报告缺少哪个DLL。 返回您遇到的错误。
我没有使用过VS2005,但是也许您缺少VC ++ 2005可再发行组件(可在此处获得 )。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.