HELP: assembly & C linking woes....

Discussion in 'C Programming' started by Andrew Wan, Sep 27, 2007.

  1. Andrew Wan

    Andrew Wan Guest

    I am having problems linking an assembly object with my C object
    files. Am getting:

    Linker Warning: DOSSEG directive ignored in module asm.asm
    Linker Error: Undefined symbol _ASMClsV in module main.c
    Linker Error: Undefined symbol VADDR in module asm.asm

    In my asm.asm file I've got:

    DOSSEG
    ..MODEL huge
    ..386

    ..DATA
    EXTRN vaddr : word;

    ..CODE
    PUBLIC ASMClsV

    ASMClsV PROC Near
    ;bla bla
    ASMClsV EndP

    In main.c I've got:

    extern void ASMClsV();

    Am trying to link using Borland C++ 4.5 since my source files are all
    16-bit. I successfully linked the same asm.asm file with a 16-bit
    pascal object using Turbo Pascal 7.0. Why can't I link using Borland C+
    + 4.5 to a 16-bit C file?

    Also, I used Microsoft Macro Assembler 5. Should I use Turbo Assembler?
    Andrew Wan, Sep 27, 2007
    #1
    1. Advertising

  2. Andrew Wan

    jacob navia Guest

    Andrew Wan wrote:
    > I am having problems linking an assembly object with my C object
    > files. Am getting:
    >


    > Linker Warning: DOSSEG directive ignored in module asm.asm
    > Linker Error: Undefined symbol _ASMClsV in module main.c
    > Linker Error: Undefined symbol VADDR in module asm.asm
    >


    MAYBE the problem is the missing underscores in the asm
    program


    > In my asm.asm file I've got:
    >
    > DOSSEG
    > .MODEL huge
    > .386
    >
    > .DATA
    > EXTRN vaddr : word;


    EXTRN _vaddr : word;

    add a leading underscore
    >
    > .CODE
    > PUBLIC ASMClsV


    Shouldn't that be
    PUBLIC _ASMClsV

    with the leading _
    >
    > ASMClsV PROC Near
    > ;bla bla
    > ASMClsV EndP
    >
    > In main.c I've got:
    >
    > extern void ASMClsV();
    >
    > Am trying to link using Borland C++ 4.5 since my source files are all
    > 16-bit. I successfully linked the same asm.asm file with a 16-bit
    > pascal object using Turbo Pascal 7.0. Why can't I link using Borland C+
    > + 4.5 to a 16-bit C file?
    >
    > Also, I used Microsoft Macro Assembler 5. Should I use Turbo Assembler?
    >
    jacob navia, Sep 27, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Prasanna Padmanabhan
    Replies:
    1
    Views:
    802
    Mattias Sjögren
    Nov 19, 2003
  2. Sanjay Tibrewal
    Replies:
    0
    Views:
    721
    Sanjay Tibrewal
    Nov 14, 2003
  3. Brent
    Replies:
    1
    Views:
    1,346
    Brent
    Jan 23, 2004
  4. SA
    Replies:
    0
    Views:
    459
  5. Horatiu Margavan via .NET 247

    Assembly's manifest definition does not match the assembly reference.

    Horatiu Margavan via .NET 247, Aug 30, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    3,593
    Horatiu Margavan via .NET 247
    Aug 30, 2004
Loading...

Share This Page