I have a new project where the compiler all of a sudden complains: fatal error: 'random.h' file not found
I have several other projects in the same workspace where this file is seen, the module compiled and run.
This new project has xc and cpp files, but the others have xc and c.
The module_random is included with USED_MODULES = lib_spi module_random. The .include lists are equal. The usages are equal.
In .build I find a directory called
Code: Select all
/_m_random/src
random_init.c.pca.xml
random_init.c.pca.xml.decouple
Code: Select all
/_m_random/src
random_init.c.d
random_init.c.o
random.xc.d
random.xc.o
Here is the full log:
Code: Select all
xmake CONFIG=Default all
Checking build modules
Using build modules: lib_spi(3.0.2) module_random
Analyzing __arduino_radiohead_on_xmos_port.xc
Analyzing xccompat_arduino.xc
../src/XMOSArduinoCompat/xccompat_arduino.xc:13:10: fatal error: 'random.h' file not found
#include "random.h"
^
../src/XMOSArduinoCompat/xccompat_arduino.xc:20:1: warning: type defaults to `int' in declaration of `random_generator_t' [-Wimplicit-int]
random_generator_t random_seed = random_create_generator_from_seed(0);
^~~~~~~~~~~~~~~~~~
../src/XMOSArduinoCompat/xccompat_arduino.xc:20:1: warning: data definition has no type or storage class [-Wunusual-code]
random_generator_t random_seed = random_create_generator_from_seed(0);
^~~~~~~~~~~~~~~~~~
../src/XMOSArduinoCompat/xccompat_arduino.xc:20:20: error: parse error before "random_seed"
random_generator_t random_seed = random_create_generator_from_seed(0);
^
../src/XMOSArduinoCompat/xccompat_arduino.xc:20:20: warning: type defaults to `int' in declaration of `random_seed' [-Wimplicit-int]
random_generator_t random_seed = random_create_generator_from_seed(0);
^~~~~~~~~~~
../src/XMOSArduinoCompat/xccompat_arduino.xc:20:20: warning: data definition has no type or storage class [-Wunusual-code]
random_generator_t random_seed = random_create_generator_from_seed(0);
^~~~~~~~~~~
../src/XMOSArduinoCompat/xccompat_arduino.xc:20:34: error: unknown function identifier `random_create_generator_from_seed' (possibly missing prototype?)
random_generator_t random_seed = random_create_generator_from_seed(0);
^
../src/XMOSArduinoCompat/xccompat_arduino.xc:42:30: error: unknown function identifier `random_get_random_number' (possibly missing prototype?)
unsigned random_number = random_get_random_number(random_seed); // [0..2exp32-1]
^
xmake[1]: *** [.build/src/XMOSArduinoCompat/xccompat_arduino.xc.pca.xml.decouple] Error 1
xmake: *** [analyze] Error 2
12:51:41 Build Finished (took 597ms)
Code: Select all
<preCompilationAnalysis file="/Users/teig/workspace/module_random/src/random_init.c">
</preCompilationAnalysis>
Code: Select all
Index | Search for Unresolved Includes
Index | Re-resolve unresolved Includes
I have been looking at Library API file not found and neither "random.h" nor <random.h> make any difference. And of course I have done Clean Project, before I posted this question.
However, when I did Clean Project again now, it didn't complain! So I guess I'll mark this as Solved!