在VisualStudio中試圖通過交叉編譯的樹莓派,我得到以下錯誤:未定義refence爲「虛函數表的Adafruit_GFX」由於交叉編譯樹莓派
VisualGDB: Run "make CONFIG=Debug" in directory "/tmp/VisualGDB/c/Users/Revius/Desktop/usbtest/conversiecsc++/LinuxProject12/LinuxProject12" on [email protected] (SSH)
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: In function `Adafruit_GFX::~Adafruit_GFX()':
C:\Users\Revius\AppData\Local\VisualGDB\RemoteSourceCache\raspberrypi\0003\include\Adafruit_GFX.h(35): error VGDB1000: undefined reference to `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);
怪異的是,我用 「做」在樹莓派和作品中,我可以開始,所以它的作品代碼是好的?但不是由Visualstudio?
所以我的問題是: 由於我交叉compilling我可以編譯器是缺少一些文件或有選擇我可以操縱它來工作?
在哪個方向我必須尋找答案?
您是否在'invertDisplay'的基類中提供了一個定義? – user657267
是的。然而,你在這裏看到的代碼部分要大得多,所以可能會有更多的定義不被使用。但代碼適用於覆盆子pi。他們使用相同的「交叉編譯器」。可以有一些設置可以調整嗎? – Plumbum7