-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
undefined reference to `main' from MATLAB R2017a #2
Comments
As mentioned in #1, I'll be able to fix this during August. |
I met the same "undefined reference to 'main'" problem. Add ert_main.o to dependent libraries to generate the final executable program ($(PRODUCT)) will fix this problem:
This works for me, but don't promise to work in all cases. |
Hello Qing, I think I have made include of commontargetlib.tlc conditional to be used only with Matlab versions older than 2017a . I have solved problem of need to explicitly include ert_main.o in link for 2017a and later Matlab/Simulink some conditional and hopefully acceptable way https://github.com/ppisa/ert_linux There is still problem than undefined reference to |
No S-function in my model, so things are a little different. You mentioned
|
Please, can you test my fork. Are you using 2017a/b or newer. I have problems with undefined rtmGetStopRequested and rtmSetStopRequested in the case that there is NOT any S-function . If the S-function is used, then result seems OK. Tests run on 2019b. |
Hi, @ppisa So my suggestion is to remove the codes which contain the `#define rtmSetStopRequested(x,y) 0 #define rtmGetStopRequested(x) 0` |
It is easy to overcome, but then some functionality would not work correctly, ability to terminate model etc. All that worked fine with previous Matalb/Simulink versions, so we do not want to lose these capabilities at Department of Control Engineering FEE CTU (https://dce.fel.cvut.cz/en) where this target has been designed and is used. By the way we have nice Xilix Zynq setup which allows to run the DC, PMSM and other stuff with this target on Xilinx Zynq based systems as well as on Raspberry Pi
We would be happy if you can use some of our projects. If you have some fixes, enhancements or alternative uses for the project we would be pleased if you can send us link to your repository, patches, sources or even references. |
Great job! I am working on Linux & high-performance real-time simulation in the last year, and your lintarget and ert_linux projects help me a lot for starting. For different MATLAB versions, I frequently met compatibility problems to generate source codes from models when applying some non-official System Target Files(STF), and it may be burdensome to create all-round system target files applicable to all versions. Now I am using toolchain to automatically generate the Makefile, which avoid some dependency problems. But my STF is just a start-up, and I would be happy to open-source it if it have better compatibility and support more features(concurrent execution and etc.) |
Martin Gurtner from our department AA4CC (Advanced Algorithms for Control and Communications http://aa4cc.dce.fel.cvut.cz/ ) has integrated changes and prepared unified example which can be build for native Linux, ARM and ARM64/AArch64 by one double-click on a corresponding button and run on target by another double-click. See the repo https://github.com/aa4cc/ert_linux . All works well on 2017a Matlab/Simulink version. The port to further versions would require more work. Contributions welcomed. Consultations with Humusoft company are planned. |
Compiling
test.slx
this error comes up:/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function '_start': (.text+0x20): undefined reference to 'main' collect2: error: ld returned 1 exit status gmake: *** [../test_simple] Error 1
It seems that ert_main.c is not correctly linked with the new compiler (MATLAB R2017b).
According to Sriram
https://rtime.felk.cvut.cz/~sojka/blog/on-generating-linux-applications-from-simulink/#comment-1732b017230b5b064a73840bd14ee4fa
The text was updated successfully, but these errors were encountered: