eProsima / Micro-XRCE-DDS-Gen

Micro XRCE-DDS IDL code generator tool. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
10 stars 13 forks source link

Failed to generate source file using Micro-XRCE-DDS-Gen #34

Closed vibnwis closed 3 years ago

vibnwis commented 3 years ago

Hi there,

I have installed microxrceddsgen. See the outcome when typing ./scripts/microxrceddsgen -help.

UC8i5BEH:~/micro-xrce-dds/micro-XRCE-DDS-gen$ ./scripts/microxrceddsgen -help openjdk version "11.0.10" 2021-01-19 OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04) OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.20.04, mixed mode, sharing) microxrceddsgen usage: microxrceddsgen [options] [ ...] where the options are: -help: shows this help -version: shows the current version of eProsima Micro XRCE-DDS Gen. -example: Generates an example. -replace: replaces existing generated files. -ppDisable: disables the preprocessor. -ppPath: specifies the preprocessor path. -d : sets an output directory for generated files. -t : sets a specific directory as a temporary directory. and the supported input files are:

According to the https://micro-xrce-dds.docs.eprosima.com/en/stable/getting_started.html, I created myHelloWorld.idl with the following contents in the script/ folder. struct myHelloWorld { unsigned long index; string message; };

and I typed ./scripts/microxrceddsgen scripts/myHelloWorld.idl openjdk version "11.0.10" 2021-01-19 OpenJDK Runtime Environment (build 11.0.10+9-Ubuntu-0ubuntu1.20.04) OpenJDK 64-Bit Server VM (build 11.0.10+9-Ubuntu-0ubuntu1.20.04, mixed mode, sharing) Loading templates... Processing the file scripts/myHelloWorld.idl... cpp: error: scripts/myHelloWorld.idl: No such file or directory cpp: warning: ‘-x c’ after last input file has no effect cpp: fatal error: no input files compilation terminated. ERROR: Preprocessor return an error 1

I have also tried with ./scripts/microxrceddsgen myHelloWorld.idl, which I had move the myHomeWorld.idl to the parent folder, but no avails.

Can someone help please?

vibnwis commented 3 years ago

Apologies! Somehow, I got it working after a more try.