Replies: 4 comments 2 replies
-
|
Hello Luciano, I could imagine that the "extern C" might be missing. The linker needs to know if it should try to link C or C++ functions. In audio_module.h I put the extern C there: https://github.com/marcel-licence/ML_SynthTools/blob/main/src/ml_organ.h is without You could try to add to your code. In addition to that you could try to cast "SAMPLE_RATE" to float to ensure a type conflict does not cause the linking error. Hope this helps! |
Beta Was this translation helpful? Give feedback.
-
|
I checked the lib. It is the other way around. The Organ_Setup() function is a cpp function. It would be possible to call this from another cpp file. How it works calling from c ... I don't know at the moment. Hope this information helps. You could try to setup another cpp file which calls the Organ functions. Maybe there is a chance to call your new functions from main.c |
Beta Was this translation helpful? Give feedback.
-
|
Hi Marcel I try to convert my main.c to main.cpp and convert program to C++ and the linker work fine. Best Regards Luciano |
Beta Was this translation helpful? Give feedback.
-
|
Hi Marcel That's what I did and rearranged other .c file calls and now it compiles correctly. Best Regards Luciano |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone and thanks to Marcel for sharing this project.
I actually use a STM32F4-Discovery board. If I use the Arduino IDE environment all works fine.
Now I try to port the organ project into STM32CubeIde, and include the CortexM4 ML_SynthTools library on it.
When I compile the project the linker generate an undefined reference for the Organ_Setup() function.
My initialization file is the following:
I think that both Organ_Setup() and STM32F407_AudioInit() functions are implemented into the CortexM4 ML_SynthToools Library.
What I don't understand is why the STM32F407_AudioInit() is recognized while Organ_Setup() not.
Thank in advance
Kind Regards
Luciano
Beta Was this translation helpful? Give feedback.
All reactions