Error finding the header file

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error finding the header file

700 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by akhilpo on Sun Jul 17 19:02:11 MST 2011
When building a project, it is giving me error that the header file (uart.h). could not be found. I had added the driver folder to the current project and uart.h & uart  is present in the current project folder. Also it marked the functions UARTInit() and UARTSend() as implicit declarations. The uart example project is open in the the project library.

**** Build of configuration Debug for project uart_comm ****

make all 
Building file: ../src/cr_startup_lpc11.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC11xx -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\inc" -O0 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/cr_startup_lpc11.d" -MT"src/cr_startup_lpc11.d" -o"src/cr_startup_lpc11.o" "../src/cr_startup_lpc11.c"
Finished building: ../src/cr_startup_lpc11.c
 
Building file: ../src/main.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC11xx -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\inc" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/main.d" -MT"src/main.d" -o"src/main.o" "../src/main.c"
../src/main.c:23:18: error: uart.h: No such file or directory
../src/main.c: In function 'main':
../src/main.c:30: warning: implicit declaration of function 'UARTInit'
../src/main.c:32: warning: implicit declaration of function 'UARTSend'
make: *** [src/main.o] Error 1
0 Kudos
9 Replies

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jul 20 11:59:41 MST 2011
This is a compiler warning. The compiler doesn't know if the linker will add these functions, so it's warning you.

After including the correct header file (and it's path in properties) the compiler is satisfied.
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by akhilpo on Wed Jul 20 11:26:03 MST 2011
These are the functions declared in the libraries provided be NXP. If the compiler cant find the definitions of those functions, isnt it supposed to show an error instead of a warning? Infact it did show error before I added the library file's path in the project properties. :???

@rob Yes, I know i should learn about the environment. Do you have any suggestion which can help me in this regard?
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Wed Jul 20 08:38:03 MST 2011

Quote: akhilpo
I have added the paths and the build does run fine...



No, this build isn't running fine, it's warning :eek::eek:

So you didn't declare this 2 functions in main. If they are linked later, your luck.
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Rob65 on Wed Jul 20 08:30:44 MST 2011

Quote: akhilpo
Is it fine if I ignore this warning??



No.
If you keep doing things like this you will end up with a problem with type casting of parameters some day.
Always fix errors and warnings.
There is a reason why you are being warned ...

You should try to get some more knowledge about the tools (Eclipse, Gnu compiler suite, C-language) you are using.

Rob
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by akhilpo on Wed Jul 20 08:12:03 MST 2011
I have added the paths and the build does run fine... I am using lpcxpresso IDE v3.6.3. Is it fine if I ignore this warning??
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Tue Jul 19 23:17:33 MST 2011

Quote:

../src/main.c: In function 'main':
../src/main.c:30: warning: implicit declaration of function 'UARTInit'
../src/main.c:32: warning: implicit declaration of function 'UARTSend'



The compiler can't find a declaration of this 2 functions you are using in main :eek:

So you did forget to include it's header or your include path is wrong :eek:

Note: If you are using CMSIS2p00 change you Symbol to __USE_CMSIS=CMSISv2p00_LPC11xx
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by akhilpo on Tue Jul 19 18:17:13 MST 2011
Please tell me why is it still showing those warning signs.
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by akhilpo on Mon Jul 18 18:25:02 MST 2011
I referred this page and it helped me: http://support.code-red-tech.com/CodeRedWiki/LibraryProjects

But now it shows a warning (not error) sign for the driver functions (implicit declarations). But the program runs fine...

**** Build of configuration Debug for project uart_comm ****

make all 
Building file: ../src/cr_startup_lpc11.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC11xx -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\inc" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\driver" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\config" -O0 -Os -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/cr_startup_lpc11.d" -MT"src/cr_startup_lpc11.d" -o"src/cr_startup_lpc11.o" "../src/cr_startup_lpc11.c"
Finished building: ../src/cr_startup_lpc11.c
 
Building file: ../src/main.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC11xx -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\inc" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\driver" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\config" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"src/main.d" -MT"src/main.d" -o"src/main.o" "../src/main.c"
../src/main.c: In function 'main':
../src/main.c:30: warning: implicit declaration of function 'UARTInit'
../src/main.c:32: warning: implicit declaration of function 'UARTSend'
Finished building: ../src/main.c
 
Building file: ../driver/ssp.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC11xx -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\inc" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\driver" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\config" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"driver/ssp.d" -MT"driver/ssp.d" -o"driver/ssp.o" "../driver/ssp.c"
Finished building: ../driver/ssp.c
 
Building file: ../driver/timer16.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC11xx -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\inc" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\driver" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\config" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"driver/timer16.d" -MT"driver/timer16.d" -o"driver/timer16.o" "../driver/timer16.c"
Finished building: ../driver/timer16.c
 
Building file: ../driver/timer32.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC11xx -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\inc" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\driver" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\config" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"driver/timer32.d" -MT"driver/timer32.d" -o"driver/timer32.o" "../driver/timer32.c"
Finished building: ../driver/timer32.c
 
Building file: ../driver/uart.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC11xx -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\inc" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\driver" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\config" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"driver/uart.d" -MT"driver/uart.d" -o"driver/uart.o" "../driver/uart.c"
Finished building: ../driver/uart.c
 
Building file: ../driver/wdt.c
Invoking: MCU C Compiler
arm-none-eabi-gcc -D__REDLIB__ -DDEBUG -D__CODE_RED -D__USE_CMSIS=CMSISv1p30_LPC11xx -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\inc" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\driver" -I"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\config" -O0 -g3 -Wall -c -fmessage-length=0 -fno-builtin -ffunction-sections -fdata-sections -mcpu=cortex-m0 -mthumb -MMD -MP -MF"driver/wdt.d" -MT"driver/wdt.d" -o"driver/wdt.o" "../driver/wdt.c"
Finished building: ../driver/wdt.c
 
Building target: uart_comm.axf
Invoking: MCU Linker
arm-none-eabi-gcc -nostdlib -L"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\CMSISv1p30_LPC11xx\Debug" -L"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\driver" -L"C:\Users\Akhil\Documents\lpcxpresso_3.6.3_317\workspace\uart_comm\config" -Xlinker -Map=uart_comm.map -Xlinker --gc-sections -mcpu=cortex-m0 -mthumb -T "uart_comm_Debug.ld" -o"uart_comm.axf"  ./src/cr_startup_lpc11.o ./src/main.o  ./driver/adc.o ./driver/can.o ./driver/clkconfig.o ./driver/debug_printf.o ./driver/gpio.o ./driver/i2c.o ./driver/i2cslave.o ./driver/lpc_swu.o ./driver/rs485.o ./driver/small_gpio.o ./driver/ssp.o ./driver/timer16.o ./driver/timer32.o ./driver/uart.o ./driver/wdt.o   -lCMSISv1p30_LPC11xx
Finished building target: uart_comm.axf
 
make --no-print-directory post-build
Performing post-build steps
arm-none-eabi-size uart_comm.axf; # arm-none-eabi-objcopy -O binary uart_comm.axf uart_comm.bin ; checksum -p LPC1114_302 -d uart_comm.bin;
   text       data        bss        dec        hex    filename
   2340        524         80       2944        b80    uart_comm.axf
 
0 Kudos

672 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Sun Jul 17 19:10:09 MST 2011
Add include path and source location :eek:

See:

http://knowledgebase.nxp.com/showthread.php?t=2151
0 Kudos