Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

MPLAB X can't find includes

Status
Not open for further replies.

yfx4

Member
I am working on some code and am having trouble with MPLAB X finding my config file. I made a test project to play with and it has the same issues. When I try to build it I get this output:


CLEAN SUCCESSFUL (total time: 157ms)
make -f nbproject/Makefile-default.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `E:/MPLABXProjects/TStest.X'
make -f nbproject/Makefile-default.mk dist/default/production/TStest.X.production.hex
make[2]: Entering directory `E:/MPLABXProjects/TStest.X'
"C:\Program Files\Microchip\xc8\v1.32\bin\xc8.exe" --pass1 --chip=18F24K50 -Q -G --double=24 --float=24 --emi=wordwrite --opt=default,+asm,+asmfile,-speed,+space,-debug --addrqual=ignore --mode=free -P -N255 --warn=0 --asmlist --summary=default,-psect,-class,+mem,-hex,-file --output=default,-inhx032 --runtime=default,+clear,+init,-keep,-no_startup,-download,+config,+clib,+plib --output=-mcof,+elf:multilocs --stack=compiled:auto:auto:auto "--errformat=%%f:%%l: error: (%%n) %%s" "--warnformat=%%f:%%l: warning: (%%n) %%s" "--msgformat=%%f:%%l: advisory: (%%n) %%s" -obuild/default/production/main.p1 main.c
(908) exit status = 1
make[2]: *** [build/default/production/main.p1] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
main.c:8: error: (141) can't open include file "config.h": No such file or directory
make[2]: Leaving directory `E:/MPLABXProjects/TStest.X'
make[1]: Leaving directory `E:/MPLABXProjects/TStest.X'

BUILD FAILED (exit value 2, total time: 1s)


config.h is in the project folder, E:/MPLABXProjects/TStest.X

Please help me get this to find my files and build.
 
I take it you have a file called "config.h" in the project directory!

You need to look at the include directory settings in the properties page..

Also just check with your compiler if "config.h" can be used... It might be used somewhere else..

If all else fails.. zip up your project and post it here and we'll take a look see...
 
Thanks for the quick response.

Yes the project directory has config.h :happy:

I am using the free version of XC8.

I have even renamed it thinking that config.h is a 'banned' name. It still does not work.

I checked the include directory settings........the dialog opens into my project directory and will not add that directory.

The zip file is attached. Thx for looking at it!!!
 

Attachments

  • TStest.X.zip
    13 KB · Views: 487
Thank you. That worked. Y'all are awesome!!!:woot:

Why did it work????

The help file about includes says I can use < > and MPLAB X puts the < > in when it generates a new main .c file as it did with #include <stdlib.h> and #include <stdio.h>

I certainly am not doubting you (it DID work after all)....just trying to learn.
 
<file> is for system includes, "file" is for user includes.
Hola NG

That seems to be kind of a de facto standard, isn't it?

But I am in doubt with the editor in MPLAB (IIRC, both ways used to work for .ASM files I wanted to include). Not way to check that from here.

Ah, forgot to tell, I work in Assembler only.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top