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 collect2*:error: ld returned 1 exit status (Read 15649 times)
testato
Junior Member
**
Offline


Posts: 48
Joined: Feb 11th, 2014
collect2*:error: ld returned 1 exit status
Nov 8th, 2014 at 9:26pm
Print Post  
Hi,

today i found a strange bug on VisualMicro.

If you try this library: https://github.com/todbot/SoftI2CMaster

on the included Examples, in Arduino 1.5.8 there is no compile error.

Instead on last VisualMicro 1407.10 SP5 - (4th October 2014) there is this errors:

Code (C++)
Select All
Compiling 'MMA8452Q_Example_SoftI2C' for 'Arduino Uno'
Build folder: 2C/uno
Summary: Header=1 Prototypes=11 Imports=1
Additional Defines: VISUALMICRO_COMPILER_VER=1;
Architecture Tools: /
GCC: 4.8.1
Sketchbook: file:///D:/DATI/PERSONALE/Varie/Elettronica/ARDUINO/Sketch_Atmel
All import libraries will be re-compiled
Core Include Paths
Include Path cores\arduino'
Include Path variants\standard'
n/avr-g++" -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=158 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR r\cores\arduino" r\variants\standard" MMA8452Q_Example_SoftI2C.cpp" -o MMA8452Q_Example_SoftI2C.cpp.o" -DVISUALMICRO_COMPILER_VER=1
n/avr-gcc" -w -Os -Wl,--gc-sections -mmcu=atmega328p -o MMA8452Q_Example_SoftI2C.elf" MMA8452Q_Example_SoftI2C.cpp.o" core.a" o" -lm
MMA8452Q_Example_SoftI2C.cpp.o:In function `readRegisters(unsigned char, int, unsigned char*)'
MMA8452Q_Example_SoftI2C.ino:beginTransmission(int)'
MMA8452Q_Example_SoftI2C.ino:send(unsigned char)'
MMA8452Q_Example_SoftI2C.ino:endTransmission()'
MMA8452Q_Example_SoftI2C.ino:requestFrom(int)'
MMA8452Q_Example_SoftI2C.ino:receive()'
MMA8452Q_Example_SoftI2C.ino:receiveLast()'
MMA8452Q_Example_SoftI2C.ino:endTransmission()'
MMA8452Q_Example_SoftI2C.cpp.o:In function `readRegister(unsigned char)'
MMA8452Q_Example_SoftI2C.ino:beginTransmission(int)'
MMA8452Q_Example_SoftI2C.ino:send(unsigned char)'
MMA8452Q_Example_SoftI2C.ino:endTransmission()'
MMA8452Q_Example_SoftI2C.ino:requestFrom(int)'
MMA8452Q_Example_SoftI2C.ino:receiveLast()'
MMA8452Q_Example_SoftI2C.ino:endTransmission()'
MMA8452Q_Example_SoftI2C.cpp.o:In function `writeRegister(unsigned char, unsigned char)'
MMA8452Q_Example_SoftI2C.ino:beginTransmission(int)'
MMA8452Q_Example_SoftI2C.ino:send(unsigned char)'
MMA8452Q_Example_SoftI2C.ino:send(unsigned char)'
MMA8452Q_Example_SoftI2C.ino:endTransmission()'
MMA8452Q_Example_SoftI2C.cpp.o:In function `__static_initialization_and_destruction_0'
MMA8452Q_Example_SoftI2C.ino:SoftI2CMaster(unsigned char, unsigned char, unsigned char)'
collect2*:error: ld returned 1 exit status
Error creating .elf 



What do you think ?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: collect2*:error: ld returned 1 exit status
Reply #1 - Nov 8th, 2014 at 9:56pm
Print Post  
Please open arduino 1.5.8 and let me know what, if anything, is entered into file>preferences>sketchbook folder

Thanks
  
Back to top
IP Logged
 
testato
Junior Member
**
Offline


Posts: 48
Joined: Feb 11th, 2014
Re: collect2*:error: ld returned 1 exit status
Reply #2 - Nov 8th, 2014 at 10:19pm
Print Post  
D:\DATI\PERSONALE\Varie\Elettronica\ARDUINO\SKETCH
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: collect2*:error: ld returned 1 exit status
Reply #3 - Nov 8th, 2014 at 10:25pm
Print Post  
Makes sense.

I noticed the library missing from the compile and I would have expect a more obvious error.

The way Arduino works is that user libraries are found off the sketchbook folder\libraries.

In Visual Micro you have set a sketchbook folder of D:/DATI/PERSONALE/Varie/Elettronica/ARDUINO/Sketch_Atmel but in the Arduino Ide it is different. 

You can clear or adjust the sketchbook from Visual Micro then re-start the ide and it should use the one set in the Arduino ide.

Thanks
  
Back to top
IP Logged
 
testato
Junior Member
**
Offline


Posts: 48
Joined: Feb 11th, 2014
Re: collect2*:error: ld returned 1 exit status
Reply #4 - Nov 8th, 2014 at 11:16pm
Print Post  
yep  Wink

thanks,

i changed many time ago the visualmicro sketchbook, and whit many code it work.
Why you leave this possibilities in the visualmicro ? 
it's better remove this option from visualmicro ?
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12186
Location: United Kingdom
Joined: Apr 10th, 2010
Re: collect2*:error: ld returned 1 exit status
Reply #5 - Nov 8th, 2014 at 11:25pm
Print Post  
It wouldn't be right for some people that do not use Arduino Ide.

We have to reply on people not entering a value because it says (optional)
« Last Edit: Nov 8th, 2014 at 11:25pm by Tim@Visual Micro »  
Back to top
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint