[英]Undefined refence to 'vtable for Adafruit_GFX' due cross compiling raspberry pi
在Visualstudio中嘗試交叉編譯為覆盆子pi,我收到以下錯誤:
VisualGDB:在pi @ raspberrypi(SSH)上的目錄“/ tmp / VisualGDB / c / Users / Revius / Desktop / usbtest / conversiecsc ++ / LinuxProject12 / LinuxProject12”中運行“make CONFIG = Debug”
g ++ -ggdb -ffunction-sections -O0 -DDEBUG -c LinuxProject12.cpp -o Debug / LinuxProject12.o -MD -MF Debug / LinuxProject12.dep
g ++ -o Debug / LinuxProject12 -Wl,-gc-sections -L / home / pi / libssd1306 / build / ArduiPi_OLED -Wl, - start-group Debug / LinuxProject12.o -Wl, - rpath ='$ ORIGIN' - Wl, - end-group Debug / LinuxProject12.o:在函數`Adafruit_GFX :: ~Adafruit_GFX()'中:
C:\\ Users \\ Revius \\ AppData \\ Local \\ VisualGDB \\ RemoteSourceCache \\ raspberrypi \\ 0003 \\ include \\ Adafruit_GFX.h(35):錯誤VGDB1000:未定義引用'vtable for Adafruit_GFX'
Adafruit_GFX.H中編譯器指向的部分是
"virtual ~Adafruit_GFX() {};"
在:
#ifndef _ADAFRUIT_GFX_H
#define _ADAFRUIT_GFX_H
#define swap(a, b) { int16_t t = a; a = b; b = t; }
//class Adafruit_GFX : public Print {
class Adafruit_GFX {
public:
//Adafruit_GFX();
// i have no idea why we have to formally call the constructor. kinda sux
void constructor(int16_t w, int16_t h);
virtual ~Adafruit_GFX() {};
// this must be defined by the subclass
virtual void drawPixel(int16_t x, int16_t y, uint16_t color) = 0;
virtual void invertDisplay(boolean i);
奇怪的是我在樹莓派上使用“make”並在作品中,我可以開始這樣它的作品代碼是否正常? 但不是由Visualstudio?
所以我的問題是:由於我是交叉編譯,我可能是編譯器丟失了一些文件或者是否有可以操作以使其工作的選項?
我必須在哪個方向尋找答案?
通過調整(或正確填充設置),我得到了它的工作。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.