How to link .a files in MDK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to link .a files in MDK

Jump to solution
2,921 Views
jajaer
Contributor II

Hi :

I try to transfer the bldc project in codewarrior to Keil,and I just found the ".a" files in the machine library after the installation; So in MDK,I change the complied environment with GCC,then I start to link these .a files,but there is always a problem with connectivity.

pastedImage_1.png

In keil Options for target,In Linker I did the following settings,libbldc is libbldc.a, add the link and compile the error shown above picture. What should I do to slove the problem of the .a link?

pastedImage_3.png

Thank u;

1 Solution
2,599 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Eric,

   I think it is relate to the MDK gcc lib usage.

  I find a post which is not in english, that says, in MDK, gcc, add libraies, it need to delete the header lib and .a of the library file, then include it.

   Now, it seems not OK on your side.

   Now, send me your lib files and it's header file, or you can tell me the download link, I will try it on my side.

   In the meanwhile, please also create this question in the MDK forum, how to add MDK GCC .a file.

 www.keil.com/forum


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

View solution in original post

0 Kudos
Reply
6 Replies
2,599 Views
vigneshbalaji
Senior Contributor I

Hi Eric,

            Are you using Keil MDK?

0 Kudos
Reply
2,599 Views
jajaer
Contributor II

Hi Vignesh,

       I'm  Sure,in Manage Project Items->Folders/Extensions->use GCC compiler for ARM project;if choose 'Use ARM Compiler', then in Linker I think there should be to link '.lib' files..

0 Kudos
Reply
2,599 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Eric,

    Please try to modify include libraries from libblcd to blcd, then try again.

    Besides, you should make sure, libblcd.a in the folder:

pastedImage_1.png

   Then try again.

   If you still can't find lib, please let me know!


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,599 Views
jajaer
Contributor II

Hello Kerry,

According to your method,I change the name of the .a file,but I think this just a name for the .a file,as long as the corresponding path file exists;also ,I checked the relevant folder where  the bldc.a file resides;

pastedImage_1.png

pastedImage_2.png

but the result of build is the same as before...

pastedImage_3.png

And ,Does this have something  to do with my gcc compiler?

0 Kudos
Reply
2,600 Views
kerryzhou
NXP TechSupport
NXP TechSupport

Hello Eric,

   I think it is relate to the MDK gcc lib usage.

  I find a post which is not in english, that says, in MDK, gcc, add libraies, it need to delete the header lib and .a of the library file, then include it.

   Now, it seems not OK on your side.

   Now, send me your lib files and it's header file, or you can tell me the download link, I will try it on my side.

   In the meanwhile, please also create this question in the MDK forum, how to add MDK GCC .a file.

 www.keil.com/forum


Have a great day,
Kerry

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply
2,599 Views
jajaer
Contributor II

Hello Kerry,

Thank you very much;

I uploaded a project that I now use;the ‘KEAx_AMMCLIB_v1.0.0’ folder  I took it straight from the BLDC motor library,and others I took it from the BLDC codewarrior project.

链接: http://pan.baidu.com/s/1nvbon7j 密码: vbt3

Best Regards

Eric

0 Kudos
Reply