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 Error creating .elf (Read 3950 times)
thedriveee
Newbies
*
Offline


Posts: 2
Joined: Jun 13th, 2015
Error creating .elf
Jun 13th, 2015 at 11:16am
Print Post  
Hello all! Please help.

I reinstall arduino and Visual Micro for Visual studio 2013 and now can't compile project:


Code (C++)
Select All
#include <C:/Arduino/IRremote/IRremote.h>
// use the library
#define TMP20 7
#define TMP10 6
#define TMP0 5
#define IR_RECEIVER_PIN 11
IRrecv irrecv(IR_RECEIVER_PIN); // create instance of irrecv
decode_results results;
int res;
int cicles = 0;
int lastRes;
int maxCicles = 350;
int minCicles = 50;
int skipEntranceCount = 0;
int lastResForCheck = 0;
int idleCiclesCount = 0;


void setup() {
	Serial.begin(9600);
	pinMode(8, OUTPUT);
	digitalWrite(8, HIGH);
	pinMode(9, OUTPUT);
	digitalWrite(9, HIGH);
	pinMode(13, OUTPUT);
	digitalWrite(13, LOW);
	irrecv.enableIRIn();
}

void loop() {
	if (cicles < maxCicles) {
		cicles++;
	}


	if (irrecv.decode(&results)) // have we received an IR signal?
	{


		idleCiclesCount = 0;
		if (results.value != 4294967295) {
			res = results.value;
			if (2672 == res || 752 == res || 2800 == res) {
				if (res != lastRes || cicles >= maxCicles) {
					Serial.println(res);
					cicles = 0;
				}
			}
			else if (824 == res || 2872 == res) {
				if (res != lastRes || cicles >= maxCicles) {
					Serial.println(res);
					cicles = 0;
				}
			}
			else if (720 == res || 3280 == res) {
				if (res != lastRes || cicles >= maxCicles) {
					skipEntranceCount++;
					Serial.println(res);
					cicles = 0;
				}
				else if (res == lastRes && skipEntranceCount > 1) {
					Serial.println(res);
					cicles = 0;
				}
			}
			else if (1168 == res || 3216 == res) {
				if (res != lastRes || cicles >= maxCicles) {
					skipEntranceCount++;
					Serial.println(res);
					cicles = 0;
				}
				else if (res == lastRes && skipEntranceCount > 1) {
					Serial.println(res);
					cicles = 0;
				}
			}
			else {
				Serial.println(res);
				cicles = 0;
			}

			lastRes = res;

		}

		irrecv.resume();// receive the next value

	}
	else {
		if (skipEntranceCount != 0) {
			idleCiclesCount++;
		}

		if (idleCiclesCount > minCicles) {
			skipEntranceCount = 0;
			idleCiclesCount = 0;
		}

	}


	delay(1);
} 





Output from Visual Micro:

Compiling 'new' for 'Arduino Uno'
Build folder: file:///C:/Users/Денис/AppData/Local/V.Micro/Arduino/Builds/new/uno
Summary: Header=1 Prototypes=3 Imports=1
Additional Defines: 
Architecture Tools: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/
Sketchbook: file:///C:/Users/Денис/Documents/Arduino
Core Include Paths
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino'
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard'
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=164 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\new\uno\new.cpp" -o "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\new\uno\new.cpp.o"
Build Core Paths: C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\new\uno/new.elf" "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\new\uno\new.cpp.o" "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\new\uno/core.a" "-LC:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\new\uno" -lm
new.cpp.o:In function `setup'
new.ino:enableIRIn()'
new.cpp.o:In function `loop'
new.ino:decode(decode_results*)'
new.ino:resume()'
new.cpp.o:In function `__static_initialization_and_destruction_0'
new.ino:IRrecv(int)'
collect2.exe*:error: ld returned 1 exit status
Error creating .elf
Compiling 'we' for 'Arduino Uno'
Build folder: file:///C:/Users/Денис/AppData/Local/V.Micro/Arduino/Builds/we/uno
Summary: Header=1 Prototypes=3 Imports=1
Additional Defines: 
Architecture Tools: C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/
Sketchbook: file:///C:/Users/Денис/Documents/Arduino
Core Include Paths
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino'
Include Path 'C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard'
All import libraries will be re-compiled
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-g++" -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=164 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino" -I"C:\Program Files (x86)\Arduino\hardware\arduino\avr\variants\standard" "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\we\uno\we.cpp" -o "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\we\uno\we.cpp.o"
Build Core Paths: C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino
"C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\we\uno/we.elf" "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\we\uno\we.cpp.o" "C:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\we\uno/core.a" "-LC:\Users\Денис\AppData\Local\V.Micro\Arduino\Builds\we\uno" -lm
we.cpp.o:In function `setup'
we.ino:enableIRIn()'
we.cpp.o:In function `loop'
we.ino:decode(decode_results*)'
we.ino:resume()'
we.cpp.o:In function `__static_initialization_and_destruction_0'
we.ino:IRrecv(int)'
collect2.exe*:error: ld returned 1 exit status
Error creating .elf



Thank everybody in advance!





  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12163
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Error creating .elf
Reply #1 - Jun 13th, 2015 at 1:12pm
Print Post  
Hi,

Thanks for the useful info.

Are you new to Arduino?

This is wrong:-
#include <C:/Arduino/IRremote/IRremote.h>

1)
You must put libraries in sketchbook/libraries folder

C:/Users/Денис/Documents/Arduino/Libraries

You can change the sketchbook path but I can see above you are using the default which is recommended


2)
It is recommended to use the menu to add #includes so that you can understand how things work

http://www.visualmicro.com/page/User-Guide.aspx?doc=Add-Libraries.html

When your library is located in the correct place it will appear on the menus display in the above guide.
« Last Edit: Jun 14th, 2015 at 6:02pm by Tim@Visual Micro »  
Back to top
IP Logged
 
thedriveee
Newbies
*
Offline


Posts: 2
Joined: Jun 13th, 2015
Re: Error creating .elf
Reply #2 - Jun 13th, 2015 at 2:13pm
Print Post  
Thanks for fast reply.
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint