Tengo los codigos fuentes de un programa en C, cuyo makefile esta configurado para compilarse con gcc, necesito hacer que este programa me compile usando g++ (He ledido que g++ compila c normal), necesito hacer esto porque debo integrar este programa a otro desarrollado con c++ (y compilado con g++)
intente hacer lo trivial de reemplazar g++ por gcc en el makefile pero saca muchos errores.
Aqui pongo aspectos (esta cortado para cumplir el limite de caracteres del mensaje) importante del makefile original del programa (Con el que compila perfecto)
Código:
INC=include SRC=src OBJ=obj PLATFORM= $(shell echo `uname`) # Defaults CC=gcc CFLAGS=-I$(INC) -O3 LDFLAGS=-lm # Linux ifeq ($(PLATFORM), Linux) CC=gcc CFLAGS=-I$(INC) -O3 -mcpu=pentiumpro -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE LDFLAGS=-lm -L/usr/lib endif # Mac ifeq ($(PLATFORM), Darwin) CC=gcc CFLAGS=-I$(INC) -pipe -O2 -no-cpp-precomp -Wno-long-double LDFLAGS=-lm endif # Sun ifeq ($(PLATFORM), SunOS) CC=gcc CFLAGS=-I$(INC) -O2 LDFLAGS=-lm endif #Debug #CFLAGS=-I$(INC) -g OBJFILES= $(OBJ)/alignments.o $(OBJ)/bytepackGappedScoring.o $(OBJ)/descriptions.o $(OBJ)/encoding.o $(OBJ)/fasterGappedExtension.o $(OBJ)/gappedExtension.o $(OBJ)/gappedScoring.o $(OBJ)/nuGappedScoring.o $(OBJ)/writedb.o $(OBJ)/readdb.o $(OBJ)/search.o $(OBJ)/wildcards.o $(OBJ)/dust.o $(OBJ)/seg.o HEADERFILES= $(INC)/alignments.h $(INC)/blast.h $(INC)/bytepackGappedScoring.h $(INC)/descriptions.h $(INC)/encoding.h $(INC)/writedb.h $(INC)/readdb.h $(INC)/search.h $(INC)/wildcards.h $(INC)/dust.h $(INC)/seg.h SRCFILES= $(SRC)/alignments.c $(SRC)/blast.c $(SRC)/bytepackGappedScoring.c $(SRC)/descriptions.c $(SRC)/encoding.c $(SRC)/fasterGappedExtension.c $(SRC)/gappedExtension.c $(SRC)/gappedScoring.c $(SRC)/nuGappedScoring.c $(SRC)/unpack.c $(SRC)/index.c $(SRC)/postings.c $(SRC)/hashcounter.c $(SRC)/writedb.c $(SRC)/readdb.c $(SRC)/search.c $(SRC)/wildcards.c $(SRC)/dust.c $(SRC)/seg.c all: blast formatdb readdb ssearch cluster blast: $(OBJ)/blast.o $(OBJFILES) $(CC) $(CFLAGS) $(LDFLAGS) -o blast $(OBJ)/blast.o $(OBJFILES) $(OBJ)/chooseWilds.o: $(SRC)/chooseWilds.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/chooseWilds.o $(SRC)/chooseWilds.c $(OBJ)/readdbApp.o: $(SRC)/readdbApp.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/readdbApp.o $(SRC)/readdbApp.c $(OBJ)/dustApp.o: $(SRC)/dustApp.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/dustApp.o $(SRC)/dustApp.c $(OBJ)/printDescription.o: $(SRC)/printDescription.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/printDescription.o $(SRC)/printDescription.c $(OBJ)/formatdb.o: $(SRC)/formatdb.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/formatdb.o $(SRC)/formatdb.c $(OBJ)/createindex.o: $(SRC)/createindex.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/createindex.o $(SRC)/createindex.c $(OBJ)/blast.o: $(SRC)/blast.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/blast.o $(SRC)/blast.c $(OBJ)/cluster.o: $(SRC)/cluster.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/cluster.o $(SRC)/cluster.c $(OBJ)/rsdb.o: $(SRC)/rsdb.c $(SRC)/identityAlign.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/rsdb.o $(SRC)/rsdb.c $(OBJ)/readNcbidb.o: $(SRC)/readNcbidb.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/readNcbidb.o $(SRC)/readNcbidb.c $(OBJ)/alignments.o: $(SRC)/alignments.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/alignments.o $(SRC)/alignments.c $(OBJ)/bytepackGappedScoring.o: $(SRC)/bytepackGappedScoring.c $(SRC)/fasterBytepackGappedScoring.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/bytepackGappedScoring.o $(SRC)/bytepackGappedScoring.c $(OBJ)/constants.o: $(SRC)/constants.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/constants.o $(SRC)/constants.c $(OBJ)/descriptions.o: $(SRC)/descriptions.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/descriptions.o $(SRC)/descriptions.c $(OBJ)/encoding.o: $(SRC)/encoding.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/encoding.o $(SRC)/encoding.c $(OBJ)/gappedExtension.o: $(SRC)/gappedExtension.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/gappedExtension.o $(SRC)/gappedExtension.c $(OBJ)/fasterGappedExtension.o: $(SRC)/fasterGappedExtension.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/fasterGappedExtension.o $(SRC)/fasterGappedExtension.c $(OBJ)/gappedScoring.o: $(SRC)/gappedScoring.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/gappedScoring.o $(SRC)/gappedScoring.c $(OBJ)/nuGappedScoring.o: $(SRC)/nuGappedScoring.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/nuGappedScoring.o $(SRC)/nuGappedScoring.c $(OBJ)/global.o: $(SRC)/global.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/global.o $(SRC)/global.c $(OBJ)/hitMatrix.o: $(SRC)/hitMatrix.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/hitMatrix.o $(SRC)/hitMatrix.c $(OBJ)/dust.o: $(SRC)/dust.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/dust.o $(SRC)/dust.c $(OBJ)/seg.o: $(SRC)/seg.c $(HEADERFILES) $(CC) $(CFLAGS) -c -o $(OBJ)/seg.o $(SRC)/seg.c clean: rm -f blast blast-debug blast1 blast12 blast123 ssearch formatdb dust printDescription readdb verboseBlast $(OBJ)/* cluster rsdb chooseWilds createindex readNcbidb simpleCluster
El error obtenido usando reemplazando gcc por g++ es el siguiente:
Código:
Existe algun parametro que se le pueda pasar al g++ para que tenga compactibilidad completa con gcc?++ -Iinclude -O3 -mcpu=pentiumpro -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -c -o obj/blast.o src/blast.c `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead. `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead. src/blast.c: In function ‘void blast_search(char*, PSSMatrix, char*)’: src/blast.c:201: aviso: convirtiendo a ‘int32_t’ desde ‘double’ src/blast.c:210: aviso: convirtiendo a ‘int32_t’ desde ‘double’ src/blast.c:211: aviso: convirtiendo a ‘int32_t’ desde ‘double’ g++ -Iinclude -O3 -mcpu=pentiumpro -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -c -o obj/alignments.o src/alignments.c `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead. `-mcpu=' is deprecated. Use `-mtune=' or '-march=' instead. include/unpack.h: In function ‘void alignments_initialize()’: include/unpack.h:5: error: demasiados argumentos para function ‘void unpack_initialize()’ src/alignments.c:33: error: en este punto en el fichero src/alignments.c: In function ‘void alignments_addGoodAlignment(int32_t, alignment*)’: src/alignments.c:424: error: conversión inválida de ‘void*’ a ‘finalAlignment*’ src/alignments.c: In function ‘void alignments_addFinalAlignment(int32_t, alignment*)’: src/alignments.c:438: error: conversión inválida de ‘void*’ a ‘finalAlignment*’ src/alignments.c: In function ‘void alignments_getFinalAlignmentDescriptions()’: src/alignments.c:622: error: conversión inválida de ‘void*’ a ‘finalAlignment*’ src/alignments.c: In function ‘void alignments_printFinalAlignments()’: src/alignments.c:643: error: conversión inválida de ‘void*’ a ‘finalAlignment*’ include/memBlocks.h:37: aviso: se usa la función inline ‘void* memBlocks_getCurrent(memBlocks*)’ pero nunca se definió include/memSingleBlock.h:34: aviso: se usa la función inline ‘void* memSingleBlock_getLastEntry(memSingleBlock*)’ pero nunca se definió make: *** [obj/alignments.o] Error 1
Agradezco cualquier ayuda