Azzera filtri
Azzera filtri

Naming conflict in gernerated code

3 visualizzazioni (ultimi 30 giorni)
Christian Wissing
Christian Wissing il 27 Nov 2017
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

Risposte (0)

Categorie

Scopri di più su MATLAB Coder in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by