Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use IMAGE_TRANSPORT_PUBLIC at class level for windows gcc build #316

Open
wants to merge 2 commits into
base: rolling
Choose a base branch
from

Conversation

felixf4xu
Copy link

Hi,

When I compile this project and then some other project which uses this image_common on Windows with gcc, I have this kind of error:

image_transport/image_transport/camera_publisher.hpp:68:3: error: function 'image_transport::CameraPublisher::CameraPublisher()' definition is marked dllimport
68 | CameraPublisher() = default;
| ^~~~~~~~~~~~~~~

This might be a gcc only issue, when a function is dllimport but it has a definition (function body) at the same time.

When I had a similar issue with gcc before, I chose to a safe way by moving the function body from .h to .cpp. But this time it's different since CameraPublisher() = default; can only be in the .h file. So in this PR I moved the IMAGE_TRANSPORT_PUBLIC from member function level to class level.

There are some places where I can move the function body from .h to .cpp, but to be consistent, class level of IMAGE_TRANSPORT_PUBLIC is used for all places.

@ahcorde
Copy link
Collaborator

ahcorde commented Jul 8, 2024

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants