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.
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: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 theIMAGE_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.