Topic : ERROR 100 : UNRESOLVED EXTERNAL SYMBOL: AutonomousInitiate(MAIN)

Forum : 8051

Original Post
Post Information Post
June 19, 2007 - 4:44pm
Guest

Hello Guys,
I am new in RIDE and when I Build my project , all my .c & .h compiles correctly
but the linker LX51 gives this error:
ERROR 100 : UNRESOLVED EXTERNAL SYMBOL: AutonomousInitiate(MAIN)

The thing is that in my "main.c" I have

#include "autonomous.h"

main()
{
AutonomousInitiate();

..
..
}

and inside my "autonomous.c"

unsigned char AutonomousInitiate(void)
{
error = 0;
..
..
return error;
}

So everything seems correct... :-(
Is it any linker option I would have forgot?
Thanks in advance
fabrice

Replies
Post Information Post
+1
0
-1
June 19, 2007 - 5:36pm
Guest

... and in autonomous.h, what do you have ? Did you check typos ? You can have a look at the map file (its extension is .m51) generated by the linker: it will show you the name of the symbols generated by each module (for example, MAIN is a module and AUTONOMOUS will be another one), and you could detect a conflict there.

You can also send me your whole project if you want me to have a look.

regards,
Lionel

+1
0
-1
June 19, 2007 - 6:17pm
Guest

Hello Lionel
In autonomous.h I have this:
..
unsigned char AutonomousInitiate(void);
..

I checked the map file, and I have something strange, objects seem to be duplicated and MAIN is not:
INPUT MODULES INCLUDED
G:\DEVELOPMENT\CODE\UPSD3422EV\MASTERMODULE_V1_03\AUTONOMOUS.OBJ(A&
UTONOMOUS)
G:\DEVELOPMENT\CODE\UPSD3422EV\MASTERMODULE_V1_03\AUTONOMOUS.OBJ(A&
UTONOMOUS)
G:\DEVELOPMENT\CODE\UPSD3422EV\MASTERMODULE_V1_03\MAIN.OBJ(MAIN)
G:\DEVELOPMENT\CODE\UPSD3422EV\MASTERMODULE_V1_03\UPSD3400.OBJ(UPS&
D3400)
G:\DEVELOPMENT\CODE\UPSD3422EV\MASTERMODULE_V1_03\UPSD3400.OBJ(UPS&
D3400)
maybe it is normal... ?

As you kindly suggested it, I d like to send you my project, but I cant attach files using email functionality of these pages!
So here is my email address deleted for security purposes, Send me an email I will reply you with files attached.
thank you for your time
fabrice

+1
0
-1
June 20, 2007 - 10:08am
Guest

I wonder if you added your header files as well as application nodes... You should not do this. Header files are considered as dependencies of .c files, and if you add them as nodes, the compiler will try to compile them and create a module for them as well. It is not the purpose. You should only add as nodes, files that you want to see translated into object files (if you write C code only, this means only .c files).

regards,
Lionel

+1
0
-1
June 20, 2007 - 1:00pm
Guest

Thank You Lionel! :-)
That was it, indeed I added .h and .c both with "Add node Source/application" functionality.
Adding only *.c files worked.
Thank you
fabrice