Hello,
I am facing compilation error while working with GPS module.
First of all I am working with additional software serial port to test my GPS module.
I am facing the below error:
======================
Verifying...
C:\Users\USER\AppData\Local\Temp\ccG2O1Lp.ltrans1.ltrans.o: In function `__static_initialization_and_destruction_0':
E:\B4R\PROGRA~1\SOFTWA~1\Objects\bin\sketch/b4r_main.cpp:16: undefined reference to `DFRobot_SIM808: DFRobot_SIM808(unsigned char, unsigned char, unsigned long)'
collect2.exe: error: ld returned 1 exit status
exit status 1
=======================
Below is my code:
I know that this is a linker issue and the linker cannot find the desired function. But the function "DFRobot_SIM808: DFRobot_SIM808" is already there.
Anyone please suggest.
Thanks-
Pokhraj Das
I am facing compilation error while working with GPS module.
First of all I am working with additional software serial port to test my GPS module.
I am facing the below error:
======================
Verifying...
C:\Users\USER\AppData\Local\Temp\ccG2O1Lp.ltrans1.ltrans.o: In function `__static_initialization_and_destruction_0':
E:\B4R\PROGRA~1\SOFTWA~1\Objects\bin\sketch/b4r_main.cpp:16: undefined reference to `DFRobot_SIM808: DFRobot_SIM808(unsigned char, unsigned char, unsigned long)'
collect2.exe: error: ld returned 1 exit status
exit status 1
=======================
Below is my code:
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
Public Serial1 As Serial
Private Serial2 As SoftwareSerial 'Declaring Additional Software serial port at Arduino UNO
'Private bc As ByteConverter
Public astream As AsyncStreams
Private lat, lon As Float
End Sub
Private Sub AppStart
'Serial1.Initialize(115200)
Serial2.Initialize(9600,6,5) 'TX is pin 5 and RX is pin 6
Log("AppStart")
astream.Initialize(Serial2.Stream,"astream_newdata",Null)
RunNative("setup",Null)
'RunNative("read",Null)
End Sub
Sub astream_newdata(Buffer() As Byte)
Log(Buffer)
End Sub
#if C
#include "DFRobot_sim808.h"
#define PIN_TX 5
#define PIN_RX 6
DFRobot_SIM808 sim808(PIN_TX, PIN_RX);
void setup(B4R::Object* o){
sim808.attachGPS();
}
void read (B4R::Object* o) {
b4r_main::_lat = sim808.GPSdata.lat;
b4r_main::_lon = sim808.GPSdata.lon;
}
#End if
I know that this is a linker issue and the linker cannot find the desired function. But the function "DFRobot_SIM808: DFRobot_SIM808" is already there.
Anyone please suggest.
Thanks-
Pokhraj Das