eProsima / Fast-DDS-Gen

Fast-DDS IDL code generator tool. Looking for commercial support? Contact info@eprosima.com
Apache License 2.0
82 stars 60 forks source link

fastddsgen(version 2.1.2)in Windows, The file was not generated as expected [14839] #124

Closed zixuan-su closed 2 years ago

zixuan-su commented 2 years ago

For example, I have two "idl" files such as fun.idl and main.idl In main.idl, it references fun.idl

fun.idl structure is struct fun{ float CAN_RX_TRACK_ANGLE; octet CAN_RX_TRACK_BRIDGE_OBJECT; };

The main structure is

include"fun.idl"

struct main{ fun arr[64]; unsigned long index;
};

When i used Visual Studio PowerShell to run fastddsgen(2.1.2), the command is fastddsgen main.idl the result is that it only generates main.h and main.cxx I hope to generate mainPubSubType.h and mainPubSubType.cxx , fun.h, fun.cxx, funPubSubType.h and funPubSubType.h, but failed. I donot know how to Solve this problem

By the way , it can work in Ubuntu to generate the whole files .

zixuan-su commented 2 years ago

In fastddsgen , the options -CMake and x64Win64VS2015 were not generated as expected , only generate two file as mentioned above

richiware commented 2 years ago

We are aware about an error calling fastddsgen from Powershell. Usually when you are typing the IDL filename and press TAB to autocomplete it, Powershell changes the name main.idl to .\main.idl. In this case fastddsgen doesn't work as expected. If this is your case, please, remove .\ from the file name.

zixuan-su commented 2 years ago

We are aware about an error calling fastddsgen from Powershell. Usually when you are typing the IDL filename and press TAB to autocomplete it, Powershell changes the name main.idl to .\main.idl. In this case fastddsgen doesn't work as expected. If this is your case, please, remove .\ from the file name.

Thanks, it works prefect , then I find a new problem, in fastddsgen , does the "SET" is a keyword? In my idl file , I define a variable such as "octet SET" , when I run fastddsgen , it has an exception, "error: Illegal identifier: SET is a keyword, use escape character if you want to use it as identifier (_SET)" but others who run this "idl" file donot encounter this error in Ubuntu....

richiware commented 2 years ago

set is a reserved word in fastddsgen. Just in case I've tested it on Windows and Ubuntu, and for me it failed in both cases. As the comment suggests, you can use octet _set in your IDL file to skip the limitation. Use octet _set is similar to write octet set.

zixuan-su commented 2 years ago

set is a reserved word in fastddsgen. Just in case I've tested it on Windows and Ubuntu, and for me it failed in both cases. As the comment suggests, you can use octet _set in your IDL file to skip the limitation. Use octet _set is similar to write octet set.

I also test it in Ubuntu and find the same problem. I will discuss it with my colleagues ... Thank you again for your reply!

richiware commented 2 years ago

I proceed to close the issue. You will be able to reopen it if you encounter more problems.