|
|
|
|
build/default/production/main.o: In function `main': c:/users/igor/mplabxprojects/testpic32.x/main.cpp:4: multiple definition of `main' build/default/production/main.o:c:/users/igor/mplabxprojects/testpic32.x/main.cpp:4: first defined here build/default/production/interrupt.o: In function `UARThandler': c:/users/igor/mplabxprojects/testpic32.x/interrupt.cpp:10: multiple definition of `ring_buffer' build/default/production/interrupt.o:c:/users/igor/mplabxprojects/testpic32.x/interrupt.cpp:10: first defined here build/default/production/interrupt.o: In function `UARThandler': c:/users/igor/mplabxprojects/testpic32.x/interrupt.cpp:10: multiple definition of `UARThandler' build/default/production/interrupt.o:c:/users/igor/mplabxprojects/testpic32.x/interrupt.cpp:10: first defined here build/default/production/interrupt.o: In function `__vector_dispatch_24': c:/users/igor/mplabxprojects/testpic32.x/interrupt.cpp:(.vector_24+0x0): multiple definition of `__vector_dispatch_24' build/default/production/interrupt.o:c:/users/igor/mplabxprojects/testpic32.x/interrupt.cpp:(.vector_24+0x0): first defined here build/default/production/buffer.o: In function `BufferPut': c:/users/igor/mplabxprojects/testpic32.x/buffer.cpp:5: multiple definition of `ring_buffer' build/default/production/interrupt.o:c:/users/igor/mplabxprojects/testpic32.x/interrupt.cpp:10: first defined here build/default/production/buffer.o: In function `BufferPut': c:/users/igor/mplabxprojects/testpic32.x/buffer.cpp:5: multiple definition of `ring_buffer' build/default/production/interrupt.o:c:/users/igor/mplabxprojects/testpic32.x/interrupt.cpp:10: first defined here build/default/production/buffer.o: In function `BufferPut': c:/users/igor/mplabxprojects/testpic32.x/buffer.cpp:5: multiple definition of `BufferPut' build/default/production/buffer.o:c:/users/igor/mplabxprojects/testpic32.x/buffer.cpp:5: first defined here build/default/production/buffer.o: In function `modulo_inc': c:/users/igor/mplabxprojects/testpic32.x/buffer.cpp:18: multiple definition of `modulo_inc' build/default/production/buffer.o:c:/users/igor/mplabxprojects/testpic32.x/buffer.cpp:18: first defined here c:\program files\microchip\xc32\v1.32\bin\bin\gcc\pic32mx\4.5.2\..\..\..\..\bin/xc32-ld.exe: Link terminated due to previous error(s). collect2: ld returned 255 exit status make[2]: *** [dist/default/production/testpic32.X.production.hex] Error 255 make[1]: *** [.build-conf] Error 2 make: *** [.build-impl] Error 2 make[2]: Leaving directory `C:/Users/Igor/MPLABXProjects/testpic32.X' make[1]: Leaving directory `C:/Users/Igor/MPLABXProjects/testpic32.X' BUILD FAILED (exit value 2, total time: 1s) |
struct Buff ring_buffer;
multiple definition of `ring_buffer' |
# # Generated Makefile - do not edit! # # Edit the Makefile in the project folder instead (../Makefile). Each target # has a -pre and a -post target defined where you can add customized code. # # This makefile implements configuration specific macros and targets. # Include project Makefile ifeq "${IGNORE_LOCAL}" "TRUE" # do not include local makefile. User is passing all local related variables already else include Makefile # Include makefile containing local settings ifeq "$(wildcard nbproject/Makefile-local-default.mk)" "nbproject/Makefile-local-default.mk" include nbproject/Makefile-local-default.mk endif endif # Environment MKDIR=gnumkdir -p RM=rm -f MV=mv CP=cp # Macros CND_CONF=default ifeq ($(TYPE_IMAGE), DEBUG_RUN) IMAGE_TYPE=debug OUTPUT_SUFFIX=elf DEBUGGABLE_SUFFIX=elf FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/testpic32.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} else IMAGE_TYPE=production OUTPUT_SUFFIX=hex DEBUGGABLE_SUFFIX=elf FINAL_IMAGE=dist/${CND_CONF}/${IMAGE_TYPE}/testpic32.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} endif # Object Directory OBJECTDIR=build/${CND_CONF}/${IMAGE_TYPE} # Distribution Directory DISTDIR=dist/${CND_CONF}/${IMAGE_TYPE} # Source Files Quoted if spaced SOURCEFILES_QUOTED_IF_SPACED=main.cpp main.c interrupt.cpp interrupt.c buffer.c buffer.cpp # Object Files Quoted if spaced OBJECTFILES_QUOTED_IF_SPACED=${OBJECTDIR}/main.o ${OBJECTDIR}/main.o ${OBJECTDIR}/interrupt.o ${OBJECTDIR}/interrupt.o ${OBJECTDIR}/buffer.o ${OBJECTDIR}/buffer.o POSSIBLE_DEPFILES=${OBJECTDIR}/main.o.d ${OBJECTDIR}/main.o.d ${OBJECTDIR}/interrupt.o.d ${OBJECTDIR}/interrupt.o.d ${OBJECTDIR}/buffer.o.d ${OBJECTDIR}/buffer.o.d # Object Files OBJECTFILES=${OBJECTDIR}/main.o ${OBJECTDIR}/main.o ${OBJECTDIR}/interrupt.o ${OBJECTDIR}/interrupt.o ${OBJECTDIR}/buffer.o ${OBJECTDIR}/buffer.o # Source Files SOURCEFILES=main.cpp main.c interrupt.cpp interrupt.c buffer.c buffer.cpp CFLAGS= ASFLAGS= LDLIBSOPTIONS= ############# Tool locations ########################################## # If you copy a project from one host to another, the path where the # # compiler is installed may be different. # # If you open this project with MPLAB X in the new host, this # # makefile will be regenerated and the paths will be corrected. # ####################################################################### # fixDeps replaces a bunch of sed/cat/printf statements that slow down the build FIXDEPS=fixDeps .build-conf: ${BUILD_SUBPROJECTS} ${MAKE} ${MAKE_OPTIONS} -f nbproject/Makefile-default.mk dist/${CND_CONF}/${IMAGE_TYPE}/testpic32.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} MP_PROCESSOR_OPTION=32MX575F512H MP_LINKER_FILE_OPTION= # ------------------------------------------------------------------------------------ # Rules for buildStep: assemble ifeq ($(TYPE_IMAGE), DEBUG_RUN) else endif # ------------------------------------------------------------------------------------ # Rules for buildStep: assembleWithPreprocess ifeq ($(TYPE_IMAGE), DEBUG_RUN) else endif # ------------------------------------------------------------------------------------ # Rules for buildStep: compile ifeq ($(TYPE_IMAGE), DEBUG_RUN) ${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/main.o.d @${RM} ${OBJECTDIR}/main.o @${FIXDEPS} "${OBJECTDIR}/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.c ${OBJECTDIR}/interrupt.o: interrupt.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/interrupt.o.d @${RM} ${OBJECTDIR}/interrupt.o @${FIXDEPS} "${OBJECTDIR}/interrupt.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/interrupt.o.d" -o ${OBJECTDIR}/interrupt.o interrupt.c ${OBJECTDIR}/buffer.o: buffer.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/buffer.o.d @${RM} ${OBJECTDIR}/buffer.o @${FIXDEPS} "${OBJECTDIR}/buffer.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/buffer.o.d" -o ${OBJECTDIR}/buffer.o buffer.c else ${OBJECTDIR}/main.o: main.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/main.o.d @${RM} ${OBJECTDIR}/main.o @${FIXDEPS} "${OBJECTDIR}/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.c ${OBJECTDIR}/interrupt.o: interrupt.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/interrupt.o.d @${RM} ${OBJECTDIR}/interrupt.o @${FIXDEPS} "${OBJECTDIR}/interrupt.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/interrupt.o.d" -o ${OBJECTDIR}/interrupt.o interrupt.c ${OBJECTDIR}/buffer.o: buffer.c nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/buffer.o.d @${RM} ${OBJECTDIR}/buffer.o @${FIXDEPS} "${OBJECTDIR}/buffer.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -x c -c -mprocessor=$(MP_PROCESSOR_OPTION) -MMD -MF "${OBJECTDIR}/buffer.o.d" -o ${OBJECTDIR}/buffer.o buffer.c endif |
# ------------------------------------------------------------------------------------ # Rules for buildStep: compileCPP ifeq ($(TYPE_IMAGE), DEBUG_RUN) ${OBJECTDIR}/main.o: main.cpp nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/main.o.d @${RM} ${OBJECTDIR}/main.o @${FIXDEPS} "${OBJECTDIR}/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c++ -c -mprocessor=$(MP_PROCESSOR_OPTION) -frtti -fexceptions -fno-check-new -fenforce-eh-specs -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.cpp ${OBJECTDIR}/interrupt.o: interrupt.cpp nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/interrupt.o.d @${RM} ${OBJECTDIR}/interrupt.o @${FIXDEPS} "${OBJECTDIR}/interrupt.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c++ -c -mprocessor=$(MP_PROCESSOR_OPTION) -frtti -fexceptions -fno-check-new -fenforce-eh-specs -MMD -MF "${OBJECTDIR}/interrupt.o.d" -o ${OBJECTDIR}/interrupt.o interrupt.cpp ${OBJECTDIR}/buffer.o: buffer.cpp nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/buffer.o.d @${RM} ${OBJECTDIR}/buffer.o @${FIXDEPS} "${OBJECTDIR}/buffer.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -D__DEBUG -D__MPLAB_DEBUGGER_PK3=1 -fframe-base-loclist -x c++ -c -mprocessor=$(MP_PROCESSOR_OPTION) -frtti -fexceptions -fno-check-new -fenforce-eh-specs -MMD -MF "${OBJECTDIR}/buffer.o.d" -o ${OBJECTDIR}/buffer.o buffer.cpp else ${OBJECTDIR}/main.o: main.cpp nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/main.o.d @${RM} ${OBJECTDIR}/main.o @${FIXDEPS} "${OBJECTDIR}/main.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -x c++ -c -mprocessor=$(MP_PROCESSOR_OPTION) -frtti -fexceptions -fno-check-new -fenforce-eh-specs -MMD -MF "${OBJECTDIR}/main.o.d" -o ${OBJECTDIR}/main.o main.cpp ${OBJECTDIR}/interrupt.o: interrupt.cpp nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/interrupt.o.d @${RM} ${OBJECTDIR}/interrupt.o @${FIXDEPS} "${OBJECTDIR}/interrupt.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -x c++ -c -mprocessor=$(MP_PROCESSOR_OPTION) -frtti -fexceptions -fno-check-new -fenforce-eh-specs -MMD -MF "${OBJECTDIR}/interrupt.o.d" -o ${OBJECTDIR}/interrupt.o interrupt.cpp ${OBJECTDIR}/buffer.o: buffer.cpp nbproject/Makefile-${CND_CONF}.mk @${MKDIR} ${OBJECTDIR} @${RM} ${OBJECTDIR}/buffer.o.d @${RM} ${OBJECTDIR}/buffer.o @${FIXDEPS} "${OBJECTDIR}/buffer.o.d" $(SILENT) -rsi ${MP_CC_DIR}../ -c ${MP_CPPC} $(MP_EXTRA_CC_PRE) -g -x c++ -c -mprocessor=$(MP_PROCESSOR_OPTION) -frtti -fexceptions -fno-check-new -fenforce-eh-specs -MMD -MF "${OBJECTDIR}/buffer.o.d" -o ${OBJECTDIR}/buffer.o buffer.cpp endif # ------------------------------------------------------------------------------------ # Rules for buildStep: link ifeq ($(TYPE_IMAGE), DEBUG_RUN) dist/${CND_CONF}/${IMAGE_TYPE}/testpic32.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} ${MP_CPPC} $(MP_EXTRA_LD_PRE) -mdebugger -D__MPLAB_DEBUGGER_PK3=1 -mprocessor=$(MP_PROCESSOR_OPTION) -o dist/${CND_CONF}/${IMAGE_TYPE}/testpic32.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -mreserve=data@0x0:0x1FC -mreserve=boot@0x1FC02000:0x1FC02FEF -mreserve=boot@0x1FC02000:0x1FC024FF -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),--defsym=__MPLAB_DEBUG=1,--defsym=__DEBUG=1,--defsym=__MPLAB_DEBUGGER_PK3=1,-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map" else dist/${CND_CONF}/${IMAGE_TYPE}/testpic32.X.${IMAGE_TYPE}.${OUTPUT_SUFFIX}: ${OBJECTFILES} nbproject/Makefile-${CND_CONF}.mk @${MKDIR} dist/${CND_CONF}/${IMAGE_TYPE} ${MP_CPPC} $(MP_EXTRA_LD_PRE) -mprocessor=$(MP_PROCESSOR_OPTION) -o dist/${CND_CONF}/${IMAGE_TYPE}/testpic32.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} ${OBJECTFILES_QUOTED_IF_SPACED} -Wl,--defsym=__MPLAB_BUILD=1$(MP_EXTRA_LD_POST)$(MP_LINKER_FILE_OPTION),-Map="${DISTDIR}/${PROJECTNAME}.${IMAGE_TYPE}.map" ${MP_CC_DIR}\\xc32-bin2hex dist/${CND_CONF}/${IMAGE_TYPE}/testpic32.X.${IMAGE_TYPE}.${DEBUGGABLE_SUFFIX} endif # Subprojects .build-subprojects: # Subprojects .clean-subprojects: # Clean Targets .clean-conf: ${CLEAN_SUBPROJECTS} ${RM} -r build/default ${RM} -r dist/default # Enable dependency checking .dep.inc: .depcheck-impl DEPFILES=$(shell mplabwildcard ${POSSIBLE_DEPFILES}) ifneq (${DEPFILES},) include ${DEPFILES} endif |
main
function, even. Move all other source files away and try compiling again, it sounds like you're compiling two projects as if they're one.
|
|
|
|
struct my_struct things_to_store;
extern struct my_struct things_to_store;
struct foo;
|
|
|
|