Page 1 of 2

Library API file not found

Posted: Thu Jul 06, 2017 10:53 am
by Krzemo
Hi!

I have problem with including UART library API header file in my project. When I include it at the beginning of my header file (#include<uart.h>) the compiler shows, that it cannot find the file. I set the paths in the build configuration and added lib_uart module in the makefile. What could be the reason of my problem?

Re: Library API file not found

Posted: Thu Jul 06, 2017 1:36 pm
by CousinItt
I've had similar problems. It doesn't appear to interfere with the build process, but I'd like an explanation too.

Re: Library API file not found

Posted: Thu Jul 06, 2017 4:23 pm
by infiniteimprobability
Would you be able to give more info? I have used uart a few times recently and not seen this issue. Is it a warning/error, compiler version etc?

Re: Library API file not found

Posted: Fri Jul 07, 2017 9:32 am
by robertxmos
Hi Krzemo,

I am curious and thought of two things.
1. Case of the file name, assuming you are on linux, do they match? (added for completeness)
2. The use of <uart.h> instead of "uart.h"

The #2 requires me to go and look up the subtitles but I think '<>' involves the -isystem include paths whilst "" the -I include paths (first).
The following link elucidates a little more https://gcc.gnu.org/onlinedocs/cpp/Search-Path.html
As for the detail...
(I would be interested to know if changing to "" fixes the issues - I may be barking up the wrong tree)

Re: Library API file not found

Posted: Tue Jul 11, 2017 8:08 am
by Krzemo
Hi!

I dealed with the uart.h inclusion - the project cleaning solved the problem - but I have another one. I created a new module named "module_xyz" with header file "xyz.h" inside of it. I would like to use my header file in the main application so I includer xyz.h in it and made changes in the makefile. But the problem with the inclusion continues - it says exactly the same that it cannot find xyz.h, but now cleaning the project does not help at all. What may be the other reason of the problem?

Re: Library API file not found

Posted: Tue Jul 11, 2017 12:23 pm
by robertxmos
Could you add the flag '-v' to the makefile (makes it verbose) and post the failing commandline command (the last few lines).
I would like to see what '-I' flags have been added to the failing command.
Also could you post the directory path of your "xyz.h" file.

There should be a "-I <path>" the same as <path>/xyz.h

Re: Library API file not found

Posted: Tue Jul 11, 2017 12:57 pm
by Krzemo
Thank you for your help - I've already solved the problem. It was the matter of the bad path in xTimeComposer.

The topic is off.

Re: Library API file not found

Posted: Wed Mar 14, 2018 10:39 am
by alexjaw
Have problem including lib_i2c (4.0.0) to app_usb_aud_xk_216_mc. (Im trying to add i2c slave mode to the usb ref. design)
xTIMEcomposer: Community_14.3.2 (build 25550, Sep-30-2017)

I'm trying to include i2c.h in module_usb_audio/main.xs After Project/Clean... I get the following problems with building (2i10o10xxxxxx):
- Unresolved inclusion of "i2c.h". But I can see lib_i2c and subfolders in app_usb_aud_xk_216_mc/Includes.
- "parse error before i2c" for void i2c_slave_register_file(server i2c_slave_callback_if i2c, server register_if app). This is one of the functions from AN00157 i2c slave application note. For me it seems that xTIMEcomposer cant find i2c_slave_callback_if in lib_i2c/api/i2c.h - I also get failure for Open declaration.

(I have run the code in AN00157 as a separate project without any problems)

Re: Library API file not found

Posted: Wed Mar 14, 2018 11:51 am
by robertxmos
Hi alexjaw,

Could you add '-v' (verbose) to your makefile's XCC_FLAGS.
Could you then post the (last) failing command-line (try building twice to reduce the amount of output).
In the command-line you should see "@_iflag.rsp", please also post the contents of this file viz: .build/_iflag.rsp

robert

Re: Library API file not found

Posted: Wed Mar 14, 2018 2:07 pm
by alexjaw
Attached:
- the build log with --verbose flag.
- the diff for main.xc showing the additions related to the i2c slave stuff, original code from AN00157

Most are warnings from the app_usb, but there are also the warnings for lib_i2c and errors related to void i2c_slave_register_file(server i2c_slave_callback_if i2c, server register_if app) {...} which I have in main.xc