Thread: creating libraries in c

  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,380
    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
    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, 09:38 AM
  2. MinGW thread-safe runtime libraries
    By Mario F. in forum C++ Programming
    Replies: 3
    Last Post: 08-21-2006, 08:15 AM
  3. Problems about gcc installation
    By kevin_cat in forum Linux Programming
    Replies: 4
    Last Post: 08-09-2005, 09: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, 02:34 AM