C++ in Atmels software package - atmel-software-package-2.15

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

I guys, some of you will remember me posting everywhere about C++ in Atmel Software Package, "atmel-software-package-2.15".

Well!  I got it working...

 

I have yet to full test it but it seems fine.

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

"Dare to be naïve." - Buckminster Fuller

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

Last error appears to do with the final stages of the build.  It fails when it tries to build the binary after linking.  Now I'm no expert on make files but the final stage:

 

$(BUILDDIR)/$(BINNAME).elf: $(OBJS) $(LIBS) $(gnu-debug-lib-y) $(gnu-linker-script-y)
    @cp $(gnu-debug-lib-y) $(BUILDDIR)/target/
    $(ECHO) LINK $@
    $(Q)$(CC) $(LDFLAGS) $(CFLAGS_CPU) $(CFLAGS_DEFS) -T$(gnu-linker-script-y) -Wl,-Map,$(BUILDDIR)/$(BINNAME).map -o $@ $(OBJS) -Wl,--start-group $(LIBS) -Wl,--end-group -Wl,--no-undefined
 

is using the gcc compiler - $(Q)$(CC)

would this cause a problem for the c++ files?

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

Fianawarrior wrote:
when it tries to build the binary after linking
Not sure I follow. The command you then show is not "after linking" but is the actual linking itself?

 

Anyway there is not problem invoking "gcc" for C++. "gcc" is a "compiler driver" not just an invocation of the C compiler. If you pass it a .s file it calls the assembler, if you pass it a .S file it calls the preprocessor then the assembler, if you pass it a .c file it calls the preprocessor then the C compiler, if you pass it a .cpp file (other C++ extensions are also available) then it will invoke the C++ compiler. if you later pass it just .o files then it will invoke the linker.

It's because it can invoke all these different things that because some command line options could be mistaken for assembler/preprocessor/C/C++/linker that you have things like -Wa, and -Wl, which say "here's an option but you should specifically pass it to the a=assembler or l=linker". There's even some examples of that in your command above. It's using -Wl to direct various options specifically to the linker.