Hi, All
I am using MCUXpresso IDE, and need to include a precompiled library file (*.a) into my project, wonder where I should put it and how to link it ? I have header files, but not compiling at the moment.
Regards!
Ping
Solved! Go to Solution.
From the log, it use the VFP register, seems not used for RT.
Best Regards,
Kerry
Hi @ping1 ,
So strange, I just open your project, with no modification, build works Ok, totally no error, and map also see your lib.
My SDK is SDK2.10.0, IDE is MCUXpresso IDE v11.3.1 [Build 5262] [2021-04-02].
I think you also can close the IDE, delete all your workspace, then import your project and build again.
Best Regards,
Kerry
Dear Kerry,
Yes, you are right, it will compile as it is as I want to show you my project compiles without calling library.
Did you try to modify the zmod.c file at line 110, ret =init_iaq_2nd_gen(&algo_handle); and it still compiles? that is my problem - the function calls the library, it doesn't compile for me.
I just updated my IDE to v11.4.0, and SDK v2.10.0.
Regards!
Ping
Hi @ping1 ,
Seems your lib have issues, do you generate it with mcuxpresso?
Seem your lib code has the mcuxpresso calling issues, do you test your related code without the lib, I mean, add your lib source code to this project, whether it has issues or not?
Best Regards,
Kerry
Dear Kerry
That is quick response, thanks!
The library is provided by third party, unfortunately, no source code available.
What does the error message mean? so I can tell the library provider.
Regards!
Ping
From the log, it use the VFP register, seems not used for RT.
Best Regards,
Kerry
Hi, Kerry
Thanks for your patient support, the RT has hardware float pointer function and had to use another library built for the platform - it compiles now.
Regards!
Ping
hi,
Please try lib_iaq_2nd_gen in your mcuxpresso link option, instead of lib_iaq_2nd_gen.a
Regards,
Crist
Thanks, Crist
I tried and added like _iaq_2nd_gen, the full name of the library is lib_iaq_2nd_gen.a, no luck so far.
Regards!
Ping
Thanks for this, read and tried to put it into Project->Properties->Tool Settings Tab->C++ Linker->Miscellaneous, seems compiled, but when calling the function in it, it says "undefined reference to function ".
Regards!
Ping
Hi @ping1
Do you add the related header file in your code?
You can refer to my above examples at first, that code add the .a works OK.
Best Regards,
Kerry
Thanks for reply, Kerry
I tried and it doesn't work for me, I created a folder called Lib under same directory as workspace, but it doesn't show on my workspace like yours, because it is just a folder, not a workspace project, the library is a precompiled .a file.
I set it like below, and got an error message when compiling - like "cannot find -llib_iaq_2nd_gen.a"
Can I put it into a fixed location under project folder? do i have to import the file into my workspace?
Regards!
Ping
Hi @ping1 ,
Give you an example, please open this path:
C:\nxp\MCUXpressoIDE_11.4.0_6157_prc1\ide\Examples\Flashdrivers\NXP\iMXRT
copy the iMXRT1020_QSPI.zip out, then unzip it, then import two project to your mcuxpresso.
You can find two project, one is LPCXFlashDriverlib, another is iMXRT1020_QSPI, LPCXFlashDriverlib will generate the lib .a file, then the iMXRT1020_QSPI will call the lib, you can refer to that project.
Best Regards,
Kerry
Dear kerry
Thanks for reply, the example seem working, but my application is different, I have precompiled library file, I created a C/C++ static library project and copy my library file under the lib folder there as you can see.
setting in my application project:
I tried to compile and here is the error message:
Could you let me know the meaning of the message?
Regards!
Ping
Hi @ping1
One important things I don't whether you not it or not:
MCUXpresso IDE requires to have static library name in format "liblibrary_name.a".
So, please make sure your generated lib name with : libxxxLib.a, then in the MCUXPresso settings, just xxxLib
Please try it again.
Best Regards,
Kerry
Hi, Kerry
Thanks for your patient.
The 3rd party static library is coming named as lib_iaq_2nd_gen.a. I don't need to compile it although I tried to created a project for it, but then I just copied the folder it under a folder called <Lib> as showing in my screen shot.
In project setting, I put it like below:
The error message like below - there are 3 of them:
"error: WellSensor.axf uses VFP register arguments, D:/WORK/Products/POE_WellBeing/Firmware/MIMXRT1024_APP/lib/lib_iaq_2nd_gen.a(iaq_2nd_gen.c.o) does not
failed to merge target specific data of file D:/WORK/Products/POE_WellBeing/Firmware/MIMXRT1024_APP/lib/lib_iaq_2nd_gen.a(iaq_2nd_gen.c.o)"
It seems read the library as lib_iaq_2nd_gen.a correctly and found it, just doesn't compile, does it mean the library is not compatible with the processor?
Regards!
Ping
Hi @ping1 ,
To test the code, please share your issue project, please make sure your project has no build issues before you add the .a, after you attach the project, I will help you to check it.
best regards,
KERRY