Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Undefined Global - suggestions please

Help
mikerla
2007-02-21
2013-03-12
  • mikerla
    mikerla
    2007-02-21

    When compiling with the large memory model I do not have this Undefined global problem

    ?ASlink-Warning-Undefined Global '_serinit' referenced by module 'maptest'

    When compiling with the small and medium model I get it. I have recompiled the library file for both the small and medium models and they are in the respective sdcc library folders. I am not sure why I am getting this error and where to look to fix it. Thanks for the suggestions in advance.

    The error occurs whether I run the linker from

    Mike

    C:\Micro-IDE_Projects\MapTest>sdcc --model-medium -Wl-p maptest.rel --lib-path c:\bipom\devtools\sdcc\lib\medium
    -k c:\bipom\devtools\sdcc\lib\medium
    -k C:\bipom\devtools\SDCC\bin\..\lib\medium
    -l mcs51
    -l libsdcc
    -l libint
    -l liblong
    -l libfloat
    maptest.rel

    ?ASlink-Warning-Undefined Global '_serinit' referenced by module 'maptest'

    #include "Main.H"

    main()
    {
        /* Set the serial port to 19200 Baud */

        serinit(CBR_19200);
        while(1);
    }

    #ifndef Main_H
    #define Main_H

    #define    CBR_19200    19200

    #define OFF 0
    #define ON 1

    #include <at89c51ed2MR44.h>

    #include <stdio.h>

    typedef unsigned char Uchar;
    typedef unsigned int  Uint;
    typedef unsigned long Ulong;

    //Unused Compiler switch settings
    //--code-loc 0x0800 --debug

    //ISR declarations

    //Function Proto types

    void serinit(unsigned long baudRate);

    #endif

    ?ASlink-Warning-Undefined Global '_serinit' referenced by module 'maptest'

     
    • mikerla
      mikerla
      2007-02-22

      I am not looking for some one to fix this for me just some suggestions where to look.

      Thanks

      Mike

       
    • kosmonaut_pirx
      kosmonaut_pirx
      2007-02-23

      hello,
      your code taken as it is would bring this error message on every compiler, imho. due to the fact that serinit isn't defined anywhere.
      plz post complete out-of-the-box _examples_(!), if at all possible. it isn't fun to interpret your post in a way "what means what: what is header and what .c .. and where is the routine ... declared?"

      thx,
      bye kosmo

       
    • mikerla
      mikerla
      2007-02-23

      Thanks Kosmo I did not have the serinit routine in my small and medium lib directories. Not getting the error anymore.

      Thanks

      Mike