[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users


Hi everyone,

I want to start ROS2 development in visual studio 2017 or 2015. However, i encouner some problems so that I can't build my source code.
1. First step: I create Helloworldexample in visual studio 2017.
2. Second step: I add paths C:\dev\ros2\include;  
                               C:\dev\ros2\Lib; in the properties --> C/C++ --> General --> Additional Include Directories
3. Third step: I add fies: C:\dev\ros2\Lib\libfastrtps-1.5.lib;
                                  C:\dev\ros2\Lib\libfastcdr-1.0.lib; in the properties --> Linker --> Input --> Additional Dependencies
4. Forth step:Build --> error info below

1>------ Rebuild All started: Project: Project1, Configuration: Debug x64 ------
1>HelloWorld_main.cpp
1>HelloWorldSubscriber.cpp
1>HelloWorldPubSubTypes.cxx
1>HelloWorldPublisher.cpp
1>HelloWorld.cxx
1>Generating Code...
1>libfastrtps-1.5.lib(ThroughputControllerDescriptor.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in HelloWorld.obj
1>libfastrtps-1.5.lib(ThroughputControllerDescriptor.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in HelloWorld.obj
1>libfastrtps-1.5.lib(Param![Error_Info|689x459](upload://rDsPzbc5gCb6U8EMyF8hr56vODh.PNG)eterTypes.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in HelloWorld.obj
1>libfastrtps-1.5.lib(ParameterTypes.obj) : error LNK2038: mismatch detected for 'RuntimeLibrary': value 'MD_DynamicRelease' doesn't match value 'MDd_DynamicDebug' in HelloWorld.obj
1>libfastrtps-1.5.lib(QosPolicies.obj) : error LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in HelloWorld.obj





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/1) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users


As mentioned in the [Windows Development Setup instructions](https://github.com/ros2/ros2/wiki/Windows-Development-Setup#installing-visual-studio) we only test with Visual Studio 2015 at the moment. So I would highly recommend you to follow the instructions / stick to the same versions especially when using ROS 2 the first time.





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/2) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


Hi Thomas,

I have already tried it in the visual studio 2015. The problem is as same as that in above figure.
![Error_Info_15|675x500](upload://3R1eoOIiBdawl9WrQFiavMZx3E0.PNG)





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/3) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


It is not sufficient to just manually add include directories and link arguments that you have added.

The easiest thing to do right now would be to start with a cmake package, generate a visual studio project from that and work from there. That way you get the correct include directories and linker flags that you need based on what you're using. That flags will change depending on what you're using. If for instance you start out only using `rclcpp`, but then later also need to use messages from `sensor_msgs` then your include and linker flags will change. So specifying them manually is not advisable.





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/4) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


Thanks for your tips. I have tried:
1.  go to C:\dev\ros2\examples\c++\HelloWorldExample
2. mkdir build
3. cd build
4. cmake ..\  -G "Visual Studio 14 2015 Win64"
5. open HelloWorldExample(VC++ Project) with open Visual Studio 15
6. I add fies: C:\dev\ros2\Lib\libfastrtps-1.5.lib;
C:\dev\ros2\Lib\libfastcdr-1.0.lib; in the properties --> Linker --> Input --> Additional Dependencies
7.  Build

 Error Info:
2>------ Rebuild All started: Project: HelloWorldExample, Configuration: Debug x64 ------
2>  Building Custom Rule C:/dev/ros2/examples/C++/HelloWorldExample/src/HelloWorldExample/CMakeLists.txt
2>  CMake does not need to re-run because C:/dev/ros2/examples/C++/HelloWorldExample/src/HelloWorldExample/build_2/CMakeFiles/generate.stamp is up-to-date.
2>  HelloWorld.cxx
2>  HelloWorldPubSubTypes.cxx
2>  HelloWorldPublisher.cpp
2>  HelloWorldSubscriber.cpp
2>  HelloWorld_main.cpp
2>  Generating Code...
2>LINK : fatal error LNK1104: cannot open file 'libfastcdrd-1.0.lib'
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/5) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


![Error_Info_15_20_12_2017|663x500](upload://j2VRCtgZwUf6fXKEBEuxQ4EaMNJ.PNG)

I think it is the best thing that you can create some tutorials for users of ROS2.





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/6) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


Can you try to build in `Release` mode rather than `Debug` (can be selected in the tool bar at the top of the VS window) ?

If you build in Debug mode you need to add the debug libraries (note the trailing d) "libfastcdr-1.0**d**.lib". Our binaries provide only the Release libraries so you'll need to build the stack from source if you want to build `Debug` libraries.

Also, If you want to try ROS2 examples and build on top of them I encourage you to look at the examples in https://github.com/ros2/examples/. The examples you are trying to build right now are pure Fast-RTPS examples (installed by Fast-RTPS) and don't use ROS 2





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/7) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


Thank you for your answers.
HelloWorldExample: you are right! :relieved: If i switched into Release, it works.![Error_Info_15_20_12_2017_release|644x500](upload://ofxj2ZVKIB8FuNtonQBsCqMzbVG.PNG)





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/8) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


Hi marguedas:

I tried to build this example https://github.com/ros2/examples/:
 1. download  https://github.com/ros2/examples/ into dictionary C:\dev\ros2
 2. open developer cmd prompt for VS2015
 3. go to C:\dev\ros2\examples-master\rclcpp\minimal_publisher\
4. mkdir build
5. cd build
6. cmake ..\ -G "Visual Studio 14 2015 Win64"
7. open publisher_lambda(VC++ Project)
8. build
9. error info:
1>------ Build started: Project: ZERO_CHECK, Configuration: Release x64 ------
1>  Checking Build System
1>  CMake does not need to re-run because C:/dev/ros2/examples-master/rclcpp/minimal_publisher/build/CMakeFiles/generate.stamp is up-to-date.
2>------ Build started: Project: publisher_lambda, Configuration: Release x64 ------
2>  Building Custom Rule C:/dev/ros2/examples-master/rclcpp/minimal_publisher/CMakeLists.txt
2>  CMake does not need to re-run because C:/dev/ros2/examples-master/rclcpp/minimal_publisher/build/CMakeFiles/generate.stamp is up-to-date.
2>  lambda.cpp
2>C:\dev\ros2\examples-master\rclcpp\minimal_publisher\lambda.cpp(35): warning C4002: too many actual parameters for macro 'RCLCPP_INFO'
2>C:\dev\ros2\examples-master\rclcpp\minimal_publisher\lambda.cpp(35): error C2039: 'get_logger': is not a member of 'MinimalPublisher'
2>  C:\dev\ros2\examples-master\rclcpp\minimal_publisher\lambda.cpp(24): note: see declaration of 'MinimalPublisher'
2>C:\dev\ros2\examples-master\rclcpp\minimal_publisher\lambda.cpp(35): error C2039: '__this': is not a member of 'MinimalPublisher'
2>  C:\dev\ros2\examples-master\rclcpp\minimal_publisher\lambda.cpp(24): note: see declaration of 'MinimalPublisher'
========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/9) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


![Error_Info_15_20_12_2017_example|663x500](upload://1oeNGxXyEvwt1rMmMF81g2j893m.PNG)
this example run in Release mode.





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/10) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


You need to stick to consistent version across different packages. I assume you installed the latest release `ardent`. Then you should also fetch the `ardent` branch of the `examples` repo. Otherwise the code on the `master` branch might already use / require changes made since the release.





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/11) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


Hi Thomas,

Thanks for your reminders.
I have tried example-ardent branch. But those problems still exist.





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/12) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>
Reply | Threaded
Open this post in threaded view
|

[Discourse.ros.org] [Next Generation ROS] ROS2 application development in visual studio 2017 or 2015 (win 10 x64)

Thilo Zimmermann via ros-users
In reply to this post by Thilo Zimmermann via ros-users


Our CI system builds the current default branches successfully and was able to build the `ardent` branches for the release. So chances are that something is different on your system.

You might want to double check which versions of all packages are being used, try to wipe the workspace and build it again, look into the include directories being used (in this case the `node.hpp` header from the `rclcpp` package). Often posting the very exact steps you are running might allow other to reproduce the problem or you to determine where your process is different from the instructions.





---
[Visit Topic](https://discourse.ros.org/t/ros2-application-development-in-visual-studio-2017-or-2015-win-10-x64/3464/13) or reply to this email to respond.


If you do not want to receive messages from ros-users please use the unsubscribe link below. If you use the one above, you will stop all of ros-users from receiving updates.
______________________________________________________________________________
ros-users mailing list
[hidden email]
http://lists.ros.org/mailman/listinfo/ros-users
Unsubscribe: <http://lists.ros.org/mailman//options/ros-users>