我正在Eclipse中开展一个C项目(我的项目有这些文件:main.c
,XMLdataCatcher.c
,crc.c
和标题crc.h
)
我正确构建了项目,但是当我尝试编译时,我收到了这个错误:
16:55:48 **** Incremental Build of configuration Debug for project final_01 ****
make all
Building file: ../crc.c
Invoking: GCC C Compiler
gcc -I/usr/include/libxml2/libxml -O0 -g3 -Wall -MMD -MP -MF"crc.d" -MT"crc.d" -o "crc.o" "../crc.c" -I/usr/include/libxml2 -lxml2 -lz -lm
/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld devolvió el estado de salida 1
make: *** [crc.o] Error 1
这很奇怪,因为我有一个main()
函数(太大而无法发布,但很简单)
我的makefile是:
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
-include ../makefile.init
RM := rm -rf
# All of the sources participating in the build are defined here
-include sources.mk
-include subdir.mk
-include objects.mk
ifneq ($(MAKECMDGOALS),clean)
ifneq ($(strip $(C_DEPS)),)
-include $(C_DEPS)
endif
endif
-include ../makefile.defs
# Add inputs and outputs from these tool invocations to the build variables
# All Target
all: libfinal_01
# Tool invocations
libfinal_01: $(OBJS) $(USER_OBJS)
@echo 'Building target: $@'
@echo 'Invoking: GCC C Linker'
gcc -nostartfiles -nodefaultlibs -nostdlib -L/usr/include/libxml2/libxml -shared -o "libfinal_01" $(OBJS) $(USER_OBJS) $(LIBS)
@echo 'Finished building target: $@'
@echo ' '
# Other Targets
clean:
-$(RM) $(OBJS)$(C_DEPS)$(LIBRARIES) libfinal_01
-@echo ' '
.PHONY: all clean dependents
.SECONDARY:
-include ../makefile.targets
source.mk :(这很奇怪:S)
################################################################################
# Automatically-generated file. Do not edit!
################################################################################
O_SRCS :=
C_SRCS :=
S_UPPER_SRCS :=
OBJ_SRCS :=
ASM_SRCS :=
OBJS :=
C_DEPS :=
LIBRARIES :=
# Every subdirectory with source files must be described here
SUBDIRS := \
. \
请帮帮我!!
提前致谢。
伊达