Naming conflict in gernerated code

3 次查看(过去 30 天)
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