Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » Arduino 3.0 Plugin - corrupted makefiles?(Arduino 3.0 plugin appears to be creating corrupted makefile (double entries))
Arduino 3.0 Plugin - corrupted makefiles? [message #1778526] Fri, 15 December 2017 17:21 Go to next message
Ralph Roland is currently offline Ralph RolandFriend
Messages: 2
Registered: December 2017
Junior Member
Hi, I'm trying to migrate my Arduino development over to Eclipse using the Eclipse C++ IDE for Arduino 3.0 plugin. However, I'm running into issues with the auto-generated makefile (project/build/Arduino Mega/Makefile) ending up with multiple references to the same .o file in the PROJECT_OBJS variable (note the double reference to project/fdc/FD1771.cpp.o in the snip from the Makefile):

PROJECT_OBJS = \
	project/TRS80Floppy.cpp.o \
	project/fdc/FD1771.cpp.o \
	project/gui/Encoder.cpp.o \
	project/gui/Screen.cpp.o \
	project/gui/UIMgr.cpp.o \
	project/gui/UIPageDir.cpp.o \
	project/gui/UIPageMain.cpp.o \
	project/gui/UIPageMsg.cpp.o \
	project/sdcard/SDHelper.cpp.o \
	project/util/BitUtils.cpp.o \
	project/util/Debug.cpp.o \
	project/fdc/FD1771.cpp.o \


The make file also contains two 'recipes' for FD1771.cpp.o:
project/fdc/FD1771.cpp.o: ../../fdc/FD1771.cpp project/fdc/FD1771.cpp.d
	@$(call mymkdir,$(dir $@))
	"C:/Users/admin/.arduinocdt/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10608 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   -I"C:/Users/admin/.arduinocdt/packages/arduino/hardware/avr/1.6.20/cores/arduino" -I"C:/Users/admin/.arduinocdt/packages/arduino/hardware/avr/1.6.20/variants/mega" -I"C:/Users/admin/.arduinocdt/libraries/EnableInterrupt/0.9.8" -I"C:/Users/admin/.arduinocdt/libraries/EnableInterrupt/0.9.8/utility" -I"C:/Users/admin/.arduinocdt/libraries/Bounce2/2.3.0" -I"C:/Users/admin/.arduinocdt/packages/arduino/hardware/avr/1.6.20/libraries/SPI/src" -I"C:/Users/admin/.arduinocdt/packages/arduino/hardware/avr/1.6.20/libraries/Wire/src" -I"C:/Users/admin/.arduinocdt/libraries/U8g2/2.19.8/src" -I"C:/Users/admin/.arduinocdt/libraries/SdFat/1.0.3/src" "$<" -o "$@"

project/fdc/FD1771.cpp.d: ;

-include project/fdc/FD1771.cpp.d 


and:
project/fdc/FD1771.cpp.o: ../../fdc/FD1771.cpp project/fdc/FD1771.cpp.d
	@$(call mymkdir,$(dir $@))
	"C:/Users/admin/.arduinocdt/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega2560 -DF_CPU=16000000L -DARDUINO=10608 -DARDUINO_AVR_MEGA2560 -DARDUINO_ARCH_AVR   -I"C:/Users/admin/.arduinocdt/packages/arduino/hardware/avr/1.6.20/cores/arduino" -I"C:/Users/admin/.arduinocdt/packages/arduino/hardware/avr/1.6.20/variants/mega" -I"C:/Users/admin/.arduinocdt/libraries/EnableInterrupt/0.9.8" -I"C:/Users/admin/.arduinocdt/libraries/EnableInterrupt/0.9.8/utility" -I"C:/Users/admin/.arduinocdt/libraries/Bounce2/2.3.0" -I"C:/Users/admin/.arduinocdt/packages/arduino/hardware/avr/1.6.20/libraries/SPI/src" -I"C:/Users/admin/.arduinocdt/packages/arduino/hardware/avr/1.6.20/libraries/Wire/src" -I"C:/Users/admin/.arduinocdt/libraries/U8g2/2.19.8/src" -I"C:/Users/admin/.arduinocdt/libraries/SdFat/1.0.3/src" "$<" -o "$@"

project/fdc/FD1771.cpp.d: ;

-include project/fdc/FD1771.cpp.d 


The real problems seems to occur with this like though:
TRS80Floppy.elf: $(PROJECT_OBJS) $(LIBRARIES_OBJS) core.a
	"C:/Users/admin/.arduinocdt/packages/arduino/tools/avr-gcc/4.9.2-atmel3.5.4-arduino2/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega2560  -o "./TRS80Floppy.elf" $(PROJECT_OBJS) $(LIBRARIES_OBJS) "./core.a" "-L." -lm


PROJECT_OBJS is used, and results in the FD1771 obj being included twice and results is "multiple definition" errors for everything declared in FD1771.cpp...

I'm running Eclipse C++ Oxygen.1a Release (4.7.1a) Build id: 20171005-1200 with the Eclipse C++ IDE for Arduino 3.0 installed from the Eclipse Marketplace.

I have quite a bit of experience running Eclipse for Java, but this is my first time using the C++ variant. One thing I have noticed, that may be of significance, is that my install appears to be "missing" a lot of the Project Properties under "C/C++ General" that are mentioned in other posts...

Hopefully this is just something I can tweak, because in general I'm finding the Eclipse environment SO much better for the actual creation of the code, but if it gets confused and starts refusing to build then that's kinda a show-stopper...

Thanks for any help!
Re: Arduino 3.0 Plugin - corrupted makefiles? [message #1778569 is a reply to message #1778526] Mon, 18 December 2017 03:06 Go to previous messageGo to next message
Doug Schaefer is currently offline Doug SchaeferFriend
Messages: 135
Registered: July 2009
Senior Member
That is very strange. I'm not sure how this could happen. Please raise a bug and I'll take a look.
Re: Arduino 3.0 Plugin - corrupted makefiles? [message #1778626 is a reply to message #1778569] Tue, 19 December 2017 02:13 Go to previous message
Ralph Roland is currently offline Ralph RolandFriend
Messages: 2
Registered: December 2017
Junior Member
Bug created (Bug 528928).

I found I could easily duplicate this with a new project, by simply adding a new source directory, putting a class in it and including/referencing that class from the main program file.

I've also discovered that if I simply add a new folder (not a "source folder") that it builds the makefile correctly. So at least that seems to be a work-around...
Previous Topic:Eclipse Build
Next Topic:Smart pointer support
Goto Forum:
  


Current Time: Fri Mar 29 13:26:45 GMT 2024

Powered by FUDForum. Page generated in 0.05670 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top