Search code examples
c++idlopendds

Fatal error C1083 when using opendds_idl tool on IDL file


I am experiencing an issue with the opendds_idl tool on Windows 10.

I have generated the OpenDDS libraries and tools with Visual Studio 2015 from OpenDDS source code with static linking mode enabled and x64 platform.

With the command line

opendds_idl file.idl

I got an error

c1: fatal error C1083: Cannot open source file : '' : No such file or directory
tao-idli_2HJC0I.cpp 
opendds_idl: preprocessor "CL.EXE" returned with an error

The IDL file content :

module BasicIOTest 
{
#pragma DCPS_DATA_TYPE "BasicIOTest::TestData"
#pragma DCPS_DATA_KEY "BasicIOTest::TestData id"

  struct TestData 
  {
    long id;
    string text;
  };
};

Solution

  • In fact, I was using the VS2015 x64 native tools command prompt, and it seems that something went wrong when opendds_idl was formatting the CL.exe command line.

    Here are the details (with the -v option as recommended by Johnny Willemsen)

    > opendds_idl -v TestData.idl
    opendds_idl: preprocessing TestData.idl
    opendds_idl: spawning: CL.EXE -D__TAO_IDL=0x060200 -I. -I. -nologo -E -I. -D__OPENDDS_IDL=0x030900 -D__OPENDDS_IDL_HAS_FIXED "-I"D:\path\to\thirdparty\OpenDDS "" C:\path\to\AppData\Local\Temp\tao-idli_ynmjvL.cpp
    
    c1: fatal error C1083: Cannot open source file : '' : No such file or directory
    tao-idli_ynmjvL.cpp
    opendds_idl: preprocessor "CL.EXE" returned with an error
    

    By using, another VS2015 command prompt (Developer command prompt for VS2015) I succeeded to compile it without issues.

    Details:

    >opendds_idl -v TestData.idl
    opendds_idl: preprocessing TestData.idl
    opendds_idl: spawning: CL.EXE -D__TAO_IDL=0x060200 -I. -I. -nologo -E -I. -D__OPENDDS_IDL=0x030900 -D__OPENDDS_IDL_HAS_FIXED -ID:\path\to\thirdparty\OpenDDS C:\paths\to\AppData\Local\Temp\tao-idli_lDpVP9.cpp
    tao-idli_lDpVP9.cpp
    opendds_idl: parsing TestData.idl
    processing TestData.idl
    opendds_idl: BE processing on TestData.idl
    MODULE: CORBA
    MODULE: BasicIOTest
    STRUCT: TestData
    

    Would it be a bug ?