ros2 / rmw_iceoryx

rmw implementation for iceoryx
Apache License 2.0
144 stars 27 forks source link

unresolved external symbol __progname #94

Closed felixf4xu closed 9 months ago

felixf4xu commented 1 year ago

Hi,

I'm trying to build (branch humble) in win11 and VS2022 and I had a link error:

rmw_init.obj : error LNK2001: unresolved external symbol __progname [C:\ros\humble\build\rmw_iceoryx_cpp\rmw_iceoryx_cpp.vcxproj]

the code is at: https://github.com/ros2/rmw_iceoryx/blob/4134ce2c2ff8adfe2fb85cc67d644065e316f3bc/rmw_iceoryx_cpp/src/rmw_init.cpp#L98

I searched but the extern name of __progname is never found. Then in the whole source code of ROS2, I found

https://github.com/ros2/rcutils/blob/025f78fa7c03666b5fa1057af00a32ed8bbd64a0/src/process.c#LL71C1-L74C6

#elif defined __QNXNTO__ || defined __OHOS__
  extern char * __progname;
  const char * appname = __progname;
#else

but I'm not sure if it's related.

mossmaurice commented 9 months ago

@felixf4xu Thanks for reporting this issue and apologies for the late reply!

You are right, rcutils offers a platform-independent rcutils_get_executable_name function to get the process name. I opened #97.

However, please be aware Windows is not (yet) officially supported. Hence, you might bump into other unknown issues. Feel free to report them or even to fix them :relaxed:

felixf4xu commented 9 months ago

@mossmaurice thanks for the fix, it works in my build.