Fast-CDR icon indicating copy to clipboard operation
Fast-CDR copied to clipboard

Fix: function definition is marked dllimport

Open felixf4xu opened this issue 1 year ago • 7 comments

Fix #209

felixf4xu avatar Jun 04 '24 01:06 felixf4xu

Thanks for the review.

At the same time, I have a question about the compiling switches. The issue only happens when fastcdr is built as a shared dll (on Windows), in ros2, it's BUILD_SHARED_LIBS. I'm just curious, this project has all code ready (the difinition of Cdr_DllAPI and all the other stuff) but this issue show that maybe it's never compiled on Windows as shared dll.

ROS2 actually supports Windows, maybe it's build as a static lib on Windows?

The reason why I asked is that I actually have begun to work on fastrtps as well, it has even more issues like this one, but again, fastrtsp seems to be ready for windows shared dll because it already has all the code there, just not tested, maybe nobody wants to build it on Windows as shared dll?

felixf4xu avatar Jun 06 '24 14:06 felixf4xu

And I see the github actions for this fastcdr project, Windows is also listed there. I'm curious if it's configured to compile as static lib?

I'm not familiar with github actions, is it possible to set some actions to build on windows as shared dll?

felixf4xu avatar Jun 06 '24 14:06 felixf4xu

@felixf4xu It might be something related with the compiler.

As stated in the supported platforms here, our tier 1 build system on Windows is Visual Studio 2019.

On that tier 1 platform we pass the CI with BUILD_SHARED_LIBS=ON, so the DLL system is always tested.

The error you mention in #209 is usually reported by MinGW. If you are building in MinGW then bear in mind that it is not an officially supported platform.

MiguelCompany avatar Jun 06 '24 15:06 MiguelCompany

Build status:

  • Linux Build Status
  • Mac Build Status
  • Windows Build Status

richiprosima avatar Jun 10 '24 06:06 richiprosima

Build status:

  • Linux Build Status
  • Mac Build Status
  • Windows Build Status

richiprosima avatar Jun 10 '24 06:06 richiprosima

@mergifyio rebase

MiguelCompany avatar Oct 01 '24 13:10 MiguelCompany

rebase

✅ Branch has been successfully rebased

mergify[bot] avatar Oct 01 '24 13:10 mergify[bot]

CI:

MiguelCompany avatar Nov 11 '24 07:11 MiguelCompany

CI run successfully on #247

MiguelCompany avatar Nov 11 '24 14:11 MiguelCompany