Before logging an issue, please update to the latest release of Visual Micro from the Downloads Page.

When Logging a Support Issue in the Forum, please ensure you have also:-

  • Enabled vMicro > Compiler > Show Build Properties
  • Re-Compile your program with these settings enabled
 
Save the new Output to a Text File and....
  • Click the Reply button and attach as .txt file OR
  • Click here to Email us with the file attached, and a link to your post
Support requests without the output above may be impossible to answer, so please help us to help you
 
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Compile error in VS2022 not in Arduino IDE 2.3.2 (Read 664 times)
Henk Levels
Junior Member
**
Offline


Posts: 81
Joined: Sep 28th, 2015
Compile error in VS2022 not in Arduino IDE 2.3.2
Jul 12th, 2024 at 3:05pm
Print Post  
I have a sketch that compiles without errors in Arduino IDE 2.3.2
When I compile that same file in VS2022 with visual micro plugin I get a compile error.
RFM69_OTA.h:37: In file included from
RFM69_OTA.cpp:33: from
Error compiling libraries
Build failed for project 'TxPowerTest_Transmitter'
 
RFM69.h: 29:10: fatal error: SPI.h: No such file or directory
   #include <SPI.h>
   ^~~~~~~
   compilation terminated
In VS2022 I have Arduino 2 as micro controller application.
Solution platform is Arm.
Micro Controller board is Moteino Mega USB.
What am I doing wrong?
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Compile error in VS2022 not in Arduino IDE 2.3.2
Reply #1 - Jul 12th, 2024 at 3:06pm
Print Post  
Thanks for the report.

Could you attach the complete build output with the settings shown at the top of the page for us to review?
  
Back to top
IP Logged
 
Henk Levels
Junior Member
**
Offline


Posts: 81
Joined: Sep 28th, 2015
Re: Compile error in VS2022 not in Arduino IDE 2.3.2
Reply #2 - Jul 12th, 2024 at 3:21pm
Print Post  
Compiling 'TxPowerTest_Transmitter' for 'MoteinoMEGA(-USB)(Moteino_moteino_avr_MoteinoMEGA)'
Build Folder: /Moteino_moteino_avr_MoteinoMEGA/Release"
Summary: Header=1 Prototypes=3 Imports=2
Additional Defines: 
Architecture Tools: ols//avr-gcc//7.3.0-atmel3.6.1-arduino7/bin/"
Api: 2.2024.0620-3
Sketch Book: "file:///c:/Users/HenkLevels/Documents/Arduino"
User Libraries: "file:///c:/Users/HenkLevels/Documents/Arduino/libraries"
Build Temp: /Moteino_moteino_avr_MoteinoMEGA/Release"
Board Support Urls: ""
Core Include Paths
Include Path vr/1.8.6/cores/arduino"
Include Path vr/1.6.4/variants/MoteinoMEGA"
Library Include Paths (1)
Include Path 'c:\Users\HenkLevels\Documents\Arduino\libraries\RFM69'
 
Building variant ...
  Using previously compiled variant
 
Building core ...
 
Building libraries ...

Using library RFM69 version 1.5.2 by Felix Rusu <felix@lowpowerlab.com> in folder "c:\Users\HenkLevels\Documents\Arduino\libraries\RFM69"
0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega1284p -DF_CPU=16000000L -DARDUINO=108010 -DARDUINO_AVR_ATmega1284 -DARDUINO_ARCH_AVR -I"c:\Users\HenkLevels\Documents\Arduino\libraries\RFM69" .6\cores\arduino" .4\variants\MoteinoMEGA" "c:\Users\HenkLevels\Documents\Arduino\libraries\RFM69\RFM69.cpp" -o _moteino_avr_MoteinoMEGA\Release\RFM69\RFM69.cpp.o"
 
RFM69.cpp:26: In file included from
0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega1284p -DF_CPU=16000000L -DARDUINO=108010 -DARDUINO_AVR_ATmega1284 -DARDUINO_ARCH_AVR -I"c:\Users\HenkLevels\Documents\Arduino\libraries\RFM69" .6\cores\arduino" .4\variants\MoteinoMEGA" "c:\Users\HenkLevels\Documents\Arduino\libraries\RFM69\RFM69_ATC.cpp" -o _moteino_avr_MoteinoMEGA\Release\RFM69\RFM69_ATC.cpp.o"
 
RFM69.h: 29:10: fatal error: SPI.h: No such file or directory
   #include <SPI.h>
   ^~~~~~~
   compilation terminated
 
RFM69_ATC.h:31: In file included from
RFM69_ATC.cpp:29: from
0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega1284p -DF_CPU=16000000L -DARDUINO=108010 -DARDUINO_AVR_ATmega1284 -DARDUINO_ARCH_AVR -I"c:\Users\HenkLevels\Documents\Arduino\libraries\RFM69" .6\cores\arduino" .4\variants\MoteinoMEGA" "c:\Users\HenkLevels\Documents\Arduino\libraries\RFM69\RFM69_OTA.cpp" -o _moteino_avr_MoteinoMEGA\Release\RFM69\RFM69_OTA.cpp.o"
 
RFM69.h: 29:10: fatal error: SPI.h: No such file or directory
   #include <SPI.h>
   ^~~~~~~
   compilation terminated
 
RFM69_OTA.h:37: In file included from
RFM69_OTA.cpp:33: from
Error compiling libraries
Build failed for project 'TxPowerTest_Transmitter'
 
RFM69.h: 29:10: fatal error: SPI.h: No such file or directory
   #include <SPI.h>
   ^~~~~~~
   compilation terminated
  
Back to top
 
IP Logged
 
Simon@Visual Micro
Administrator
*****
Offline


Posts: 2707
Joined: Feb 13th, 2019
Re: Compile error in VS2022 not in Arduino IDE 2.3.2
Reply #3 - Jul 12th, 2024 at 3:32pm
Print Post  
Sorry could you also enable the vMicro > Compiler > Show Build Properties option, and save the entire output as a text file and attach it to the post?

From the output posted, you don't have the vMicro > Compiler > Deep Search option set to "Libraries + Accurate Prototype Insertion (Gcc-E)", which once set should resolve the issue (and should be set to this by default).

To compile with Deep Search set to OFF, you need to include SPI.h and SPIFlash.h in the sketch file before the RFM69.h.
  
Back to top
IP Logged
 
Henk Levels
Junior Member
**
Offline


Posts: 81
Joined: Sep 28th, 2015
Re: Compile error in VS2022 not in Arduino IDE 2.3.2
Reply #4 - Jul 12th, 2024 at 3:48pm
Print Post  
Thanks Simon. It works!!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint