0

I am trying to compile various C-Functions in MATLAB Simulink using the S-function builder block and the minGW 64bit Compiler. A syntax error in the code is impossible since it is code from an ECU which is in production and running for years.

I keep getting the following error message with two of my files:

...example.obj:example.c:(.text+0x0): multiple definition of `example'

...example.obj:example.c:(.text+0x0): first defined here

The error confuses me since it is referring to the same position as the "first definition". In the other functions it is position (.text+0x17a).

Has any of you guys faced the same problem or any idea how to fix it? Can it be a bug of the compiler?

Greetings from Germany, Jonathan

Community
  • 1
  • 1
J.M.
  • 25
  • 9
  • Very likely you have 2 things named "example". – Aaron Jan 04 '17 at 13:12
  • Thanks for the fast response. Unfortunately not, I searched all files and the name is not in use anywhere else - except for the declaration of the external function above my main function and the function call itself. – J.M. Jan 04 '17 at 13:18
  • Are those in the same file example.obj, or are there two files example.obj in different directories? – Klas Lindbäck Jan 04 '17 at 13:38
  • They are named differently ('example' was just a common spaceholder). I have a file example.c which I am compiling, thus it creates: example.obj. During this compilation I get the above mentioned error example.obj:example.c:(.text+0x0): multiple definition of 'example'. – J.M. Jan 04 '17 at 14:13
  • Have you included the `example.c` in another `c` file of your project? – hmofrad Jan 05 '17 at 03:43
  • No, it is just declared as external function above the main function and called one time within the main function – J.M. Jan 05 '17 at 07:45
  • I avoided the Problem by including the relevant parts of the mentioned c functions into my main program. I still could not figure out why the error occured. Nonetheless I want to thank you guys for your consideration. – J.M. Jan 11 '17 at 12:13

0 Answers0