Ruben Valls Blasco

Passing symbols to library

Discussion created by Ruben Valls Blasco on Apr 24, 2009
Latest reply on Apr 24, 2009 by stanish

Hi everyone. I have a little question about libraries and the program wich use it, I tell you:

I have done a project with Project Type (in Options->Coldfire Target) as Library, with a cuple of functions.

Now I create another project (this one as Application) and include the library to it, so I can use the functions in it.

Till here everything goes fine. The problem arrives when I have to compile some code or some other code in the library project depending on a symbol defined in the application project. In example:


/*In main.h at the application project:*/



/*In utilities.c at the library project:*/


void function(){

  //Function empty



void function(){

  //Function with code




The compiler always act as USE_DUMP_FUNCTION=0, it does not recognize the symbol from the other project. I know I should do #include "main.h" in utilities.c, but since I can't know wich one is the path to main.h (because it depends on the application project wich not always will be the same) I can't include that line.


So, how can I define a symbol in the application project and the library recognize it so the compiler compiles the appropiate code?


Thanks in advance,