Topic : How to link an external object file

Forum : ST7/STM8

Original Post
Post Information Post
September 4, 2012 - 6:13pm
Guest

Hi everybody,

I made an object file ("general.obj") including only a function ("Routine1(void)") and I would like to use this object file on an other project.

So I create an header file including the prototype of Routine1, and I call "Routine1" in "main.c".

 RLSTM8 LINKER/LOCATOR V2.44.12.199 - Lite (32 Kb code limited)  
 Copyright (c) Raisonance S.A.S. 1987-2012. All rights reserved.  
 ***ERROR 100 : UNRESOLVED EXTERNAL  
 SYMBOL : ?Routine1(MAIN)  
 LINK/LOCATE RUN COMPLETE, 1 ERROR  FOUND. 
  Error Code: 1 

I don't understand why it declare an error.
Thank you for your help.

Replies
Post Information Post
+1
0
-1
September 5, 2012 - 9:20am
Raisonance Support Team

Hi,

Declaring the function prototype is not enough. You must also give the code to the linker.

Just include the obj file in the calling project, like if it was a source file.

Best Regards,

Vincent

+1
0
-1
September 5, 2012 - 3:14pm
Guest

Hi

Thanks for your help.
Now it compile without error.

good job.
Sylvain.