Linking Static Library to Project in Precision32 IDE
01/10/2015 | 11:04 PM
I am trying to add a static .lib file to my project in the Precision32 IDE. When I compile, I get two errors…
Cannot find –lmylibrary.lib
Make:*** [Project1.axf] Error 1
The way I include the file is Project Properties->C/C++ Build->Settings->MCU Linker->Libraries. I put the name of the library on top and the path leading to the library on the bottom. I have also tried placing the full path to the library, however the results are the same. In addition, I have tried placing the library in the project folder, but to no avail.
I have also gone to Project Properties->C/C++ General->Paths and Symbols->Libraries or Library Paths. Both of which return the same error as above.
I know this is probably simple, but I'm just not able to figure it out. Thanks in advance for the help!
Is your library really called "mylibrary.lib" or is it maybe "libmylibrary.lib" ?
It is called "mylibrary.lib".
Then the ld linker can probably not find it. When you pass it a library with -l<libname> it searches for a file lib<libname>. Don't ask me why, it's just how it behaves.
I tried changing the name to libmylibrary.lib and telling the linker to look for a library named "libmylibrary", "libmylibrary.lib", "mylibrary", and "mylibrary.lib", but it still can't find the library. Any other ideas?
I tested the library in Visual Studio and had no problem linking to it, could it be that the Precision32 IDE does not support '.lib' files?