I'm attempting to get Ceedling/CMock/Unity running on a PIC16LF1705 using xc8 from Microchip.
I'm encountering an error:
Non line specific message: (1091) main function "_main" not defined
The line being executed is:
xc8 -O0 --CHIP=16LF1705 -c build/vendor/unity/src/unity.c
-o"build/test/out/test_adc_handler/unity.p1" -I"C:/code/Unity/Unity-master/Unity-master/src/" -I"C:/Program Files/Microchip/xc8/v2.46/pic/include/proc/" -I"C:/Program Files/Microchip/xc8/v2.46/pic/include/c90" -I"C:/code/dimonomid/test_ceedling_example/src/appl/" -I"C:/code/dimonomid/test_ceedling_example/src/bsp/" -I"C:/code/dimonomid/test_ceedling_example/src/util/" -Wall -mlarge-code -mlarge-arrays
So it seems the while compiling "build/vendor/unity/src/unity.c" a "main" is missing.
Note: There is a "main" in Dmitry's example code.
I don't understand the error message nor how to fix it.
In case it is helpful the complete output following "ceedling test:all" is:
C:\code\dimonomid\test_ceedling_example\test_ceedling>ceedling test:all
Ceedling set up completed in 226 milliseconds
Preparing Build Paths...
Extracting Build Directive Macros
---------------------------------
Parsing test_adc_handler.c...
Ingesting Test Configurations
-----------------------------
Collecting search paths, flags, and defines for test_adc_handler.c...
Collecting Testing Context
--------------------------
Parsing & processing #include statements within test_adc_handler.c...
Determining Files to be Generated...
Mocking
-------
Test Runners
------------
Generating runner for test_adc_handler.c...
Determining Artifacts to Be Built...
Building Objects
----------------
Compiling test_adc_handler.c...
Compiling test_adc_handler::adc_handler.c...
Compiling test_adc_handler::appl.c...
Compiling test_adc_handler::unity.c...
Compiling test_adc_handler::cmock.c...
Compiling test_adc_handler::test_adc_handler_runner.c...
ERROR: Shell command failed.
> Shell executed command:
'xc8 -O0 --CHIP=16LF1705 -c build/vendor/unity/src/unity.c -o"build/test/out/test_adc_handler/unity.p1" -I"C:/code/Unity/Unity-master/Unity-master/src/" -I"C:/Program Files/Microchip/xc8/v2.46/pic/include/proc/" -I"C:/Program Files/Microchip/xc8/v2.46/pic/include/c90" -I"C:/code/dimonomid/test_ceedling_example/src/appl/" -I"C:/code/dimonomid/test_ceedling_example/src/bsp/" -I"C:/code/dimonomid/test_ceedling_example/src/util/" -Wall -mlarge-code -mlarge-arrays'
> Produced output:
C:\Program Files\Microchip\xc8\v2.46\pic\bin\picc @C:\Users\ussz\AppData\Local\Temp\xcAs13ps.\xc8_tmp_0.cmd [ -O0 --CHIP=16LF1705 -c build/vendor/unity/src/unity.c -obuild/test/out/test_adc_handler/unity.p1 -IC:/code/Unity/Unity-master/Unity-master/src/ -IC:/Program Files/Microchip/xc8/v2.46/pic/include/proc/ -IC:/Program Files/Microchip/xc8/v2.46/pic/include/c90 -IC:/code/dimonomid/test_ceedling_example/src/appl/ -IC:/code/dimonomid/test_ceedling_example/src/bsp/ -IC:/code/dimonomid/test_ceedling_example/src/util/ -Wall -mlarge-code -mlarge-arrays ]
Microchip MPLAB XC8 C Compiler V2.46
Build date: Jan 4 2024
Part Support Version: 2.46
Copyright (C) 2024 Microchip Technology Inc.
License type: Node Configuration
legacy HI-TECH support is deprecated and will be discontinued in a future release; consult the release notes for more details
legacy C90 library is deprecated and will be discontinued in a future release; consult the release notes for more details
Non line specific message: (1091) main function "_main" not defined
(908) exit status = 1
(908) exit status = 1
> And exited with status: [1].
ShellExecutionException ==> 'Test Compiler' (xc8) exited with an error
Ceedling could not complete operations because of errors.