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) Compile error with Bridge library (Read 10620 times)
Beau89
Newbies
*
Offline


Posts: 9
Joined: Jan 9th, 2016
Compile error with Bridge library
Jan 9th, 2016 at 2:05pm
Print Post  
Hi Visual Micro,
I'm having the "collect2.exe*:error: ld returned 1 exit status
Error creating .elf" error also, on a simple led on and off sketch when I'm referencing the Bridge library.

Do you have any suggestions?

Thanks Heaps
« Last Edit: Feb 3rd, 2016 at 12:49pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Collect2.exe error
Reply #1 - Jan 9th, 2016 at 4:38pm
Print Post  
Hi,

Did you use the Visual Micro Library menu to #include the Bridge.h into your code?

If not please remove the #include and then use the menu

This will ensure you have the correct #includes for the bridge library

If the problem persists switch on "Visual Micro>Verbose" and then build and post or email the output 

Thanks

Thanks
  
Back to top
WWW  
IP Logged
 
Beau89
Newbies
*
Offline


Posts: 9
Joined: Jan 9th, 2016
Re: Collect2.exe error
Reply #2 - Feb 1st, 2016 at 11:52pm
Print Post  
I have this issue again unfortunately.

Your suggestion did fix it originally, however, it has now started occurring again since updating Visual Micro.

I've tried creating a whole new project and this doesn't fix it unfortunately.

  

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Collect2.exe error
Reply #3 - Feb 1st, 2016 at 11:58pm
Print Post  
I think this is because you have called your project the same name as a library

Bridge is library in your source and also the name of the project
  
Back to top
WWW  
IP Logged
 
Beau89
Newbies
*
Offline


Posts: 9
Joined: Jan 9th, 2016
Re: Collect2.exe error
Reply #4 - Feb 2nd, 2016 at 12:34am
Print Post  
Tim@Visual Micro wrote on Feb 1st, 2016 at 11:58pm:
Bridge is library in your source and also the name of the project


My project isn't called bridge Sad The name of the project is Stoker_New. 
I'm calling the Bridge library because I'm running an ArduinoMega2560 with a Dragino Yun Shield on it.

I tried running this exact same project on another computer that has a version of Visual Micro (1604.4.0) and the one I'm having an issue on is 1601.31.0 (and maybe the previous version based on the release date as I was having this issue 20 hours ago also).
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Collect2.exe error
Reply #5 - Feb 2nd, 2016 at 12:46am
Print Post  
Okay I was looking at previously attached output.

Collect2 is a generic error from the compiler/linker the real error is usually above.

Please submit verbose output so I can see your config and what is compiled. Click Build>clean prior to building so that we get a full output

Please also confirm which of the following #includes you have in your sketch

#include <YunServer.h>
#include <YunClient.h>
#include <Process.h>
#include <Mailbox.h>
#include <HttpClient.h>
#include <FileIO.h>
#include <Console.h>
#include <BridgeUdp.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
#include <Bridge.h>

Thanks
  
Back to top
WWW  
IP Logged
 
Beau89
Newbies
*
Offline


Posts: 9
Joined: Jan 9th, 2016
Re: Collect2.exe error
Reply #6 - Feb 2nd, 2016 at 2:27am
Print Post  
Hi There,

Please find attached.

I'm using the following in the sketch:
#include <Process.h>
#include <FileIO.h>
#include <Console.h>
#include <Bridge.h>
#include <YunClient.h>
  

Please Register or Login to the Forum to see File Attachments
Back to top
 
IP Logged
 
Beau89
Newbies
*
Offline


Posts: 9
Joined: Jan 9th, 2016
Re: Collect2.exe error
Reply #7 - Feb 2nd, 2016 at 3:32am
Print Post  
If it helps you, I just tried the following example sketch and it used to work 100% before but now it's not, I get the same error. Sad

Is there a way to downgrade my version of Visual Micro to try it on that to eliminate my development environment?

from: http://wiki.dragino.com/index.php?title=Yun_Shield#Example_3:_Log_Data_to_USB_fl...

Code (C++)
Select All
#include <FileIO.h>     //FileIO class allow user to operate Linux file system
#include <Console.h>   //Console class provide the interactive between IDE and Yun Shield


void setup() {
  // Initialize the Console
  Bridge.begin();
  Console.begin();
  FileSystem.begin();

  while(!Console);  // wait for Serial port to connect.
  Console.println("Filesystem datalogger\n");
}


void loop () {
  // make a string that start with a timestamp for assembling the data to log:
  String dataString;
  dataString += getTimeStamp();
  dataString += " , ";

  // read three sensors and append to the string:
  for (int analogPin = 0; analogPin < 3; analogPin++) {
    int sensor = analogRead(analogPin);
    dataString += String(sensor);
    if (analogPin < 2) {
      dataString += ",";  // separate the values with a comma
    }
  }

  // open the file. note that only one file can be open at a time,
  // so you have to close this one before opening another.
  // The USB flash card is mounted at "/mnt/sda1" by default
  File dataFile = FileSystem.open("/mnt/sda1/data/datalog.csv", FILE_APPEND);

  // if the file is available, write to it:
  if (dataFile) {
    dataFile.println(dataString);
    dataFile.close();
    // print to the serial port too:
    Console.println(dataString);
  } 
  // if the file isn't open, pop up an error:
  else {
    Console.println("error opening datalog.csv");
  }

  delay(15000);  //Write every 15 seconds

}

// getTimeStamp function return a string with the time stamp
// Yun Shield will call the Linux "date" command and get the time stamp
String getTimeStamp() {
  String result;
  Process time;
  // date is a command line utility to get the date and the time
  // in different formats depending on the additional parameter
  time.begin("date");
  time.addParameter("+%D-%T");  // parameters: D for the complete date mm/dd/yy
                                //             T for the time hh:mm:ss   
  time.run();  // run the command

  // read the output of the command
  while(time.available()>0) {
    char c = time.read();
    if(c != '\n')
      result += c;
  }

  return result;
} 

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


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error with Dragino_mega2560Yun and Bridge
Reply #8 - Feb 2nd, 2016 at 12:31pm
Print Post  
Hi,

I am not seeing a standard mega2560 board selection so please provide a url to the hardware so I can install.

However you might try switching off "Visual Micro>Deep Search" which might be affecting things otherwise I will try after installing the hardware
« Last Edit: Feb 2nd, 2016 at 12:33pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Beau89
Newbies
*
Offline


Posts: 9
Joined: Jan 9th, 2016
Re: Compile error with Dragino_mega2560Yun and Bridge
Reply #9 - Feb 2nd, 2016 at 12:54pm
Print Post  
Hi there. 

Try this link:

http://www.dragino.com/downloads/downloads/YunShield/package_dragino_yun_test_in...


I've tried it with deep search off also, it unfortunately didn't make much difference. Sad
  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error with Dragino_mega2560Yun and Bridge
Reply #10 - Feb 2nd, 2016 at 1:13pm
Print Post  
Okay thanks I will try it later today
  
Back to top
WWW  
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error with Bridge library
Reply #11 - Feb 2nd, 2016 at 10:26pm
Print Post  
Thanks for all the info. 

Its a recent feature that libraries can build into archives. the Bridge library is one of them but Visual Micro was passing it to the linker before the project.o.

Was

Code
Select All
.elf -o Bridge.a Project_Name.a Core.a 



In next release the order is this which builds correctly.

Code
Select All
.elf -o Project_Name.a Bridge.a Core.a 



I think the release will be today or tomorrow so watch for the flag at the top of VS, subscribe to notifications in the new release section of this forum or the Visual Studio Gallery.

Thanks again.
« Last Edit: Feb 3rd, 2016 at 12:50pm by Tim@Visual Micro »  
Back to top
WWW  
IP Logged
 
Beau89
Newbies
*
Offline


Posts: 9
Joined: Jan 9th, 2016
Re: Compile error with Bridge library
Reply #12 - Feb 2nd, 2016 at 10:40pm
Print Post  
Thanks heaps for that. I'll keep an eye our for it and let you know how I go. Smiley

« Last Edit: Feb 3rd, 2016 at 12:49pm by Tim@Visual Micro »  
Back to top
 
IP Logged
 
Tim@Visual Micro
Administrator
*****
Offline


Posts: 12071
Location: United Kingdom
Joined: Apr 10th, 2010
Re: Compile error with Bridge library
Reply #13 - Feb 4th, 2016 at 4:55pm
Print Post  
Fixed in 1602.3
  
Back to top
WWW  
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint