ros-windows / win_ros

Windows support for Ros (Robot Operating System)
http://www.ros.org/wiki/win_ros
23 stars 16 forks source link

Debug mode crashes #41

Closed stonier closed 11 years ago

stonier commented 11 years ago

Crashing in debug mode. Reported by flavio:

For me i found that only the release mode works when Msvc Gui. In the Debug mode i get
Unhandled exception at 0x760fc41f (KernelBase.dll) in ros_test.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x003dec40..
i am pretty sure that i set all the settings according to the tutorial. However release mode just works fine. can you confirm this?
stonier commented 11 years ago

Flavio, is ros_test.exe your own test app here?

Just covering bases, are you trying to build a debug application that links to the release ros dll's?

flaviofontana commented 11 years ago

Hi Daniel Thanks for your help.

Yes ros_test.exe is my own app. But you might be right, i suspect now that i linked against the release dll's, I just followed the instuctions on the tutorial

ROS_BUILD_SHARED_LIBS=1;
C:\opt\rosdeps\groovy\x86\lib;C:\opt\ros\groovy\x86\lib;%(AdditionalLibraryDirectories)
roscpp.lib;roscpp_serialization.lib;rosconsole.lib;rostime.lib;

when installing ros with the installer are the debug dll's even provided or do i neet to compile everything by hand according to http://wiki.ros.org/win_ros/groovy/Msvc%20Compiled%20SDK. Then we should refer to this and mention how to compile the debug dll's.

flavio

stonier commented 11 years ago

I remember reading when doing the winros development that you can't generally mix windows debug and release shared libraries. Very fundamental things like string implementations have incompatibilities.

Mixing debug and release was one thing that I took for granted since in the linux world it just works. Digging deeper you find that they made a conscious decision to sacrifice a few minor speed benefits (in string implementations anyway) to allow for debug and release compatibility because that ensured a more stable and convenient development/testing environment for the whole ecosystem.

TODO: add link to the information about string implementations here if I come across it again.

stonier commented 11 years ago

I updated the wiki. Closing this issue - reopen it if you keep having problems.