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
Hot Topic (More than 8 Replies) First Sketch compile fails (Read 11450 times)
bjornjuul
Newbies
*
Offline


Posts: 5
Joined: Jan 25th, 2015
First Sketch compile fails
Jan 25th, 2015 at 8:28pm
Print Post  
Hi

Iøm new to Arduino but have been programming for many years with AVR- and Atmel Studio.

To spare me the time of construction I bought a Arduino Pro 328 board and installed the VS add-in for Atmel Studio 6.2.

When I start a new sketch and just tries to compile it, I get the following error:

Compiling 'Sketch3' for 'Arduino Pro or Pro Mini w/ ATmega328 (3.3V, 8 MHz)'
Build folder: atmega328
Summary: Header=1 Prototypes=3 Imports=0
Additional Defines: 
Architecture Tools: F:\Program Files (x86)\Arduino/hardware/tools/avr/bin/
GCC: 4.8.1
Sketchbook: file:///E:/Users/bjorn.juul/Documents/Arduino
Core Include Paths
Include Path 'F:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino'
Include Path 'F:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs'
"F:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avr-g++" -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=8000000L -DARDUINO=158 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR -I"F:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"F:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs" 28\MyClass.cpp" -o 28\MyClass.cpp.o"
Error compiling


Can anyone see where it went wrong?

/Bjorn
« Last Edit: Jan 25th, 2015 at 8:31pm by bjornjuul »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First Sketch compile fails
Reply #1 - Jan 25th, 2015 at 8:54pm
Print Post  
Hi,

I see you are using the arduino 1.5.x beta. Without asking for more info just yet I am going to take a guess as to the problem...

Please try installing the latest beta from visualmicro.com downloads page to see if that resolves the issue.

If that does not work then please add the location of the arduino ide folder to the START of your PATH environment variable. (control panel>environment variables)

Why Issue?
The problem is probebly that the latest toolchain installed with arduino 1.5.8 does not auto discover the location of the cygwin programs that are located in the arduino ide folder. Normally we see this error when winavr is installed because it adds to the windows path environment var and contains a cygwin.dll in the same folder.


Look forward to hearing how you get on.

Thanks
  
Back to top
IP Logged
 
bjornjuul
Newbies
*
Offline


Posts: 5
Joined: Jan 25th, 2015
Re: First Sketch compile fails
Reply #2 - Jan 25th, 2015 at 9:16pm
Print Post  
Hi

I just tried adding the environment variables, but still the same problem.

The VS is the newest beta version, but I still got winavr installed. I've noticed this problem popping up in different forums, but I haven't been able to figure out what to do.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First Sketch compile fails
Reply #3 - Jan 25th, 2015 at 9:21pm
Print Post  
Hi,

Okay please email your path environment to info [at] visualmicro.com

Also please email your sketch.

Thanks

By the way does the blink example work?
  
Back to top
IP Logged
 
bjornjuul
Newbies
*
Offline


Posts: 5
Joined: Jan 25th, 2015
Re: First Sketch compile fails
Reply #4 - Jan 25th, 2015 at 9:37pm
Print Post  
Hi again

No, "blink" won't compile either.
I've send the info as requested.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First Sketch compile fails
Reply #5 - Jan 25th, 2015 at 10:22pm
Print Post  
Hi,

Thanks for the files.

The sketch compiles correctly for me. 

It does not appear that the path environment variables was the problem.

I can only assume that this is a permissions issue with the e:\drive or the f:\

Maybe an issue attempting to write to "E:/Users/bjorn.juul/AppData/Local/VMicro/Arduino/Builds/Sketch3/pro_8MHz
atmega328"

You could also try putting this command into a .bat file in a folder such my documents. Then run it from a cmd prompt:-

Code
Select All
"F:\Program Files (x86)\Arduino/hardware/tools/avr/bin/avr-g++" -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=8000000L -DARDUINO=158 -DARDUINO_AVR_PRO -DARDUINO_ARCH_AVR -I"F:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"F:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\eightanaloginputs"
28\MyClass.cpp" -o
28\MyClass.cpp.o"
 



What does it show after it runs? Can you see a .o file has been created in 
28\MyClass.cpp.o" after it runs?
  
Back to top
IP Logged
 
bjornjuul
Newbies
*
Offline


Posts: 5
Joined: Jan 25th, 2015
Re: First Sketch compile fails
Reply #6 - Jan 25th, 2015 at 10:44pm
Print Post  
Hi

Thank you for all your help. Unfortunately, the script doesn't seem to work.

When I run it from a prompt it only returns a pop-up warning saying:

avr-g++.exe - Entry Point Not Found
The procedure entry point __ctype_ptr__ could not be located in the dynamic link library cygwin1.dll


I tried the same setup with the add-in on my laptop at work where all programs are installed on the C-drive - still with the same result.
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First Sketch compile fails
Reply #7 - Jan 25th, 2015 at 10:57pm
Print Post  
That's interesting, without using visual micro the tool chain is failing with the same problem (but better error). 

I mentioned the cygwin1.dll earlier. The error means that your pc is finding the wrong cygwin1.dll. This is an annoying change in the arduino toolchain since v1.5.7. 

Visual Micro attempts to compensate by adding the location of the arduino ide to your path while running the compile. But obviously that failed so you manually added the location of the arduino exe folder to your path which forces the cygwin.dll in the arduino folder to be located before any other version. However that has also now failed and we see clearly from the error that this is the problem that the wrong cygwin.dll is being found.

Is is possible you have another environment variable called path? Did you check the user or global environment variable in control panel?

Can you also search your pc for all instances of cygwin.dll. Let's see where they all are?

Thanks

« Last Edit: Jan 25th, 2015 at 10:58pm by Tim@Visual Micro »  
Back to top
IP Logged
 
bjornjuul
Newbies
*
Offline


Posts: 5
Joined: Jan 25th, 2015
Re: First Sketch compile fails
Reply #8 - Jan 25th, 2015 at 11:21pm
Print Post  
Hi again

Nailed it!! I forgot about the global variables and only edited the user part.
But as soon as I added the arduino path to the global variables - it worked like a charm and compiled without any hiccups!

Thank you so much for the quick and effective response - I couldn't have made it without! Smiley

And just for the record I actually found multible cygwins relating from the following programs:

- Arduino
- Altera Quartus
- Atmel
- Winavr
- Nero 9 Burning ROM

Once again - this is great service! A++ Cheesy
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12187
Location: United Kingdom
Joined: Apr 10th, 2010
Re: First Sketch compile fails
Reply #9 - Jan 26th, 2015 at 1:16pm
Print Post  
Great thanks for the info. I will try installing those programs to see if I can reproduce.

You would think the user variables take priority over global!
« Last Edit: Jan 26th, 2015 at 1:16pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint