Welcome, Guest. Please Login or Register
Arduino IDE for Visual Studio
 
 
When Logging a Support Issue in the Forum, please ensure you have also:-
  • Enabled vMicro > Compiler > Show Build Properties and Verbose
  • 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
 
  HomeSearch Tutorials & Wiki visualmicro.com LoginHelpRegister  
 
Page Index Toggle Pages: 1
Send Topic Print
Cannot successfully compile custom library (Read 4956 times)
Etnard Louw
Newbies
*
Offline



Posts: 1
Cape Town, South Africa
Cannot successfully compile custom library
Jan 10th, 2013 at 8:21am
 
I hope someone can help me out with this one. I am new to the Visual Micro IDE and still trying to find my feet. I managed to successfully program the blinky program to my ATmega2560 micro through a USB to serial converter. However when I tried to compile a simple custom transmitter code (virtualwire) that I tried and tested with the arduino IDE it keeps on failing, giving me loads of problems, errors and warnings. What I can figure out is that Visual Micro cant read the KEYWORDS.TXT file hence the reason for some fields that are not declared, but how must I set up the file structure in the Visual Micro environment?

my usual library file for VirtualWire has the following
VirtualWire.cpp
Virtualwire.h

and here is my transmitter code
Code:
#include <VirtualWire.h>
const int enComms = 28;
unsigned int count = 0;
char countL = 0;
char countH = 0;

void setup()
{
 pinMode(30, OUTPUT);
 vw_set_tx_pin(14);
 vw_set_ptt_pin(28);
 vw_setup(2000); // Bits per sec
}
void loop()
{

 digitalWrite(enComms,HIGH);
 delay(10);

 char msg[8] = {'h','e','l','l','o',' ',' ','#'};
 msg[5] = countL;
 msg[6] = countH;

 digitalWrite(30, HIGH); // Flash a light to show transmitting
 vw_send((uint8_t *)msg, strlen(msg));
 vw_wait_tx(); // Wait until the whole message is gone
 digitalWrite(30, LOW);

 //delay(1000);
 count = count + 1;
 countL = count & 0xff;
 countH = (count >> 8);

 digitalWrite(enComms,LOW);
 delay(10);
} 



Code:
I am getting all the following errors
Compiling 'Virtual_TX' for 'Arduino Mega 2560 or Mega ADK'
Build folder: file://C:\...\Arduino\Builds\Virtual_TX\mega2560
SketchLibFolders

Summary: Header=1 Prototypes=3 Imports=1
C:\Users\Ardiuno\arduino-1.0\hardware\tools\avr\bin\avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega2560 -DF_CPU=8000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=10 -DVISUALMICRO_COMPILER_VER=1 -I"C:\...\Ardiuno\arduino-1.0\hardware\arduino\cores\arduino" -I"C:\...\Ardiuno\arduino-1.0\hardware\arduino\variants\mega" -I"C:\...\Ardiuno\arduino-1.0\libraries\VirtualWire" "C:\...\Builds\Virtual_TX\mega2560\Virtual_TX.cpp" -o "C:\...\Builds\Virtual_TX\mega2560\Virtual_TX.cpp.o"
Virtual_TX.ino : In file included from
VirtualWire.h : No such file or directory
Virtual_TX.ino : In file included from
VirtualWire.h : 'vw_set_tx_pin' initialized and declared 'extern'
VirtualWire.h : variable or field 'vw_set_tx_pin' declared void
VirtualWire.h : 'uint8_t' was not declared in this scope
VirtualWire.h : 'uint8_t' does not name a type
VirtualWire.cpp : : In function 'void vw_setup(uint16_t)':
VirtualWire.cpp : 'TCCR1A' was not declared in this scope
VirtualWire.cpp : 'TCCR1B' was not declared in this scope
VirtualWire.cpp : 'WGM12' was not declared in this scope
VirtualWire.cpp : '_BV' was not declared in this scope
VirtualWire.cpp : 'CS10' was not declared in this scope
VirtualWire.cpp : 'OCR1A' was not declared in this scope
VirtualWire.cpp : 'TIMSK' was not declared in this scope
VirtualWire.cpp : 'OCIE1A' was not declared in this scope
VirtualWire.cpp : 'OUTPUT' was not declared in this scope
VirtualWire.cpp : 'pinMode' was not declared in this scope
VirtualWire.cpp : 'INPUT' was not declared in this scope
VirtualWire.cpp : 'digitalWrite' was not declared in this scope
VirtualWire.cpp : : In function 'void vw_tx_start()':
VirtualWire.cpp : 'digitalWrite' was not declared in this scope
VirtualWire.cpp : : In function 'void vw_tx_stop()':
VirtualWire.cpp : 'digitalWrite' was not declared in this scope
VirtualWire.cpp : : In function 'uint8_t vw_wait_rx_max(long unsigned int)':
VirtualWire.cpp : 'millis' was not declared in this scope
VirtualWire.cpp : : At global scope:
VirtualWire.cpp : expected constructor, destructor, or type conversion before '(' token
VirtualWire.cpp : expected `}' at end of input
VirtualWire.cpp : 'vw_tx_msg_count' defined but not used
Error compiling
 



Please help me!
Back to top
 

Please Register or Login to the Forum to see File Attachments
 
IP Logged
 
Visual Micro
Administrator
*****
Offline



Posts: 10706
United Kingdom
Re: Cannot successfully compile custom library
Reply #1 - Jan 10th, 2013 at 2:56pm
 
Hi,

If it compiles in the arduino ide it should be fine as long as VS is using the same arduino.exe.

Questions

1) Where is your library located?

2) Can you see the library on the "Project>add new arduino library" menu in VS?

3) If you select "Build>Clean solution2 in VS does it still fail to compile?

Thanks
Back to top
 

Please Register or Login to the Forum to see File Attachments
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send Topic Print