Compiler cannot detect the file

Technical questions regarding the xTIMEcomposer, xSOFTip Explorer and Programming with XMOS.
N9na
Member
Posts: 8
Joined: Wed Jul 21, 2021 5:30 am

Compiler cannot detect the file

Post by N9na »

Hello everyone, currently I am trying to create my own application, using i2c, USB modules, when I build my own project, some Errors occur.

First is in module_i2c_single_port the i2c-sp.xc file cannot recognize the member in a struct that is defined in i2c.h (They are in the same module).

Second, is in module_usb_audio, some of the files are required to import the other module's file, and the compiler cannot find the files in other modules, the error code is “D:/Work(XMOS)/nws/module_usb_audio/audio.xc:18:10: fatal error: 'dfu_interface.h' file not found”.

I have tried to add the path in the Makefile in my application but still does not work. I am not too sure what happens. Thanks.


N9na
Member
Posts: 8
Joined: Wed Jul 21, 2021 5:30 am

Post by N9na »

I have recreated the workspace by following AN01027, and I get other errors while compiling
"../src/extensions/audiohw.xc:26:36: error: uninitialized member `sda' of type port (incomplete initializer)
on tile [0] : struct r_i2c r_i2c = {XS1_PORT_4A};"

and

"D:/Work(XMOS)/testingWS/module_usb_audio\devicedefines.h:225:23: error: invalid token at start of a preprocessor expression
#if defined(MIDI) && (MIDI == 0)"

I have made sure the .xn file has defined the port and the customdefine.h have defined the MIDI. Not quite sure what to do.
User avatar
mon2
XCore Legend
Posts: 1913
Joined: Thu Jun 10, 2010 11:43 am

Post by mon2 »

It will be much easier to import a working project that offers the same support and modify it for your needs. Often, these 'minor' errors can drain the life out of you.

Import a known good example from the toolchain -> do not change anything in the source code -> compile it and make sure it compiles without errors.

Then move forward to tweak it with your secret recipe.