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.

Microchip C18/MPLAB IDE compiler error!!!!!!!!

Status
Not open for further replies.

yan_c

New Member
Hi, can anyone help with the following error...

MPLINK 4.38, Linker
Copyright (c) 1998-2010 Microchip Technology Inc.
Error - could not find definition of symbol 'OpenADC' in file './GenBoost1.o'.
Errors : 1

Device is declared in main.c code correctly as #include <p18f458.h> and also in configure- select device..

The C18 adc.h file that includes 'OpenADC' is in the project dir and is declared in the project .h file.

Any other ideas would be most appreciated....

More info.........

Device => PIC18F458
Compiler => Microchip C18 V3.37.01
Debug tools => Real ICE, ICD3 are configured, but no h/w as yet so just want to step through code at present...
Operating sys => XP sp3
MPLAB => MPLAB IDE v8.66

Also file 18f458_g.lkr selected as linker script

Thanks
 
adc.h contains the function prototype that allows the compiler to correctly compiles the calls to OpenADC.

The code for actual function OpenADC is compiled from adc.c or the linker can used the compile object file adc.o.

Thinking if you lib path is correct it should find them. But I am not thinking clearly . So add adc.c to your project. May not be the right way but it will fix the problem.
 
Last edited:
Could you post your code? If I'm understanding you correctly, you only have #include <p18f458.h>, but you may also need to have #include <adc.h> in the actual code, not just in the project directory. I may have misunderstood what you were saying, though, so that is why I asked for your code.
Der Strom
 
Last edited:
Header file declaration problem!!

Hi, Ive already got adc.h declared in the main .h file. Ive tried declaring it in the main.c file(along with p18f458.h), but this makes no difference.

Code att...

Thanks....
 

Attachments

  • Genboost1.zip
    9.8 KB · Views: 223
I have it compiled. You have several problems with the project but I suspect you are just interested in getting it to build so do this.

1: Remove the linker file from the project. The linker will select it for you.

2. Run the project wizard, select you pic and let it use the defaults for the rest.

3. Build the project using the new project file.
 

Attachments

  • GenBoost1.zip
    324.8 KB · Views: 257
Thanks 3V0, Can you confirm which is the linker file, do you mean the device header file? I have a linker script declared within MPLAB IDE as 18f458_g.lkr but I think you mean the file 18f458.h in my project dir.

So just removed the 18f458.h file and Genboost1 project and workspace files and used the project the wizard to generate a new project. Do I just need to add genboost1.c & .h files or do I also need to add all the other header files ie. stdl.h adc.h etc.....

Now I get the following :-

Make: The target "U:\MOD FESS project\Single Ph Inv project\GenBoost1.o" is up to date.
Make: The target "U:\MOD FESS project\Single Ph Inv project\GenBoost1.cof" is out of date.
Executing: "C:\Program Files\Microchip\mplabc18\v3.37.01\bin\_mplink.exe" "GenBoost1.o" /o"GenBoost1.cof" /M"GenBoost1.map" /W
MPLINK 4.38, Linker
Copyright (c) 1998-2010 Microchip Technology Inc.
Error - Device not specified. Use /p option to specify a device.
Errors : 1

Looks like I need to start adding the .h files again???

Thanks for you help again..
 
Thanks 3V0, Can you confirm which is the linker file, do you mean the device header file? I have a linker script declared within MPLAB IDE as 18f458_g.lkr but I think you mean the file 18f458.h in my project dir.
18f458_g.lkr is the linker script file.
Error - Device not specified. Use /p option to specify a device.
You caused this error by removing p18f458.h which tells the compiler about the device/processor.

Follow the 3 easy steps I outlined in my previous post and it should compile and link. If not ask here instead of introducing more errors.

The .zip I attached to my previous post is a version that compiled on my system.
 
Last edited:
Hi 3V0, looks Ive sorted it now by adding C:\Program Files\Microchip\mplabc18\v3.37.01\lib to the Library search path, from the project build options. Not sure why the wizard didnt do this but it seems to compile ok now.

Anyway thanks for your help with this....
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top