Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 3 of 3

Thread: Help with c++ inheritance

  1. #1
    Senior Member
    Join Date
    Jan 2015
    Location
    UK
    Posts
    147

    Help with c++ inheritance

    I'm using Teensy 3.2 and trying to compile the example from this library:

    https://github.com/sarfata/NMEA2000_teensy

    The library uses inheritance from this library:

    https://github.com/ttlappalainen/NMEA2000

    The example code:
    Code:
    #include <NMEA2000.h>
    #include <N2kMessages.h>
    #include <NMEA2000_teensy.h>
    
    tNMEA2000_teensy NMEA2000;
    
    void setup() {
      NMEA2000.open();
    }
    
    void loop() {
    }
    but it won't compile. Its giving me this error:

    nmea2000_test:8: error: 'class tNMEA2000_teensy' has no member named 'open'
    NMEA2000.open();
    ^
    'class tNMEA2000_teensy' has no member named 'open'

    I can see the open() function in NMEA2000.h but somehow it is not inheriting it.

    Any idea how I can fix this ?

  2. #2
    Senior Member blackketter's Avatar
    Join Date
    May 2015
    Location
    San Francisco
    Posts
    314
    Try
    Code:
    Open()
    instead of
    Code:
    open()

  3. #3
    Senior Member
    Join Date
    Jan 2015
    Location
    UK
    Posts
    147
    Wow, with Open() it compiled. That means they have not compiled their example.

    I can now move to the next stage.

    Thank you for your help.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •