私は、webots とビジュアル スタジオの両方に最新バージョン (2019) を使用しています。https: //cyberbotics.com/doc/guide/using-visual-studio-with-ウェボット。しかし、一度入力すると、以下のエラーが表示$(ProjectName).exeされLinker > General > Output Fileます。
"TargetPath(C:\Users\lighting\Documents\e-puck\controllers\e-puckParticle\Debug\MyController.exe) does not match the Linker's OutputFile property value (C:\Users\lighting\Documents\e-puck\controllers\e-puckParticle\MyController\MyController.exe).
This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile). MyController C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\Microsoft.CppBuild."
また、チュートリアルのセクション 3 に従って、次のヘッダーを持つコードを .cpp ファイルに入れると、別のエラーが発生します。
ヘッダー:
#include <webots/robot.h>
#include <webots/differential_wheels.h>
#include <webots/distance_sensor.h>
#include <webots/motor.h>
#include <webots/position_sensor.h>
#include <stdio.h>
#include <string.h>
エラー:
_main already defined in e-puck.obj
前もって感謝します!