how to create liblinks.xml

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

how to create liblinks.xml

1,926 Views
steffen_norbert
Contributor II

I am working at project on LPC55s69. It is basically a c++ project, but with a lot of c includes.

I need to incorporate the nfc reader library. I managed to port some examples to LPC55s69 with the help of document DOC-343538, which was of great help, tx!

When it comes to integrating the library into my project, I found that there is no liblinks.xml file and adding all includes by hand would be a pain .... There are a LOT of include path!

Therefore: how can I create the xml file, or is there any other way which is easier and less work than adding each path individually (Even editing the some config file(s) would be better than adding each path "by hand".

If I have do do it manually, is it necessary to add it for both compilers c and c++ ?

Thank you & best regards,

Steffen

0 Kudos
Reply
5 Replies

1,818 Views
Sabina_Bruce
NXP Employee
NXP Employee

Hello Steffen,

Hope you are doing well.

Some documentation that may of help is below. Although I believe the essential has been described by Con Verse, the way to go about this will be manually.

https://community.nxp.com/thread/450904 

Creating and Linking to Library Projects 

Best Regards,

Sabina

-----------------------------------------------------------------------------------------------------------------------

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

----------------------------------------------------------------------------------------------------------------------- 

0 Kudos
Reply

1,818 Views
converse
Senior Contributor V

The format looks quite obvious, so you should be able to create your own. If you only have a C project, you will only need to add it for C, not C++.

0 Kudos
Reply

1,818 Views
steffen_norbert
Contributor II

I am afraid to say that your (Con Verse) answer does not help (me). That fact that the format of the file looks obvious is of no importance. Important (for me) is, how can the file be created other than filling in all the references by hand.

Re C vs C++ : That answer does not help either: As we know C files can be compiled using a C++ compiler. Now what does MCUXpresso with a mixed project (i.e. at least main in a C++ file and some C files): Are C-files compiled by the C compiler or C++. Further if all is compiled by the C++ compiler, will it be sufficient to list the path for ALL include files in the C++ section or do I need to also fill the C section?

0 Kudos
Reply

1,818 Views
converse
Senior Contributor V

Yes, you create the liblinks.xml file by hand (once for each library). You can the copy it into any project where you want to use it.

C is compiled by the C Compiler, C++ is compiled the C++ compiler in all circumstances. If you have a mixed project, this is still true (note that C files have a .c extension and C++ file have a .cpp extension).

Looking at a (random) lib links file supplied in the example:

<project name="" update="true">
<setting id="all.compiler.inc">
<value>${workspace_loc:/CMSIS_DSPLIB_CM0/inc}</value>
</setting>
<setting id="linker.libs">
<value>CMSIS_DSPLIB_CM0</value>
</setting>
<setting id="linker.paths">
<value>${workspace_loc:/CMSIS_DSPLIB_CM0/lib}</value>
</setting>
<requires msg="Library project `CMSIS_DSPLIB_CM0` not found">
<value>CMSIS_DSPLIB_CM0</value>
</requires>
</project>

You can see that it says 'all.compiler.inc' which will work for the include paths for all compilers (C and C++). The <value> field is exactly what is added to the include path. The link.libs setting is for the library name you need adding to the linker and the linker.paths setting is for the library paths.

If you are worried, why not just try it? Create yourself a dummy project and try it? It really is not difficult

1,818 Views
steffen_norbert
Contributor II

Thanks for the elaboration.

In addition: Having not only the library but in addition an example, helps: The file .cproject from the example (among a lot of other things) shows the include paths. So i was able to copy those into the liblinks.xml file (with a little text processing). It turned out that the NxpNfcRdLib (free version) uses 45 :smileyalert: include paths.  Once I get the NDA version I will have to go through again, because I am sure there will be more! My feeling is that if a library is written like this, the liblinks file should be provided.

0 Kudos
Reply