Ошибка ссылки OpenDDS при компиляции вложенного IDL с использованием MPC

Попытка разбить большой файл определения IDL для сообщений DDS и переместить некоторые общие типы в другое определение 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

person PackMan2468    schedule 12.02.2021    source источник


Ответы (1)


Дальнейшее обсуждение в Список рассылки OpenDDS

person Johnny Willemsen    schedule 12.02.2021