Compiling assembly code into project

This is a discussion on Compiling assembly code into project within the C Programming forums, part of the General Programming Boards category; I can't seem to reference functions in the assembled .obj file from my project.. How is this done? I'm using ...

  1. #1
    Registered User
    Join Date
    Feb 2002
    Posts
    329

    Question Compiling assembly code into project

    I can't seem to reference functions in the assembled .obj file from my project.. How is this done?
    I'm using Watcom C, and included the file in the project, still it will say that the function doesn't exist. Does the prototype have to look in a particular way?
    I've prototyped it like this: void somefunc(void);
    Any suggestions?

    Best regards knutso

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,344
    > I've prototyped it like this: void somefunc(void);
    But when you try and call this, and the linker tells you it's unresolved, what is the actual symbol name.

    Some compilers prefix the name with an underscore, so somefunc in your code would actually be _somefunc to the linker.

    It's the linker version of the name which you want to be using for the name of the function in your asm file.

    I'm assuming that the compiler and and assembler are matched - in that they produce a common .OBJ format.

  3. #3
    Registered User
    Join Date
    Feb 2002
    Posts
    329

    assembler code

    Hi, and thanks for the reply.
    The assembler, compiler and linker are all part of the Watcom package, so they should match..
    The functions are prefixed with an underscore too..

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. have some difficulty compiling a project
    By Masterx in forum C++ Programming
    Replies: 1
    Last Post: 04-04-2009, 07:49 AM
  2. Problem with compiling code with option -O2
    By koushikyou in forum C Programming
    Replies: 16
    Last Post: 01-07-2009, 05:03 AM
  3. Linking an assembly routine into a GCC project
    By huh in forum C++ Programming
    Replies: 3
    Last Post: 11-21-2002, 02:14 PM
  4. converting c/c++ code to assembly
    By moonwalker in forum A Brief History of Cprogramming.com
    Replies: 8
    Last Post: 07-25-2002, 02:15 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21