creating libraries in c

This is a discussion on creating libraries in c within the C Programming forums, part of the General Programming Boards category; i was wondering how do u link asm code to c I work with turbo c how do they link ...

  1. #1
    Registered User
    Join Date
    Mar 2003
    Posts
    1

    creating libraries in c

    i was wondering how do u link asm code to c
    I work with turbo c
    how do they link their header file prototypes to the libraries?
    i have some asm code which i have converted to obj, and i have a header file declaring the functions as extern

    how do i link this header file to the assembly code??

  2. #2
    ....
    Join Date
    Aug 2001
    Location
    Groningen (NL)
    Posts
    2,386
    You assemble the assembly code and compile the C code and then link the object modules together.

    Header files are not linked, they are used by the compiler for definitions and prototypes. If you have a function written in assembly and use it in the C file, you declare it in the C-code as extern. The linker will search for the function when linking, if the linker could not find it, it will give you the message "could not resolve function blahblah".

  3. #3
    Dev
    Dev is offline
    Registered User Dev's Avatar
    Join Date
    Mar 2003
    Posts
    59
    Download Book from this site

    http://www.drpaulcarter.com/pcasm/

    It's really useful if you want to learn about mixing assembly programs with C.

    Uses NASM as assembler.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Profiler Valgrind
    By afflictedd2 in forum C++ Programming
    Replies: 4
    Last Post: 07-18-2008, 10:38 AM
  2. MinGW thread-safe runtime libraries
    By Mario F. in forum C++ Programming
    Replies: 3
    Last Post: 08-21-2006, 09:15 AM
  3. Problems about gcc installation
    By kevin_cat in forum Linux Programming
    Replies: 4
    Last Post: 08-09-2005, 10:05 AM
  4. Two questions (Linking Libraries and Creating Them)
    By Thantos in forum Linux Programming
    Replies: 3
    Last Post: 03-21-2004, 05:01 PM
  5. creating libraries for c++
    By Klinerr1 in forum C++ Programming
    Replies: 33
    Last Post: 08-04-2002, 03:34 AM

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