You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have already compile foonathan_memory, fastcdr and tinyxml2 with MinGW successfully. But there are some problem when I compile the fastdds with MinGW, like "i64 to LL","stat redefined","declspec( dllexport ) to attribute((visibility("default")))"...... I used some special means to solve these problems and finally successfully compiled fastdds, then i got libfastdds.dll and libfastdds.dll.a
Current behavior
But when I use libfastdds.dll and libfastdds.dll.a in my project, there are some thing wrong like E:/mingw32-14/bin/../lib/gcc/i686-w64-mingw32/14.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles\MBus.dir/objects.a(startlogPubSubTypes.cxx.obj):startlogPubSubTypes.cxx:(.text+0x5cd): undefined reference to eprosima::fastdds::MD5::MD5()'`......
All the symbol from FastDDS which i used in my project was undefined. I tried every import and export combination in fastdds_dll.hpp, "attribute((visibility("default")))" "declspec( dllexport )" "declspec( dllimport )" "null" . But does not work.
Are there some special export config for MinGW in FastDDS?
Steps to reproduce
1:Compile foonathan_memory, fastcdr and tinyxml2 with MinGW.
2:Modify the source code, like modify CMAKE_CXX_FLAGS, modify include in some files, and so on.
3:Use libfastdds.dll.a in your project.
@Javgilavi
Yes, my pleasure. “solution means” can be divided into three parts.
First, warning with little impact. like "unused-parameter" "missing-field-initializers" and so on. I just use command like "-Wno-unused-parameter" to ignore them.
Then, some llibrary error between windows and unix. Added option for "elif defined(MINGW)" to ifdef _WIN32(or _MSC_VER) and else , then fill the MINGW branch, so it can work as same as the _WIN32(or _MSC_VER) branch. For example, in "RobustExclusiveLock.hpp", add "elif defined(MINGW)" to ifdef _MSC_VER and else in the "include" block and "class" block. Then copy the code from "_MSC_VER" block, use the same function "_sopen_s" with <io.h>(MinGW), modify "_SH_DENYRW" to "0x0010", which is not defined in <io.h>(MinGW).
Third, Manually link library, like "target_link_libraries(fastdds PUBLIC ws2_32 mswsock)".
As for the error in this issue, I solved this problem with "declspec( dllexport )" and "-Wno-attributes". So i can use almost all the symbols from libfastdds.dll and libfastdds.dll.a.
Why "almost all"? There are some new problem for "TypeSupport".
When I use TypeSupport(new startlogPubSubType()) to construct a TypeSupport object, i got the error E:/mingw32-14/bin/../lib/gcc/i686-w64-mingw32/14.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:\Users\CUILIU~1\AppData\Local\Temp\ccEr7V0I.o:xmsgbus.cxx:(.text$_ZN8eprosima7fastdds3dds11TypeSupportC1EPNS1_13TopicDataTypeE[__ZN8eprosima7fastdds3dds11TypeSupportC1EPNS1_13TopicDataTypeE]+0x20): undefined reference tovtable for eprosima::fastdds::dds::TypeSupport' `
Maybe there are some thing wrong with "class TypeSupport : public std::shared_ptr<TopicDataType>" and MinGW?
By the way, "startlogPubSubType" was generated by fastdds-gen with a idl.
Is there an already existing issue for this?
Expected behavior
I have already compile foonathan_memory, fastcdr and tinyxml2 with MinGW successfully. But there are some problem when I compile the fastdds with MinGW, like "i64 to LL","stat redefined","declspec( dllexport ) to attribute((visibility("default")))"...... I used some special means to solve these problems and finally successfully compiled fastdds, then i got libfastdds.dll and libfastdds.dll.a
Current behavior
But when I use libfastdds.dll and libfastdds.dll.a in my project, there are some thing wrong like
E:/mingw32-14/bin/../lib/gcc/i686-w64-mingw32/14.2.0/../../../../i686-w64-mingw32/bin/ld.exe: CMakeFiles\MBus.dir/objects.a(startlogPubSubTypes.cxx.obj):startlogPubSubTypes.cxx:(.text+0x5cd): undefined reference to
eprosima::fastdds::MD5::MD5()'`......All the symbol from FastDDS which i used in my project was undefined. I tried every import and export combination in fastdds_dll.hpp, "attribute((visibility("default")))" "declspec( dllexport )" "declspec( dllimport )" "null" . But does not work.
Are there some special export config for MinGW in FastDDS?
Steps to reproduce
1:Compile foonathan_memory, fastcdr and tinyxml2 with MinGW.
2:Modify the source code, like modify CMAKE_CXX_FLAGS, modify include in some files, and so on.
3:Use libfastdds.dll.a in your project.
Fast DDS version/commit
FastDDS v3.1.1 master
FastCDR v2.2.5
MinGW v14.2.0
Windows10
Platform/Architecture
Other. Please specify in Additional context section.
Transport layer
Default configuration, UDPv4 & SHM
Additional context
No response
XML configuration file
No response
Relevant log output
No response
Network traffic capture
No response
The text was updated successfully, but these errors were encountered: