Well, I’m usually programming in easyC pro, but to be on the safe side, I’m starting to learn MPLabs to. I have downloaded kevin’s camera code, but when I compile it fails to compile and tells me it didn’t find the stdio.h.
I tried to add the stdio.h file from borlandC (maybe it’s a stupid thing, but just to give it a shot), and still, didn’t work.
What am I doing wrong?
You just don’t have the path set that tells the compiler where to find the system include files.
In MPLAB pull-down:
Project -> Build Options… -> Project
Set “Include Path” to C:\mcc18\h (you can browse there)
and
Set “Library Path” to C:\mcc18\lib
P.S.
You don’t want to use any system files, such as stdio.h, from any other compiler than what came with mcc18.
They are Microchip PIC and C18 specific.
Ok, thanks. Now it worked. And I’ve noticed it had problems if the the file path length is larger than 62 chars.
That can be solved by a button click too if you don’t want to bother moving your files (I’m kind of lazy).
Project -> Build Options… -> Project
Go to the “MPLINK Linker” tab
Click on “Suppress COD-file generation”
Creating that file is when you get the 62 character limit message, and it isn’t used by us for anything so it’s unnecessary anyway.
We are trying to use mplab to compile kevins code and we keep getting a message no source files even though we brought over the c files. how do i get these to compile.
MPLab works with collections of files called “projects”. You can open and edit arbitrary text files with it, but you can only compile a project. Projects are defined in .mcp files, and you open them by choose “open project” from the “project” menu.
We did that, and included the c files in the project and still go no soure files??? Not sure what to do, am I right that you create new project,
add files from existing files from kevins code so that you can compile and rebuild? That is what we did but when we try to build the project we are getting the no source files even though they are in the directory
You should be starting with a predefined project, either the default code from IFI or the camera-enabled code from Kevin’s site. Unless you’re already very experienced with MPLab, there’s no reason for you to create a project yourself.
If you start with the default code and want to add encoder or gyro support, for example, you should follow the very clear directions included with each module Kevin provides.