Pumpkin, Inc.

Compiling error #500

Compiling error #500

Posted: Tue Mar 11, 2008 7:13 am

by larsbn

Hi,I have used PIC18-controllers with the PICC18 C-compiler for quite some time. I currently use v7.61 of MPLAB IDE and v9.5 of the PICC18-compiler. I am now looking for a RTOS for my applications and I recently downloaded Salvo Lite 3.2.3 for evaluation purposes. So far, I’ve not been so lucky…..

For the last couple of days I’ve been trying to build a simple RTOS testing-project, but I keep getting an error (#500: undefined symbols). I understand that there are some files missing I my project, I just don’t understand which ones.

I have pretty much followed instructions in AN-26 except I use a PIC18F458 controller. In my project I have included the following files

Furthermore, in order to match the sfp87sab.lib-file, I have checked the boxes for “Use 24-bit wide pointers to program space” and Memory Model: “Small” under the Build options dialog. I’m also pointing to the salvoinc under “Include Search Path” and to salvolibhtpicc18 under “Include Library Path”.

As far as I understand from AN-26 and the “Salvo Compiler Reference Manual-HI-TECH PICC18” –manual, this should be all I need.

I interpret this error in the following way: The compiler is looking for symbols OSsigQinP, OSsigQoutP etc in library sfp87sab.lib but can’t find them there.

What I’m I doing wrong? (Please….)

------------------/L

[This message has been edited by aek (edited March 11, 2008).]

Re: Compiling error #500

Posted: Tue Mar 11, 2008 7:58 am

by aek

You're very close in your interpretation ... those Salvo objects are all in mem.c (mem.obj). not in the Salvo library.

For whatever reason, those objects are not "being enabled", and so functions that use them (the functions like OSInit() are in the Salvo library) cannot see them. When this happens, it normally means that the preprocessor (through salvo.h and ultimately via salvocfg.h) is not "configuring" mem.c properly when it is compiled. This sort of behavior usually happens when a different set of Salvo configuration options are being applied to a project (e.g. an OSLIBRARY_CONFIG of OSM).

All of your setup seems correct, except I am concerned that your salvocfg.h is located in SalvoInc. It ought to be located in your working directory instead. I would do the following:

1) Move your salvocfg.h to your working directory (i.e. your MPLAB project directory), add an additional include path to the MPLAB Project if necessary, and re-build.

2) Then, place an #error Aha! in that salvocfg.h. All builds should fail with an Aha! error. This verifies that you are building with the salvocfg.h you think you're using.

1 + 2 should fix it.

If not, this is what I would do:

3) Pre-process Salvo's mem.c and see if the "missing" objects are being suppressed or not. Alternately, you could use PICC-18's librarian to view the contents of the mem.obj file. The named objects should be in these based on the salvocfg.h you're using. If another salvocfg.h is "somehow making its way in there", then those objects will be suppressed.

We have not yet migrated to v9.5 here at Pumpkin. While it's possible that there is some sort of incompatibility, I doubt it, as the linker is clearing looking for objects that are referenced from the Salvo library (that was built with a much earlier version of PICC-18).

In summary, I think the salvocfg.h you think you are using is not in fact the one that is being applied to the project.

(I took the liberty of formatting your post for clarity, using the code tag).

------------------

Re: Compiling error #500

Posted: Tue Mar 11, 2008 7:59 am

by aek

I would also recommend fixing the no-newline errors. I have seen very odd things happen when newlines are missing, though not necessarily with the PICC-18 compiler.

------------------

Re: Compiling error #500

Posted: Tue Mar 11, 2008 8:29 am

by larsbn

Thank you! I'm impressed by your quick and accuarte analysis!

I knew that my salvocfg.h-file was in the right directory (my working directory), but when I added #error Aha!-line to it, I couldn't see that error in the output window when compiling. It turned out that I had an other (older) slavcfg.h-file in the inc-library, and since I was pointing to it in the include search path dialog, that was the slavcfg.h-file the compiler was using. By just deleting it and including the working directory in the search-path it works fine!

Your analysis was absolutely accurate: The compiler was indeed using the wrong slavcfg.h-file, and the trick with the adding of the #error Aha!-line was very slick! I'll remember that and I look forward to exploring the benefits of Salvo RTOS!

Thank you for your help and time!

/larsbn

quote:Originally posted by aek:I would also recommend fixing the no-newline errors. I have seen very odd things happen when newlines are missing, though not necessarily with the PICC-18 compiler.