0

I am able to build examples in Cyclone DDS with Debug/x64 (output type is DLL ), I need to build them in Release/X64, in both builds shows the same 3 errors when I open the examples code but build always all succeed, (VS2017)

but in debug, output DLLs works fines, in release DLLs do not work

enter image description here

Severity    Code    Description Project File    Line    Suppression State
Error (active)  E1097   unknown attribute "no_init_all"  
ddscxxHelloworldSubscriberDLL   C:\Program Files (x86)\Windows 
Kits\10\Include\10.0.19041.0\um\winnt.h 3901    

Severity    Code    Description Project File    Line    Suppression State
Error (active)  E0090   function returning function is not allowed   
ddscxxHelloworldSubscriberDLL

C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\include\ddscxx\dds\sub\detail\TDataReaderImpl.hpp 186

Severity    Code    Description Project File    Line    Suppression State
Error (active)  E0090   function returning function is not allowed   
ddscxxHelloworldSubscriberDLL    

C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\include\ddscxx\dds\sub\detail\TDataReaderImpl.hpp 318

Github page says

Note that the default build type is a release build with debug information included (RelWithDebInfo), 
which is generally the most convenient type of build to use from applications because of a good mix 
between performance and still being able to debug things. If you'd rather have a Debug or pure 
Release build, set CMAKE_BUILD_TYP

And I have followed the default installation which is RelWithDebInfo

Should I build CyclonesDDS installation with -DCMAKE_BUILD_TYP=RELEASE in order to build my example code in Release/x64 mode? or should I modify the example codes?

Output window on release x64 build

    ld All started: Project: ZERO_CHECK, Configuration: Release x64 ------
    2>------ Rebuild All started: Project: startClient, Configuration: Release x64 ------
    3>------ Rebuild All started: Project: startServer, Configuration: Release x64 ------
    1>Checking Build System
    4>------ Rebuild All started: Project: isocpp_idlpp, Configuration: Release x64 ------
    4>Building Custom Rule C:/Users/king/Downloads/DDS_2017_Build/cyclonedds_cxx_ins_dir_2017/DDS_3_15/helloworldDLLsource/CMakeLists.txt
    5>------ Rebuild All started: Project: ddscxxHelloWorldData_lib_idl_isocpp_generate, Configuration: Release x64 ------
    3>startServer.cpp
    2>startClient.cpp
    3>   Creating library C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\DDS_3_15\DDS_DLL_PROJECT_2017\x64\Release\startServer.lib and object C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\DDS_3_15\DDS_DLL_PROJECT_2017\x64\Release\startServer.exp
    3>Generating code
    3>All 14 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
    3>Finished generating code
    2>   Creating library C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\DDS_3_15\DDS_DLL_PROJECT_2017\x64\Release\startClient.lib and object C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\DDS_3_15\DDS_DLL_PROJECT_2017\x64\Release\startClient.exp
    2>Generating code
    2>All 14 functions were compiled because no usable IPDB/IOBJ from previous compilation was found.
    2>Finished generating code
    3>startServer.vcxproj -> C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\DDS_3_15\DDS_DLL_PROJECT_2017\x64\Release\startServer.exe
    5>Running isocpp_idlpp on HelloWorldData.idl
    2>startClient.vcxproj -> C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\DDS_3_15\DDS_DLL_PROJECT_2017\x64\Release\startClient.exe
    5>Compiling C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\DDS_3_15\helloworldDLLsource\HelloWorldData.idl
    5>Building Custom Rule C:/Users/king/Downloads/DDS_2017_Build/cyclonedds_cxx_ins_dir_2017/DDS_3_15/helloworldDLLsource/CMakeLists.txt
    5>ANTLR Tool version 4.4 used for code generation does not match the current runtime version 4.5ANTLR Tool version 4.4 used for code generation does not match the current runtime version 4.5
    6>------ Rebuild All started: Project: ddscxxHelloworldPublisherDLL, Configuration: Release x64 ------
    7>------ Rebuild All started: Project: ddscxxHelloworldSubscriberDLL, Configuration: Release x64 ------
    7>Building Custom Rule C:/Users/king/Downloads/DDS_2017_Build/cyclonedds_cxx_ins_dir_2017/DDS_3_15/helloworldDLLsource/CMakeLists.txt
    6>Building Custom Rule C:/Users/king/Downloads/DDS_2017_Build/cyclonedds_cxx_ins_dir_2017/DDS_3_15/helloworldDLLsource/CMakeLists.txt
    7>subscriber.cpp
    6>publisher.cpp
    6>HelloWorldData.cpp
    7>HelloWorldData.cpp
    6>HelloWorldDataSplDcps.cpp
    7>HelloWorldDataSplDcps.cpp
    7>Generating Code...
    6>Generating Code...
    7>HelloWorldData-cyclone.c
    6>HelloWorldData-cyclone.c
    7>   Creating library C:/Users/king/Downloads/DDS_2017_Build/cyclonedds_cxx_ins_dir_2017/DDS_3_15/DDS_DLL_PROJECT_2017/Release/ddscxxHelloworldSubscriberDLL.lib and object C:/Users/king/Downloads/DDS_2017_Build/cyclonedds_cxx_ins_dir_2017/DDS_3_15/DDS_DLL_PROJECT_2017/Release/ddscxxHelloworldSubscriberDLL.exp
    6>   Creating library C:/Users/king/Downloads/DDS_2017_Build/cyclonedds_cxx_ins_dir_2017/DDS_3_15/DDS_DLL_PROJECT_2017/Release/ddscxxHelloworldPublisherDLL.lib and object C:/Users/king/Downloads/DDS_2017_Build/cyclonedds_cxx_ins_dir_2017/DDS_3_15/DDS_DLL_PROJECT_2017/Release/ddscxxHelloworldPublisherDLL.exp
    7>ddscxxHelloworldSubscriberDLL.vcxproj -> C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\DDS_3_15\DDS_DLL_PROJECT_2017\Release\ddscxxHelloworldSubscriberDLL.dll
    6>ddscxxHelloworldPublisherDLL.vcxproj -> C:\Users\king\Downloads\DDS_2017_Build\cyclonedds_cxx_ins_dir_2017\DDS_3_15\DDS_DLL_PROJECT_2017\Release\ddscxxHelloworldPublisherDLL.dll
    8>------ Skipped Rebuild All: Project: ALL_BUILD, Configuration: Release x64 ------
    8>Project not selected to build for this solution configuration 
    ========== Rebuild All: 7 succeeded, 0 failed, 1 skipped ==========
kobi89
  • 152
  • 9
  • Why did you delete your last question and repost it? Now everyones useful comments are lost. Please show the compiler output (from the output window) as text not as a screenshot of the errors window – Alan Birtles Mar 15 '21 at 08:19
  • 1
    Deleting and reposting the same question because you didn't like people's feedback on the original post instead of editing the post based on that feedback makes people less likely to help you the second time around; and more likely to get the question closed and deleted. – Casey Mar 15 '21 at 08:30
  • @Casey that was not the case... originally question was wrong, that's why I deleted it, some unrelated error was in that previous question, – kobi89 Mar 15 '21 at 08:53
  • Looks like the code is building successfully? What's the problem? – Alan Birtles Mar 15 '21 at 08:54
  • @Alan Birtles problem is in release build output DLLs are not working.... but if I build in debug DLL is working..... I just noticed there is --> **ANTLR Tool version 4.4 used for code generation does not match the current runtime version 4.5ANTLR Tool version 4.4 used for code generation does not match the current runtime version 4.5** is this the issue? – kobi89 Mar 15 '21 at 08:59
  • @kobi89 If that's the case, you should have edited it to fix the typo, answered your own question stating as such, or closed it as "unreproducable or a typo". – Casey Mar 15 '21 at 08:59
  • define "not working" – Alan Birtles Mar 15 '21 at 09:03
  • @Alan Birtles I run DLLs using two exes. and I print output on every step as in the linked example code, (debug/x64 they print as it is) on the command prompt. but in a Release Build, I don't get any printed value on the command prompt... and the console exe closes after few seconds itself. it not defined in my code... – kobi89 Mar 15 '21 at 09:09
  • have you tried running in a debugger? sounds like your application is crashing – Alan Birtles Mar 15 '21 at 09:19
  • @Alan Birtles no didnt tied – kobi89 Mar 15 '21 at 09:38
  • Unfortunately, I can't understand what the problem is, because of contradictory statements (does / does not work). Regarding the error from a comment, is runtime version referring to *.NET* or https://stackoverflow.com/questions/35116437/errors-when-linking-to-protobuf-3-on-ms-visual-c/35118400#35118400 or https://stackoverflow.com/questions/8528437/when-using-fstream-in-a-library-i-get-linker-errors-in-the-executable/41558269#41558269? – CristiFati Mar 15 '21 at 10:02
  • @CristiFati cyclonedds installation type is RelWithDebInfo.... and VS debug build dlls runs without issue... since I am trying to build VS in the release, should I install cyclonedds in release mode? – kobi89 Mar 15 '21 at 10:16
  • Generally, *RelWithDebInfo* is compatible with *Release*. Didn't work with *Cyclone DDS* though. – CristiFati Mar 15 '21 at 10:28

0 Answers0