CLionArduinoPlugin icon indicating copy to clipboard operation
CLionArduinoPlugin copied to clipboard

Build fails due to random letter missing in file paths

Open MarcoStalder opened this issue 6 years ago • 1 comments

I am already successfully using quite some classes and libraries in this project. Now I wanted to add another class, called I2CMessageDispatcher. So far I only have the #include "I2CMessageDispatcher.h" statement in the main Sketch itself. I do not use anything of the class anywhere, yet. When I try to run the project, error messages such as the two examples below show up and it doesn't work. (all the [...] are just manually censored)

Sometimes, such as in the first example of error messages shown below, it doesn't show anything of the new class I2CMessageDispatcher at all. The only problem seems to be that there is one random letter missing within the file path (...\libraries\SI\src... instead of ...\libraries\SPI\src... and ...Marco\Docments[...]\libraries... instead of ...Marco\Documents[...]\libraries...).

Eventhough e.g. this SPI library is not even used nor imported in the new class I2CMessageDispatcher. I don't see any connection between the two.

When I try to run again, the error messages stay pretty much the same (except that the order of the two paths might change).

When I reload the CMake Project, the error messages change. Then, two other paths with a random letter missing, appear. But after a few times reloading the CMake Project, I realized, that those paths seem to be out of a selection of about 5 paths (and each of the path is always missing its same letter).

Sometimes, instead of two paths with a random letter missing, there is one path with a random letter missing and one thing actually about the new class. Such as shown in the second example of error messages below. I don't see any missing letter in the path for the file I2CMessageDispatcher.cpp.d (though I don't know what the ".d" is doing there and whether this might be the problem).

(When I remove the #include "I2CMessageDispatcher.h" statement from the main Sketch, everything builds and runs perfectly.)

Example 1: ====================[ Build | [...] | Debug ]=============== C:\Users\Marco\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\191.6707.69\bin\cmake\win\bin\cmake.exe --build C:\Users\Marco\Documents[...]\cmake-build-debug --target [...]-upload -- -j 2 [ 42%] Built target mega_CORE [ 45%] Built target mega_[...] [ 49%] Built target mega_I2CMessageType [ 50%] Building CXX object CMakeFiles/mega_SPI.dir/C_/Program_Files_(x86)/Arduino/hardware/arduino/avr/libraries/SPI/src/SPI.cpp.obj [ 52%] Building CXX object CMakeFiles/mega_I2C.dir/libraries/I2C/I2C.cpp.obj AVR-G_~1.EXE: error: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SI\src\SPI.cpp: No such file or directory AVR-G_~1.EXE: fatal error: no input files compilation terminated. mingw32-make.exe[3]: *** [CMakeFiles/mega_SPI.dir/C_/Program_Files_(x86)/Arduino/hardware/arduino/avr/libraries/SPI/src/SPI.cpp.obj] Error 1 CMakeFiles\mega_SPI.dir\build.make:61: recipe for target 'CMakeFiles/mega_SPI.dir/C_/Program_Files_(x86)/Arduino/hardware/arduino/avr/libraries/SPI/src/SPI.cpp.obj' failed AVR-G_~1.EXE: error: C:\Users\Marco\Docments[...]\libraries\I2C\I2C.cpp: No such file or directory CMakeFiles\Makefile2:377: recipe for target 'CMakeFiles/mega_SPI.dir/all' failed mingw32-make.exe[2]: *** [CMakeFiles/mega_SPI.dir/all] Error 2 mingw32-make.exe[2]: *** Waiting for unfinished jobs.... AVR-G_~1.EXE: fatal error: no input files compilation terminated. mingw32-make.exe[3]: *** [CMakeFiles/mega_I2C.dir/libraries/I2C/I2C.cpp.obj] Error 1 CMakeFiles\mega_I2C.dir\build.make:61: recipe for target 'CMakeFiles/mega_I2C.dir/libraries/I2C/I2C.cpp.obj' failed mingw32-make.exe[2]: *** [CMakeFiles/mega_I2C.dir/all] Error 2 CMakeFiles\Makefile2:562: recipe for target 'CMakeFiles/mega_I2C.dir/all' failed mingw32-make.exe[1]: *** [CMakeFiles/[...]-upload.dir/rule] Error 2 CMakeFiles\Makefile2:754: recipe for target 'CMakeFiles/[...]-upload.dir/rule' failed mingw32-make.exe: *** [[...]-upload] Error 2 Makefile:351: recipe for target '[...]-upload' failed

Example2: ====================[ Build | [...]-upload | Debug ]=============== C:\Users\Marco\AppData\Local\JetBrains\Toolbox\apps\CLion\ch-0\191.6707.69\bin\cmake\win\bin\cmake.exe --build C:\Users\Marco\Documents[...]\cmake-build-debug --target [...]-upload -- -j 2 [ 42%] Built target mega_CORE [ 45%] Building CXX object CMakeFiles/mega_I2CMessageDispatcher.dir/I2CMessageDispatcher/I2CMessageDispatcher.cpp.obj [ 45%] Built target mega_Linduino C:\Users\Marco\Documents[...]\I2CMessageDispatcher\I2CMessageDispatcher.cpp:133:1: fatal error: opening dependency file CMakeFiles\mega_I2CMessageDispatcher.dir\I2CMessageDipatcher\I2CMessageDispatcher.cpp.d: No such file or directory } ^ compilation terminated. CMakeFiles\mega_I2CMessageDispatcher.dir\build.make:61: recipe for target 'CMakeFiles/mega_I2CMessageDispatcher.dir/I2CMessageDispatcher/I2CMessageDispatcher.cpp.obj' failed mingw32-make.exe[3]: *** [CMakeFiles/mega_I2CMessageDispatcher.dir/I2CMessageDispatcher/I2CMessageDispatcher.cpp.obj] Error 1 mingw32-make.exe[2]: *** [CMakeFiles/mega_I2CMessageDispatcher.dir/all] Error 2 mingw32-make.exe[2]: *** Waiting for unfinished jobs.... CMakeFiles\Makefile2:414: recipe for target 'CMakeFiles/mega_I2CMessageDispatcher.dir/all' failed [ 47%] Building CXX object CMakeFiles/mega_SPI.dir/C_/Program_Files_(x86)/Arduino/hardware/arduino/avr/libraries/SPI/src/SPI.cpp.obj AVR-G_~1.EXE: error: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SI\src\SPI.cpp: No such file or directory AVR-G_~1.EXE: fatal error: no input files compilation terminated. CMakeFiles\mega_SPI.dir\build.make:61: recipe for target 'CMakeFiles/mega_SPI.dir/C_/Program_Files_(x86)/Arduino/hardware/arduino/avr/libraries/SPI/src/SPI.cpp.obj' failed mingw32-make.exe[3]: *** [CMakeFiles/mega_SPI.dir/C_/Program_Files_(x86)/Arduino/hardware/arduino/avr/libraries/SPI/src/SPI.cpp.obj] Error 1 mingw32-make.exe[2]: *** [CMakeFiles/mega_SPI.dir/all] Error 2 CMakeFiles\Makefile2:377: recipe for target 'CMakeFiles/mega_SPI.dir/all' failed mingw32-make.exe[1]: *** [CMakeFiles/[...]-upload.dir/rule] Error 2 CMakeFiles\Makefile2:754: recipe for target 'CMakeFiles/[...]-upload.dir/rule' failed Makefile:351: recipe for target '[...]-upload' failed mingw32-make.exe: *** [[...]-upload] Error 2

Any idea on how to solve this issue would be appreciated.

MarcoStalder avatar May 22 '19 07:05 MarcoStalder

I also tried to create another class instead (with a different (shorter) name). Still the same errors occur. I don't know much about cmake. But it seems to me like there is some limitation on how many classes and/or libraries I can include. Might this be due to some memory allocation problem in the Plugin itself or something similar? Maybe some array is indexed out of bounds?

Any Ideas on how to fix this?

MarcoStalder avatar May 31 '19 10:05 MarcoStalder