This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Is there a solution to compiling a series of C files without the main function into executable files using the compilation chain of ti arm clang?
As shown in the following figure, an error will now be reported with no main function definition.
The makefile is as follows:
SRC = $(wildcard ../*.c ../interface/*.c) LIB = $(wildcard ../lib/*.a) OBJ = $(notdir $(patsubst %.c, %.o, $(SRC))) CC = tiarmclang LD = tiarmclang OBJDUMP = tiarmobjdump OBJCOPY = tiarmobjcopy ALL:task.hex $(OBJ): $(SRC) @echo $(SRC) @echo $(OBJ) $(CC) -c $(SRC) -mthumb -mcpu=cortex-r5 -mlittle-endian -mfloat-abi=hard -mfpu=vfpv3-d16 -specs=nosys.specs task.out:$(OBJ) $(LD) $(OBJ) $(LIB) -o task.out -l../interface/lnkme.cmd -nostartfiles task.hex:task.out $(OBJDUMP) -D -S task.out >> taskdump.txt $(OBJCOPY) -O binary task.out task.hex clean: del $(OBJ) task.out task.hex task.out taskdump.txt .PHONY:clean ALL
Hi Cheng,
To build an executable from C files, you will need a main function. You can compile a series of C files without the main function into a library.
Best regards,
Ming
So cannot it be compiled into an executable file without main? As far as I know, the gcc compilation chain can do it.
Hi Cheng,
May I ask why do you want to make an executable without main?
Best regards,
Ming
Because we want to build a system similar to PLC functionality on the am243 chip platform, customers can write PLC code, compile it into an executable. bin file through the ti arm clang toolchain, and the. bin file can be loaded and run by am243. The PLC program written by the customer does not require the main function.
Hi Cheng,
This is more a compiler question than a MCU+ SDK question. I will forward this thread to our SDTO team for further help.
Best regards,
Ming
I am not familiar with ...
Because we want to build a system similar to PLC functionality
Please send me a link to an article that introduces this concept. Before I can say whether our tools support it, I need to understand it better.
Thanks and regards,
-George