help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Makefile error with c++ and C co-mingled code.


From: emp1953
Subject: Makefile error with c++ and C co-mingled code.
Date: Fri, 10 Oct 2008 14:06:36 -0700 (PDT)
User-agent: G2/1.0

I have a make file that has a bunch of .cpp files and ONE .c file.
It gives the following error on the .c file

there is a compiler or linker error. Most of the include header files
are either not found or do not exist.

There as to be a way to co-mingle code here.  There are some header
files that are in the c++ code that have function calls that are
needed by the C code.  Any clues/info will be appreciated

Following is the Makefile:
I am at a loss

CC                      = gcc
CXX                     = g++
CFLAGS          = -c -Wall -g   -DDEBUGGING_ON -DARCHIVE_ALL  -W -I../
include/ -I../msgInclude/ -I../nsiInclude/ -I../mfaInclude/ -I../
fpgaInclude/
CXXFLAGS        = -c -Wall -g   -DDEBUGGING_ON -DARCHIVE_ALL  -
DMULTICAST_EQ36 -W -I../include/ -I../msgInclude/ -I../nsiInclude/ -
I../mfaInclude/ -I../fpgaInclude/ -Wno-deprecated
LDFLAGS         =  -lnsl -lpthread -lccur_fbsched -lccur_rt

OBJDIR          = ../obj
EXEDIR          = ../bin
CDIR                     = ../c_code

PROG            = msg_broker
EXECUTABLE      = $(EXEDIR)/$(PROG)

CXXSOURCES      = gen_summary_status.cpp \
        gen_oct_detailed_status.cpp \
        encode.cpp \
        NSIudp_class.cpp \
        GUIudp_class.cpp \
        socket_class.cpp \
        NSItcp_class.cpp \
        EEudp_class.cpp \
        initialization.cpp \
        tcp_client_class.cpp \
        tcc_controller.cpp \
        tcp_server_class.cpp \
        tcp_socket_class.cpp \
        udp_socket_class.cpp \
        msg_debug_control.cpp \
        reverse_byteorder.cpp \
        decode_temperature.cpp \
        log_trm_readback.cpp \
        log_read_cal_flash_rpt.cpp \
        log_cal_flash_info_rpt.cpp \
        log_summary_status.cpp \
        log_nsi_summary_status.cpp \
        log_prog_summary_status.cpp \
        log_read_fpga_config_rpt.cpp \
        log_fpga_config_dev_info_rpt.cpp \
        log_mfa_common_status.cpp \
        log_mfa_stc_readback_rpt.cpp \
        log_prog_summary_status.cpp \
        log_oct_detailed_status.cpp \
        log_rcm_detailed_status.cpp \
        log_ecs_status.cpp \
        status_generator.cpp \
        a_initialization.cpp \
        debug_print_results.cpp \
        ARRAYudp_class.cpp \
        s_buffer_controller_class.cpp \
        f_table_archive.cpp \
        b_table_archive.cpp \
        retrieve_f_table.cpp \
        retrieve_b_table.cpp \
        decode_element.cpp \
        a_builder.cpp

CSOURCES        = $(CDIR)/tcc_rti.c

CXXOBJECTS      = $(CXXSOURCES:.cpp=.opp)
COBJECTS                = $(CSOURCES:.c=.o)
OBJECTS         = $(CXXOBJECTS) $(COBJECTS)
OBJFILES                = $(addprefix $(OBJDIR)/, $(OBJECTS))

all:  $(EXECUTABLE)

$(EXECUTABLE): $(OBJFILES)
        $(CXX) $(LDFLAGS) $^ -o $@

$(OBJDIR)/%.opp: %.cpp
        $(CXX) $(CXXFLAGS) $< -o $@

$(OBJDIR)/%.o: %.c
        $(CC) $(CFLAGS) $< -o $@

clean:
        -rm -rf $(OBJFILES)
        clear


reply via email to

[Prev in Thread] Current Thread [Next in Thread]