C++ setup

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Guys, I'm trying to setup a C++ project in Eclipse but I get the following error:

make: *** No rule to make target '../../examples/getting_started_with_blue/test.c', needed by 'build/sama5d4-xplained/ddram/examples/getting_started_with_blue/test.o'.  Stop.
 

The file is called test.cpp

 

Any advice lads?

 

EDITED: I forgot to mention, I've also added the object file to the makefile:

obj-y += examples/getting_started_with_blue/main.o
obj-y += examples/getting_started_with_blue/test.o

Last Edited: Wed. Jan 22, 2020 - 04:13 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I don't use Eclipse but I've seen this with makefiles.  Somehow you need to specify that test.o is derived from test.cpp not test.c.  I'm not a makefile expert but have used the following to get the thing to compile and link.

 

test.o: test.cpp
        $(CXX) $(CFLAGS0) -c -o $@ test.cpp

C: i = "told you so";

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

cpluscon wrote:

I don't use Eclipse but I've seen this with makefiles.  Somehow you need to specify that test.o is derived from test.cpp not test.c.  I'm not a makefile expert but have used the following to get the thing to compile and link.

 

test.o: test.cpp
        $(CXX) $(CFLAGS0) -c -o $@ test.cpp

 

I was thinking the same thing cplusco.  I opened a help ticket with Microchip.

 

PS: nice name!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Still no joy from Microchip...

I can't see Microchip releasing a software framework and not have it working with C++.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just lurking round the desolated ARM forum.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I installed Eclipse just to look at this.  Now I remember why I don't like Eclipse.  I had used it previously for Android app development, but thankfully Android Studio came along and it is somewhat better.

 

I mean, I tried auto generating a couple of projects and neither compiled.  That's my experience with Eclipse.  Perhaps consider using Atmel Studio?

C: i = "told you so";