This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

how to create library

i have written a simple UART code, my project is entirely depends upon the serial comunnication.

i have to control 4 to 5 stepper motor and sensor, for which lot of subroutines r to be written,
i wanted to make small library which are classified into motor,uart,sensor codes .

now i have written a simple test code for my project, it is working fine when i write all the code in one C file.

when i am tring to modularized the code compiler shows 0 errors but 10 warnings.

*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  SYSTEM_INIT
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)

*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  PORT_IO_INIT
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)

*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  _UART1_TX
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)

*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  UART1_INIT
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)

*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL
    SYMBOL:  _DELAY
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  SYSTEM_INIT
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)
    ADDRESS: 0090H

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  UART1_INIT
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)
    ADDRESS: 0093H

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  PORT_IO_INIT
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)
    ADDRESS: 0096H
BL51 BANKED LINKER/LOCATER V6.11            11/15/2010  17:19:25  PAGE 3



*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  _DELAY
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)
    ADDRESS: 00A0H

*** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL
    SYMBOL:  _UART1_TX
    MODULE:  D:\SWAPNIL_PROJECT\S.O.A.M_30112010\CODE\VERSION2\SOAM_12112010\K
>> EIL2\TEST1.OBJ (TEST1)
    ADDRESS: 00ADH

Program Size: data=17.0 xdata=0 code=198
LINK/LOCATE RUN COMPLETE.  10 WARNING(S),  0 ERROR(S)

please help me understand where i am going wrong

Parents
  • The errors are Linker errors relating to missing definitions.

    The source code is not relevant here - the problem is in the inputs provided (or not provided) to the Linker.

    I'm not really clear on why you want to use libraries for this but, if you do, it means you will have to break your project up:

    You will need a separate project to create each library;

    Then you will also need an "application" project which uses these libraries.

Reply
  • The errors are Linker errors relating to missing definitions.

    The source code is not relevant here - the problem is in the inputs provided (or not provided) to the Linker.

    I'm not really clear on why you want to use libraries for this but, if you do, it means you will have to break your project up:

    You will need a separate project to create each library;

    Then you will also need an "application" project which uses these libraries.

Children
No data