Pumpkin, Inc.

Pumpkin User Forums

Compiling error #500

For issues specific to Microchip's PICmicro® MCUs, including compilers (e.g. HI-TECH PICC & PICC-18, Microchip MPLAB®-C18) and IDEs (e.g. Microchip MPLAB®).

Compiling error #500

Postby larsbn » Tue Mar 11, 2008 7:13 am

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

Source Files:
mem.c
mytest.c (my main-file)
Header Files:
salvocfg.h
Library Files:
sfp87sab.lib


Here is the very simple mytest.c-file:

code:

#include <pic18.h>
#include <salvo.h>

int main(void)
{
OSInit();

while(1) {
OSSched();
}
}


Here is the salvocfg.h-file:

code:

#define OSUSE_LIBRARY TRUE
#define OSLIBRARY_TYPE OSF
#define OSLIBRARY_CONFIG OSA
#define OSLIBRARY_VARIANT OSB

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.

However, when building the project I get the following result:

code:

Clean: Deleting intermediary and output files.
Clean: Deleted file "C:Program FilesSalvosrcmem.obj".
Clean: Deleted file "C:Program FilesSalvosrcmem.cce".
Clean: Deleted file "X:DocumentsKurserMikrocontrollers med RTOS estmytest.obj".
Clean: Deleted file "X:DocumentsKurserMikrocontrollers med RTOS estmytest.cce".
Clean: Done.
Executing: "C:Program FilesHI-TECH SoftwarePICC-189.50BINPICC18.EXE" -C -E"mem.cce" "mem.c" -O"mem.obj"
-I"C:Program FilesSalvoinc" -Zg9 -O -ASMLIST -Bs -CP24 -Q -MPLAB -18F458
Advisory[1207] : some of the command line options you are using are now obsolete
Advisory[1208] : use --help option or refer to the user manual for option details
Warning[176] C:Program FilesSalvoincsalvocfg.h 2 : missing newline
Executing: "C:Program FilesHI-TECH SoftwarePICC-189.50BINPICC18.EXE" -C -E"mytest.cce" "mytest.c" -O"mytest.obj"
-I"C:Program FilesSalvoinc" -Zg9 -O -ASMLIST -Bs -CP24 -Q -MPLAB -18F458
Advisory[1207] : some of the command line options you are using are now obsolete
Advisory[1208] : use --help option or refer to the user manual for option details
Warning[176] C:Program FilesSalvoincsalvocfg.h 2 : missing newline
Warning[176] X:DocumentsKurserMikrocontrollers med RTOS estmytest.c 11 : missing newline
Warning[337] X:DocumentsKurserMikrocontrollers med RTOS estmytest.c 10 : line does not have a newline on the end
Executing: "C:Program FilesHI-TECH SoftwarePICC-189.50BINPICC18.EXE" -E"mytest.lde" "C:Program FilesSalvosrcmem.obj"
"X:DocumentsKurserMikrocontrollers med RTOS estmytest.obj" "C:Program FilesSalvolibhtpicc18sfp87sab.lib"
-M"mytest.map" -W-9 -O"mytest.cof" -O"mytest.hex" -Bs -CP24 -Q -MPLAB -18F458
Advisory[1207] : some of the command line options you are using are now obsolete
Advisory[1208] : use --help option or refer to the user manual for option details
Error[500] : undefined symbols:
_OSsigQinP (C:Program FilesSalvolibhtpicc18sfp87sab.lib: init.obj)
_OSsigQoutP (C:Program FilesSalvolibhtpicc18sfp87sab.lib: init.obj)
_OSlostTicks (C:Program FilesSalvolibhtpicc18sfp87sab.lib: init.obj)
_OStimerTicks (C:Program FilesSalvolibhtpicc18sfp87sab.lib: init.obj)
_OSdelayQP (C:Program FilesSalvolibhtpicc18sfp87sab.lib: init.obj)
BUILD FAILED: Tue Mar 11 15:46:12 2008



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).]

/L
larsbn
 
Posts: 18
Joined: Mon Mar 10, 2008 11:00 pm
Location: Gothenburg, Sweden

Re: Compiling error #500

Postby aek » Tue Mar 11, 2008 7:58 am

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).

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Compiling error #500

Postby aek » Tue Mar 11, 2008 7:59 am

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.

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm

Re: Compiling error #500

Postby larsbn » Tue Mar 11, 2008 8:29 am

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.


/L
larsbn
 
Posts: 18
Joined: Mon Mar 10, 2008 11:00 pm
Location: Gothenburg, Sweden

Re: Compiling error #500

Postby aek » Tue Mar 11, 2008 9:29 am

You're most welcome.

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

-------
aek
aek
 
Posts: 1888
Joined: Sat Aug 26, 2000 11:00 pm


Return to PICmicro MCUs

Who is online

Users browsing this forum: Google [Bot] and 2 guests

cron