eclipse-cyclonedds / cyclonedds

Eclipse Cyclone DDS project
https://projects.eclipse.org/projects/iot.cyclonedds
Other
888 stars 363 forks source link

[Help] HelloWorldData.idl not executing in Visual Studio 2022 #2128

Closed avelin0 closed 1 week ago

avelin0 commented 2 weeks ago

Hello! I'm trying to run this Hello World example in C from CycloneDDS on GitHub. However, Visual Studio is not recognizing the HelloWorldData.idl file, even though I have imported it. The dds.h file imports correctly via vcpkg, so there are no issues there. Could someone guide me on how to properly import the IDL file and resolve this issue to run the code successfully? Thank you in advance! Also, Can i put .idl file inside c code instead of a separated .idl file?

image

aratar-orome commented 2 weeks ago

Did you try to build it from command line with

cmake -Bbuild cmake --build build

The only problem I can see is that HelloWorldData.h is missing which is obviously generated using the idl file.

avelin0 commented 1 week ago

I understand now that helloworld.h generates helloworlddata.idl, which I wasn’t aware of before.

Currently, I'm not using CMake—just Visual Studio with vcpkg. Is it possible to:

  1. Compile the code using only Visual Studio and vcpkg, without CMake, while incorporating this IDL?

  2. Integrate the IDL directly within the C++ code?

Thank you in advance!

aratar-orome commented 1 week ago

Sorry, I have no idea how to use vcpkg in combination with CMake. But you can generate the idl file by your own. Here you find an explanation:

https://cyclonedds.io/docs/cyclonedds/latest/getting_started/helloworld/helloworld_idl.html

avelin0 commented 1 week ago

I will try. Thankx @aratar-orome