【发布时间】:2015-06-30 18:53:13
【问题描述】:
对于代码中大量的 cmets 感到抱歉。这些要么是提醒、笔记或失败的补充,我想保留在手边,以防我最终使用它们。
我从一开始就一直在努力解决这个问题,我无能为力,也没有我在网上找到的任何东西。我的代码构建很好,100% 成功,但每次我调试/运行我的代码(这是 Visual Studio 2015 顺便说一句)我都会收到以下消息:
微软视觉工作室
无法启动程序“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
-
我假设您不知道如何使用您的工具(即使您的代码 TLDR 可能有错误;)
-
我在 Visual Studio 2010 中也遇到了同样的情况...
-
由于这是一个简单的程序,您可能只需要从命令行编译,就可以保留 VS 的复杂性和“用户友好性”。我也更喜欢大型项目,因为我想避免供应商锁定和绑定到一个平台。