Problems with creating my first own project("__builtin_expect" is undefined)

86 views
Skip to first unread message

chrisbe...@gmail.com

unread,
Mar 1, 2017, 6:00:51 AM3/1/17
to Ros on Windows
Hi there,

I am new at ROS. I tested my Msvc SDK and the two examples listener and talker are running without problems.
Then I tried to create my own project in Visual Studio 2015. I took the code from the talker example and changed all four project settings like it is described.
But Visual Studio shows me at error at the following linie: ROS_INFO("%s", msg.data.c_str());
It says identifier "__builtin_expect" is undefined.


Can someone help me?

Thanks!!

chrisbe...@gmail.com

unread,
Mar 1, 2017, 9:01:11 AM3/1/17
to Ros on Windows
 I tried the given example in C:\work\ws\src\win_ros\tutorials\msvc_sdk_tutorials but they also don't work. Visual Studio shows the same error "__builtin_expect" .

 In addition to that I installed Visual Studio 10 express and tried the same thing but then came the error of access violation 

chrisbe...@gmail.com

unread,
Mar 2, 2017, 4:42:22 AM3/2/17
to Ros on Windows
 I changed in console.h the lines  :

#ifdef WIN32
#define ROS_LIKELY(x)       (x)
#define ROS_UNLIKELY(x)     (x)
#else
//#define ROS_LIKELY(x)       __builtin_expect((x),1)
//#define ROS_UNLIKELY(x)     __builtin_expect((x),0)
//**************************************************************************************************
#define ROS_LIKELY(x)       (x)//replaced
#define ROS_UNLIKELY(x)     (x)
//*************************************************************************************************
#endif

Then I started my project again and it shows the follwing link-error, it seems that a dll is missing but there is no SerialzedMessage.dll I only found a header-file called  serialized_message

Error LNK2019 unresolved external symbol "__declspec(dllimport) public: __thiscall ros::SerializedMessage::SerializedMessage(class ros::SerializedMessage &&)" (__imp_??0SerializedMessage@ros@@QAE@$$QAV01@@Z) referenced in function "public: class ros::SerializedMessage __thiscall boost::_bi::list1<class boost::reference_wrapper<struct std_msgs::String_<class std::allocator<void> > const > >::operator()<class ros::SerializedMessage,class ros::SerializedMessage (__cdecl*)(struct std_msgs::String_<class std::allocator<void> > const &),class boost::_bi::list0>(class boost::_bi::type<class ros::SerializedMessage>,class ros::SerializedMessage (__cdecl*&)(struct std_msgs::String_<class std::allocator<void> > const &),class boost::_bi::list0 &,long)" (??$?RVSerializedMessage@ros@@P6A?AV01@ABU?$String_@V?$allocator@X@std@@@std_msgs@@@ZVlist0@_bi@boost@@@?$list1@V?$reference_wrapper@$$CBU?$String_@V?$allocator@X@std@@@std_msgs@@@boost@@@_bi@boost@@QAE?AVSerializedMessage@ros@@V?$type@VSerializedMessage@ros@@@12@AAP6A?AV34@ABU?$String_@V?$allocator@X@std@@@std_msgs@@@ZAAVlist0@12@J@Z)

Furthernmore I get in the following linie ROS_INFO("%s", msg.data.c_str()); a error: expected an expression 

G.A. vd. Hoorn - 3ME

unread,
Mar 2, 2017, 5:31:41 AM3/2/17
to win...@googlegroups.com
I'm not sure, but I have a feeling that winros isn't really maintained
anymore these days.

As much as I hate work-arounds and rather solve actual problems, I think
it would make more sense to look at some other options that are
maintained and provide you with similar functionality.

Do you have a hard requirement to use winros? Or do you just need to
connect to a ROS nodegraph from a windows environment?


Gijs

chrisbe...@gmail.com

unread,
Mar 2, 2017, 8:18:21 AM3/2/17
to Ros on Windows
Hi Gijs,

thank you for your quick response!

Unfortunately I am using sensors which only support windows.
I have to send some data from these sensors via node to a Linux computer.


I set the compiler to VS 2010 and started the project again and then I get several access violation errors.

'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ntdll.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\kernel32.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\KernelBase.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\opt\ros\hydro\x86\bin\roscpp.dll'. Symbols loaded.
'TestTalker.exe' (Win32): Loaded 'C:\opt\ros\hydro\x86\bin\rosconsole.dll'. Symbols loaded.
'TestTalker.exe' (Win32): Loaded 'C:\opt\ros\hydro\x86\bin\rostime.dll'. Symbols loaded.
'TestTalker.exe' (Win32): Loaded 'C:\opt\rosdeps\hydro\x86\lib\boost_date_time-vc-mt-1_47.dll'. Module was built without symbols.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp100.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr100.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\opt\rosdeps\hydro\x86\lib\boost_thread-vc-mt-1_47.dll'. Module was built without symbols.
'TestTalker.exe' (Win32): Loaded 'C:\opt\rosdeps\hydro\x86\bin\log4cxx.dll'. Module was built without symbols.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\advapi32.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcrt.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sechost.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\rpcrt4.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\sspicli.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\cryptbase.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\odbc32.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\user32.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\gdi32.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\lpk.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\usp10.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\ws2_32.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nsi.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\opt\rosdeps\hydro\x86\lib\boost_regex-vc-mt-1_47.dll'. Module was built without symbols.
'TestTalker.exe' (Win32): Loaded 'C:\opt\rosdeps\hydro\x86\lib\boost_system-vc-mt-1_47.dll'. Module was built without symbols.
'TestTalker.exe' (Win32): Loaded 'C:\opt\ros\hydro\x86\bin\roscpp_serialization.dll'. Symbols loaded.
'TestTalker.exe' (Win32): Loaded 'C:\opt\ros\hydro\x86\bin\xmlrpcpp.dll'. Symbols loaded.
'TestTalker.exe' (Win32): Loaded 'C:\opt\rosdeps\hydro\x86\lib\boost_signals-vc-mt-1_47.dll'. Module was built without symbols.
'TestTalker.exe' (Win32): Loaded 'C:\opt\rosdeps\hydro\x86\lib\boost_filesystem-vc-mt-1_47.dll'. Module was built without symbols.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcr100d.dll'. Symbols loaded.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msvcp100d.dll'. Symbols loaded.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\imm32.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\msctf.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\PROGRA~2\Sophos\SOPHOS~1\SOPHOS~1.DLL'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\psapi.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\odbcint.dll'. Module was built without symbols.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\nlaapi.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\NapiNSP.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\pnrpnsp.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\mswsock.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\dnsapi.dll'. Cannot find or open the PDB file.
'TestTalker.exe' (Win32): Loaded 'C:\Windows\SysWOW64\winrnr.dll'. Cannot find or open the PDB file.
Exception thrown at 0x7595C54F in TestTalker.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x001AF51C.
Exception thrown at 0x7595C54F in TestTalker.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x001AED00.
Exception thrown at 0x7595C54F in TestTalker.exe: Microsoft C++ exception: [rethrow] at memory location 0x00000000.
Unhandled exception at 0x7595C54F in TestTalker.exe: Microsoft C++ exception: std::bad_alloc at memory location 0x001AED00.

What are these dlls?


 

G.A. vd. Hoorn - 3ME

unread,
Mar 2, 2017, 8:23:17 AM3/2/17
to win...@googlegroups.com
On 2-3-2017 14:18, chrisbe...@gmail.com wrote:
> Hi Gijs,
>
> thank you for your quick response!
>
> Unfortunately I am using sensors which only support windows.
> I have to send some data from these sensors via node to a Linux computer.
[..]

but that doesn't mean you /have/ to use winros.

A few alternatives:

- rosserial_windows [1]
- rosbridge_suite [2] (with [3] fi)
- ros.net [4]
- rosjava [5]

If all you want to do is get some sensor data published to your Linux
ROS application, I would use one of these.


Gijs

[1] http://wiki.ros.org/rosserial_windows
[2] http://wiki.ros.org/rosbridge_suite
[3] https://github.com/follesoe/rosbridge_client_dot_net
[4] https://github.com/uml-robotics/ROS.NET
[5] http://wiki.ros.org/rosjava

chrisbe...@gmail.com

unread,
Mar 2, 2017, 8:38:10 AM3/2/17
to Ros on Windows
Thank you very much Gijs!!

Which one do you prefer?

G.A. vd. Hoorn - 3ME

unread,
Mar 2, 2017, 10:23:23 AM3/2/17
to win...@googlegroups.com
On 2-3-2017 14:38, chrisbe...@gmail.com wrote:
> Thank you very much Gijs!!
>
> Which one do you prefer?

I don't have a preference.

rosserial_windows is probably more used than the
rosbridge_suite<->rosbridge_client_dot_net combo, but is also more
'low-level' and c(++) vs c#.

I think it really depends on what your experiences are with some of the
involved languages.


Gijs

chrisbe...@gmail.com

unread,
Mar 15, 2017, 5:20:20 AM3/15/17
to Ros on Windows
Thank you Gijs,

But I have no idea how to install rosserial_windows. Do I have to build it from the source https://github.com/ros-drivers/rosserial
Then I looked at the tutorial http://wiki.ros.org/rosserial_windows/Tutorials/Hello%20World, there are the following commands in the installation section:

sudo apt-get install ros-hydro-rosserial-windows
sudo apt-get install ros-hydro-rosserial-server

sudo seems to be Linux command. Do I need another program?

Chris

G.A. vd. Hoorn - 3ME

unread,
Mar 15, 2017, 5:22:23 AM3/15/17
to win...@googlegroups.com, chrisbe...@gmail.com
rosserial has two sides: a Linux side that runs the server and a Windows
side (in your case) that is the client.

The two commands you quote install the server and the client package,
which is essentially a code generator that generates C++ code for you
that you should then copy to your Windows machine and use as part of a
Visual Studio (or something else) project.


Gijs
Message has been deleted

G.A. vd. Hoorn - 3ME

unread,
Mar 15, 2017, 7:15:34 AM3/15/17
to win...@googlegroups.com
On 15-3-2017 11:27, chrisbe...@gmail.com wrote:
> Thanks your quik response!
>
>
>
>> The two commands you quote install the server and the client package,
>> which is essentially a code generator that generates C++ code for you
>> that you should then copy to your Windows machine and use as part of a
>> Visual Studio (or something else) project.
>>
>
> These two commands don't run in my cmd, so what do I need to install this
> server and the client package ?

I don't understand your question.


Gijs

chrisbe...@gmail.com

unread,
Mar 15, 2017, 8:22:56 AM3/15/17
to Ros on Windows

> These two commands don't run in my cmd, so what do I need to install this
> server and the client package ?

I don't understand your question.

I don't know how to install ros_serial.
I don't know where to write those two commands, so that rosserial is installed.

For example win_ros: there is a guide (http://wiki.ros.org/win_ros/hydro/Msvc%20SDK) what software you need, what you have to do and so on...

Something similiar to a guide I found in the tutorial example Hello World (http://wiki.ros.org/rosserial_windows/Tutorials/Hello%20World)  where I found those two commands, but I don't know what to do with those.




G.A. vd. Hoorn - 3ME

unread,
Mar 15, 2017, 11:13:08 AM3/15/17
to win...@googlegroups.com
install everything on the Linux side. Then use the scripts in
rosserial_windows to generate the necessary code.

It's actually quite well described on the wiki [1]:

"This package contains Windows-specific extensions required to run
rosserial_client on an Windows. It will generate a package of headers
and a few cpp files that you will need to add to your Visual Studios
project in order to communicate with a ROS system, usually over a TCP
socket."

And [2]:

"The workflow is generally:

1. From the ROS based system, generate the ros_lib code
2. Drop the ros_lib code into a Visual Studios Solution
3. Write code to use ros_lib to connect to the ROS master and
send/receive messages
4. Run rosserial_server socket on ROS master
5. Compile and run Windows app"

You will /always/ need to run the ROS side of rosserial when you are
running your application on Windows. But for development you'd basically
work with the generated code.

Btw: I would recommend opening a question on ROS Answers about this
(please check first if your questions perhaps have already been asked &
answered) instead of using this mailing list.

Besides the list being practically abandoned, discussing rosserial is
off-topic.


Gijs

[1] http://wiki.ros.org/rosserial_windows
[2] http://wiki.ros.org/rosserial_windows/Tutorials/Hello%20World

chrisbe...@gmail.com

unread,
Mar 16, 2017, 6:16:31 AM3/16/17
to Ros on Windows
Thank you very much Gijs !!


Reply all
Reply to author
Forward
0 new messages