Using Static Library's in MSVC++

This is a discussion on Using Static Library's in MSVC++ within the C++ Programming forums, part of the General Programming Boards category; How can you create STATIC linked libray's in msvc++? Couldn't find any tutorials on it,nor on this board....

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640

    Question Using Static Library's in MSVC++

    How can you create STATIC linked libray's in msvc++?
    Couldn't find any tutorials on it,nor on this board.

  2. #2
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    my turn to (hopefully) help u for once:

    http://www.gamedev.net/reference/art...rticle1316.asp

  3. #3
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Yeah, i found that site using google too, but funny enough they
    skip the part i need to know, how to export and import functions.

  4. #4
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    *giving the thread the boot*

  5. #5
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    try this?

    http://folk.uio.no/stefanha/StatLibs.pdf

    has a section bout adding to project...

  6. #6
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331

  7. #7
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Hm, saw that already too
    Funny enough at the end of page 2 it skips everything i need to
    know and jumps to the end when compiling, grrr

  8. #8
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    have you tried MSDN?

  9. #9
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Originally posted by RoD
    have you tried MSDN?
    No, will do that, i dont need to know much, just how you declare
    the functions, i know it for DLL's

    Code:
     __declspec(dllexport) void bla();
     __declspec(dllimport) void bla();
    But this doesnt seem to work with LIB's, i get an unresolved
    external error

  10. #10
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    hmm i would think MSDN would have it.

  11. #11
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331

  12. #12
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Oke, so i tried the gametutorial's tutorial about DLL's , and used a
    Static Lib instead of Dynamic, lib compiles fine, but when i try to
    compile the program that uses it it coughs up this

    Code:
     libtester error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl printMessage(void)" (__imp_?printMessage@@YAXXZ) referenced in function _main

  13. #13
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    i got an error close to that once for a misnamed function:

    i had void computescharges prototyp and spelled it

    computercharges

    int he actual function header...

  14. #14
    Registered User
    Join Date
    Sep 2002
    Posts
    1,640
    Yeah, that causes it too, but in this case its because i use a
    LIB instead of DLL, help me out! Are there any opensource LIB's
    around for study?

  15. #15
    RoD
    RoD is offline
    Redundantly Redundant RoD's Avatar
    Join Date
    Sep 2002
    Location
    Missouri
    Posts
    6,331
    have u tried #pragma(lib, "name")

Page 1 of 2 12 LastLast
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Seg Fault in Compare Function
    By tytelizgal in forum C Programming
    Replies: 1
    Last Post: 10-25-2008, 04:06 PM
  2. seg fault at vectornew
    By tytelizgal in forum C Programming
    Replies: 2
    Last Post: 10-25-2008, 02:22 PM
  3. uploading file to http server via multipart form data
    By Dynamo in forum C++ Programming
    Replies: 1
    Last Post: 09-03-2008, 05:36 AM
  4. LNK2001 ERROR!!! need help
    By lifeafterdeath in forum C++ Programming
    Replies: 7
    Last Post: 05-27-2008, 06:05 PM
  5. get keyboard and mouse events
    By ratte in forum Linux Programming
    Replies: 10
    Last Post: 11-17-2007, 05:42 PM

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