Hi,
I just have started to use Visual Micro under VS 2015. And I run into a problem, when I compile this sketch under arduino IDE it does not bring error, but under Visual Micro yes. Error report is the following:
Compiling debug version of 'test_lib_sketch' for 'Arduino Mega 2560 - Dragino Yún'
ld.exe: BridgeServer.cpp.o: plugin needed to handle lto object
Error linking for board Arduino Mega 2560 - Dragino Yún
Debug build failed for project 'test_lib_sketch'
ccfYngTe.ltrans0.ltrans.o*: In function global constructors keyed to 65535_0_test_lib_sketch.cpp.o.2476
ccfYngTe.ltrans0.o*: (.text.startup+0x144): undefined reference to BridgeServer::BridgeServer(unsigned int, BridgeClass&)
collect2.exe*: error: ld returned 1 exit status What am I trying to do is to create a user library and in the Library I create a BridgeServer object. I tried to use normal text editor way to create a library and also with VM and add in the reference
My header file is:
/*
Name: test_lib.h
Created: 2/16/2018 5:13:35 PM
Author: Winkler Peter
Editor: http://www.visualmicro.com
*/
#ifndef _test_lib_h
#define _test_lib_h
#if defined(ARDUINO) && ARDUINO >= 100
#include "arduino.h"
#else
#include "WProgram.h"
#endif
#include <Bridge.h>
#include <Console.h>
#include <BridgeServer.h>
#include <BridgeClient.h>
#endif
class CommunicationClass
{
public:
//members
BridgeServer Server;
//methods
CommunicationClass(uint16_t port);
~CommunicationClass();
private:
};
My cpp file is:
/*
Name: test_lib.cpp
Created: 2/16/2018 5:13:35 PM
Author: Winkler Peter
Editor: http://www.visualmicro.com
*/
#include "test_lib.h"
CommunicationClass::CommunicationClass(uint16_t port):
Server(port)
{
}
CommunicationClass::~CommunicationClass()
{
}
and my sketch is the following:
/*
Name: test_lib_sketch.ino
Created: 2/16/2018 3:44:26 PM
Author: Winkler Peter
*/
#include "test_lib.h"
CommunicationClass Communication(7777);
// the setup function runs once when you press reset or power the board
void setup() {
}
// the loop function runs over and over again until power down or reset
void loop() {
}
I'm quite new in the topic, so it could be that I miss a lot of things to understand, but I'm stucked at this point.
It would be greatfull, if someone could help me out.
Thank you,
Peter