필터 지우기
필터 지우기

Naming conflict in gernerated code

조회 수: 3 (최근 30일)
Christian Wissing
Christian Wissing 2017년 11월 27일
Hi there,
I’m using the Matlab coder to generate C-Code, which is used in two visual studio projects (project_a and project_b). For each project I have a matlab function (fun_a(), fun_b()), which is translated to C-Code by the matlab coder in a separated coder project.
I get a bunch of c-functions in each project, including for example
  • fun_a_emxutil.h, fun_a_emxutil.c
  • sum.h, sum.c
and
  • fun_b_emxutil.h, fun_b_emxutil.c
  • sum.h, sum.c
I build static libraries of project_a and project_b in visual studio, including the auto generated code and some interfacing.
If build and run the projects independently of each other they are working fine, but if I want to use both libraries in a new application project_c, which links the two static libs, I'm getting linker error LNK2005 : "double sum" (?a@@3HA) already defined in project_a.obj
I understand why this is happening, since the symbol sum is defined in fun_a_emxutil.h as well as in fun_b_emxutil.h with the same name. So my question is, is there any workaround or any possibility to, for example, automatically add a prefix to the generated functions during code generation?
Thanks in advance
Christian

답변 (0개)

카테고리

Help CenterFile Exchange에서 MATLAB Coder에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by