Error: "Undefined error to"

Discussion in 'Arduino IDE' started by wertiti, May 5, 2017.

  1. wertiti

    wertiti New Member

    Joined:
    Mar 28, 2017
    Messages:
    2
    Likes Received:
    0
    Hi,
    I try to create Arduino library for UDOO but I've an issue during compilation. Indeed, I suceed to compile my program by selecting classic Arduino board like "Arduino MEGA" but when I select "UDOO Neo (Cortex M4)" in Arduino IDE, I've the following error :

    Code:
    C:\Users\Ivan\AppData\Local\Temp\arduino_build_724166\sketch\UDOO_test.ino.cpp.o: In function `setup':
    
    C:\Users\Ivan\Documents\Arduino\UDOO_test/UDOO_test.ino:9: undefined reference to `OICom'
    
    collect2.exe: error: ld returned 1 exit status
    
    exit status 1
    Erreur de compilation pour la carte UDOO Neo (Cortex M4)
    
    I did some testing with very simple program splited into 3 files and I've the same error:
    .Ino file :
    Code:
    #include <OICom.h>
    
    
    void setup() {
    
    
    OIcomLib.test();
    
    OICom.begin();
    
    }
    
    void loop() {
    
    }
    
    
    .cpp file

    Code:
    #include "OICom.h"
    
    
    void OIComLib::test()
    {
     
    
    }
    
    
    
    .h file

    Code:
    // OICom.h
    
    #ifndef _OICOM_h
    #define _OICOM_h
    
    #if defined(ARDUINO) && ARDUINO >= 100
        #include "arduino.h"
    #else
        #include "WProgram.h"
    #endif
    
    
    
    class OIComLib
    {
    
    public:
    
        void test();
    
    
    };
    
    extern OIComLib OICom;
    
    
    
    
    
    #endif
    
    When I write this program in one file (in .ino file), I suceed to compile.

    Thank for your help
     

Share This Page