• AVR Freaks

Hot!How to compile ?

Author
DeltaElectronics
Starting Member
  • Total Posts : 53
  • Reward points : 0
  • Joined: 2016/06/24 07:25:46
  • Location: 0
  • Status: offline
2019/08/25 02:34:05 (permalink)
0

How to compile ?

Hello to everybody,
 
In compliing a project, I got the following error at compilation time:
 
No rule to make target 'build/default/production/myClass.o', needed by 'dist/default/production/classe.X.production.hex'.

The project is quite simple, just is a test experiencing c++ and OOP paradigma in XC8 programming; the main program is:
 

#include <xc.h>
#include "myClass.h"
#include "config.h"

void main(void) {
    myClass classe;
    classe.donaldDuck();
}

 
and the file myClass.h
 

class myClass {
myClass();
void goofy();
void donaldDuck();
void mickeMouse();
};

 
file myClass.cpp contains only empty implementations of such methods.
 
Attached the screenshot with compilation error

Attached Image(s)

#1

14 Replies Related Threads

    NKurzman
    A Guy on the Net
    • Total Posts : 17719
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 02:40:33 (permalink)
    +1 (1)
    XC8 is a C compiler NOT a C++ compiler.
    The error message means you have no tool installed to handle a file with a .Cpp extension.
    To answer your next question, no they do not have one for it. There is one for PIC32. And Atmel
    #2
    ric
    Super Member
    • Total Posts : 23581
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: How to compile ? 2019/08/25 02:53:33 (permalink)
    +3 (3)
    It's only two months since you were last told that XC8 is not a C++ compiler.
    https://www.microchip.com/forums/m1102472.aspx
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #3
    DeltaElectronics
    Starting Member
    • Total Posts : 53
    • Reward points : 0
    • Joined: 2016/06/24 07:25:46
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 02:53:42 (permalink)
    -1 (1)
    The error message means you have no tool installed to handle a file with a .Cpp extension

    Do you know if is there one for XC8 ?
    #4
    ric
    Super Member
    • Total Posts : 23581
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: How to compile ? 2019/08/25 02:56:08 (permalink)
    +3 (3)
    DeltaElectronics
    The error message means you have no tool installed to handle a file with a .Cpp extension

    Do you know if is there one for XC8 ?

    Neil already answered that too, assuming you would ask it.
    Again, you were told all this two months ago.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    DeltaElectronics
    Starting Member
    • Total Posts : 53
    • Reward points : 0
    • Joined: 2016/06/24 07:25:46
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 02:58:28 (permalink)
    0
    Ric
    I still remember, and congratulations for your memory...
    I know I previuosly asked it; but then I noticed that MPLAB supports the possibility to create .cpp files; so I thought there was a way to use OOP.
    BTW, do you know a OOP 8 bit C compiler for PIC ?
    #6
    ric
    Super Member
    • Total Posts : 23581
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: How to compile ? 2019/08/25 02:59:55 (permalink)
    +2 (2)
    DeltaElectronics
    BTW, do you know a OOP 8 bit C compiler for PIC ?

    No I don't or I would have mentioned it.
    I do agree with all the previous advice that it is silly to want to do OOP on an 8 bit PIC anyway.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #7
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3233
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 03:01:03 (permalink)
    0
    C++ is not supported on this platform.

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #8
    ric
    Super Member
    • Total Posts : 23581
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: How to compile ? 2019/08/25 03:05:58 (permalink)
    +1 (1)
    DeltaElectronics
    I know I previuosly asked it; but then I noticed that MPLAB supports the possibility to create .cpp files; so I thought there was a way to use OOP.

    So you ignored all the previous advice for one spurious reason.
    You were also told that XC32 does support CPP, which is also supported by MPLABX.
    I bit less wishful thinking would serve you well.
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #9
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3233
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 03:10:27 (permalink)
    0
    Do you even know what OOP is?

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #10
    DeltaElectronics
    Starting Member
    • Total Posts : 53
    • Reward points : 0
    • Joined: 2016/06/24 07:25:46
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 03:35:38 (permalink)
    0
    Anyway, it seems that Atmel studio supports OOP, right ?
    #11
    andersm
    Super Member
    • Total Posts : 2637
    • Reward points : 0
    • Joined: 2012/10/07 14:57:44
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 03:43:37 (permalink)
    0
    There is at least one company who makes a C++ compiler targeting 8-bit PICs: http://www.sourceboost.com/
    I know nothing about their product beyond that it exists.
    #12
    NKurzman
    A Guy on the Net
    • Total Posts : 17719
    • Reward points : 0
    • Joined: 2008/01/16 19:33:48
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 09:01:48 (permalink)
    0
    Yes the Atmel ARM can be programmed in C++. I think their 8 bit CPU too.
    #13
    Jan Audio
    Starting Member
    • Total Posts : 80
    • Reward points : 0
    • Joined: 2018/09/24 08:12:24
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 09:09:32 (permalink)
    0
    Use struct;
    #14
    Gort2015
    Klaatu Barada Nikto
    • Total Posts : 3233
    • Reward points : 0
    • Joined: 2015/04/30 10:49:57
    • Location: 0
    • Status: offline
    Re: How to compile ? 2019/08/25 14:28:19 (permalink)
    0
    Use, "struct"
     
    For what?
     

    MPLab X playing up, bug in your code? Nevermind, Star Trek:Discovery will be with us soon.
    https://www.youtube.com/watch?v=Iu1qa8N2ID0
    + ST:Continues, "What Ships are Made for", Q's back.
    #15
    Jump to:
    © 2019 APG vNext Commercial Version 4.5