对于Adafruit_GFX'未定义的反对意见。由于交叉编译树莓派

时间:2016-05-14 20:33:22

标签: c++ linux makefile raspberry-pi

在Visualstudio中尝试交叉编译为覆盆子pi,我收到以下错误:

  

VisualGDB:运行" make CONFIG = Debug"在目录" / tmp / VisualGDB / c / Users / Revius / Desktop / usbtest / conversiecsc ++ / LinuxProject12 / LinuxProject12"在pi @ raspberrypi(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 =&# 39,$ ORIGIN' -Wl, - 端基   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?

所以我的问题是: 由于我是交叉编译我可能是编译器丢失了一些文件或者是否有可以操作以使其工作的选项?

我必须在哪个方向寻找答案?

1 个答案:

答案 0 :(得分:0)

Setting for the Makefile in MSVS-GDB for oled display

通过调整(或正确填充te设置),我得到了它。