【问题标题】:OpenDDS Link Error when compiling nested Idl using MPC使用 MPC 编译嵌套 Idl 时出现 OpenDDS 链接错误
【发布时间】:2021-05-15 19:15:02
【问题描述】:

试图分解 DDS 消息的大型 IDL 定义文件,并将一些常见类型移动到另一个 idl 定义中以使事情更易于管理。

错误 1>FooTypesTypeSupportImpl.obj:错误 LNK2005:Java_foo_FooTypeTypeSupportImpl__1jni_1init 已经 在 BarTypeTypeSupportImpl.obj 中定义

FooType.idl

 module foo {
  #pragma DCPS_DATA_TYPE "foo::FooType"  
  struct FooType {
    string publisherID;
    double timestampMs;
  };

};

BarTypes.idl

module bar {
  #pragma DCPS_DATA_TYPE "bar::TestMsg"  
  struct TestMsg {
    foo::FooType fooInfo;
    string key;
  };

};

BuildFooBar.mpc

project (FooBar): dcps_java {
  idlflags      += -Wb,stub_export_include=BarType_Export.h \
                   -Wb,stub_export_macro=BarType_Export
  dcps_ts_flags += -Wb,export_macro=BarType_Export
  idl2jniflags  += -Wb,stub_export_include=BarType_Export.h \
                   -Wb,stub_export_macro=BarType_Export
  dynamicflags  += BARTYPE_BUILD_DLL

  specific {
    jarname      = DDS_Test_Msg
  }

  TypeSupport_Files {
    BarType.idl
    FooTypes.idl
  }
}

BuildFooBar.bat

REM Changing Directory to Development FooBar
cd D:\dds\FooBar

REM Generating BarType_Export.h
"%ACE_ROOT%"\bin\generate_export_file.pl BarType > BarType_Export.h

REM Generating FooTypes_Export.h
"%ACE_ROOT%"\bin\generate_export_file.pl FooTypes > FooTypes_Export.h

REM Generating new VS Code Project
"%ACE_ROOT%"\bin\mwc.pl -type vs2019

REM Starting VS Code
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\Common7\IDE\devenv.exe" FooBar.sln

【问题讨论】:

    标签: visual-studio-code idl opendds


    【解决方案1】:

    OpenDDS mailing list进一步讨论

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-04-05
      • 2014-10-25
      • 1970-01-01
      • 2017-06-21
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多