I am trying to generate C-code in Matlab (R2016b, Windows 10, MinGW-Compiler) using the generate_c_code method of the ocp-object in the minimal_example_ocp example. All the files are generated and compiled when creating the ocp-object. Also the generate_c_code method runs without erros but as mentioned in the docs the compilation cannot be done directly in Windows. Therefore I use cygwin and run the make command from inside the c_generated_code folder. However, it seems that the compiler as problems finding the linked libraries libacados.lib,libhpipm.lib and libblasfeo. It returns the following error code:
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/…/…/…/…/x86_64-pc-cygwin/bin/ld: -lacados cannot be found
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/…/…/…/…/x86_64-pc-cygwin/bin/ld: -lhpipm cannot be found
/usr/lib/gcc/x86_64-pc-cygwin/7.3.0/…/…/…/…/x86_64-pc-cygwin/bin/ld: -lblasfeo cannot be found
When checking env I can see that the LD_LIBRARY_PATH is set correctly to …/acados/examples/acados_matlab_octave/getting_started/…/…/…/lib. The content if the folder are the three .lib-files mentioned above.
I appriciate any hints helping get past this issue!
It is a while ago that I tried this.
In general, LD_LIBRARY_PATH is irrelevant on Windows.
Instead you should add the path to the PATH variable in the GUI.
What I was trying to do with cygwin, was using a Linux-like environment within Windows. I somehow managed to solve the issue now. Within the cygwin environment I could check for which kind of library-files the linker is looking. It was interesting to see that the output was the following:
As you can see it never checks for libacados.lib. I solved the issue by copying the .lib files and renaming them without the prefix lib. Then it was possible to compile the generated c-code using the following matlab code.