Hello, as you know, if you want load the dll dynamiclly ,you may :
        include  ***.inc
        includelib  ***.lib
  Other, you may use LoadLibrary.


  But, how to link the ***.lib to my exe staticly?

  For example, I wrote  my lib file, and I want to link the lib file to my exe file, just the M$ Visual Studio Static Library.

  Thank you!
Posted on 2005-07-05 08:52:35 by seasea
The answer is simple - use the correct library :)

Some libraries come in both static and DLL versions; if you want to link statically, choose the static library. If you want to link dynamically, use the import library.
Posted on 2005-07-05 09:23:58 by f0dder

The answer is simple - use the correct library :)

Some libraries come in both static and DLL versions; if you want to link statically, choose the static library. If you want to link dynamically, use the import library.


f0dder:

  Thank you.
Posted on 2005-07-06 03:44:39 by seasea
f0dder?

  But, how can I get the statically library?

  I wrote a dll project, for example, max.dll and  max.lib and max.inc, only have one export function Max().
  Then, How can I build the dll project, so that it will be a statically library ?

  Thank you.
Posted on 2005-07-07 20:59:34 by seasea
No idea - where did you get the libraries from? If they don't offer a static version, you're pretty much out of luck... unless you use something like dll2lib, which is pretty buggy.
Posted on 2005-07-07 21:11:43 by f0dder
f0dder:

  What you had posted is something like the following :

  Though I wrote both the library project and the exe project,  I still couldn't compile and link the exe project statically.

  Is that so ?

  But, the M$ Visual Stuido can build a project statically, so the exe only need the 3 system dll.

  Thank you.
Posted on 2005-07-08 06:35:47 by seasea
If you wrote the library, all it takes to build a static-link .lib is to assemble/compile all your source modules, and then use lib.exe to bundle them into a library - et voila! :)
Posted on 2005-07-08 09:46:04 by f0dder
f0dder?

  I think this proble has been resoved.

  when link the library project ,not use link /dll /def:***.def ***.obj, but use link -lib ***.obj.

  Just include ***.inc,  includelib ***.lib in the exe project, then everything is OK.


  f0dder, Thank you.
Posted on 2005-07-11 02:10:57 by seasea
glad to have helped :)
Posted on 2005-07-11 07:23:10 by f0dder