0

I am using the last version (2019) for both webots and visual studio, what i'm trying to do is to connect these two according to https://cyberbotics.com/doc/guide/using-visual-studio-with-webots. but once i put $(ProjectName).exe in Linker > General > Output File I'll get the error below:

"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."

Also when i put some code with following headers in a .cpp file according to section 3 of the tutorial, i get another error:

headers:

#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>

The error:

_main already defined in e-puck.obj 

Thanks in advance!

lighting
  • 400
  • 2
  • 13
  • Did you try to use the Webots controller wizard (from the Wizard menu) to create your Visual Studio controller? – Olivier Michel Jun 18 '19 at 12:14
  • @Olivier Michel I tried it but again when i put my code in a .cpp file i get this error ```main already defined in my_controller``` , ```my_controller``` is the name of controller i just created with wizard. – lighting Jun 18 '19 at 14:03
  • 1
    I just fixed the problem! that was stupid of me, it had a default .cpp file in the directory with a main function and i simply replaced my code with it. Thanks anyway! – lighting Jun 18 '19 at 17:06

0 Answers0