dlls to store used functions

Started by
12 comments, last by J_T_Biggs 22 years, 4 months ago
i am using a dll file in my game (with Win32 Dynamic Lybrary Workspace) and when it compiles isn''t it supposed to create a .lib file so that i can link the lib file and dll to other projects? also, how exactly do i link the dll to the other projects so that when i compile a workspace that requires sourcefiles from a dll i don''t get error?
-------------------------J_T_Biggs - 2001
Advertisement
Producing the .lib file:

Project->Settings->Link->General pulldown menu

There''s a checkbox "Doesn''t produce .LIB". Make sure that''s not checked.


To set up dependencies, go to Project->Dependencies and set up the projects in your workspace.

*WARNING* Visual Studio isn''t perfect about this. If you''re using incremental build, it will sometimes not compile a dependency and it can cause some strange errors. To fix it, just go to Build->Rebuild All. That will force all dependencies and your current project to build.
i was looking at the half life dll files and when they compile it says:

Linking...
Creating library .\Debug/client.lib and object .\Debug/client.exp
Copying to \half-life\mp\cl_dlls
1 file(s) copied

my file does not say creating library... and i don''t have doesn''t create lib set... what could be my problem?
-------------------------J_T_Biggs - 2001
i get other problems to:

Deleting intermediate files and output files for project ''mf - Win32 Debug''.
Deleting intermediate files and output files for project ''DarkOre - Win32 Debug''.
--------------------Configuration: mf - Win32 Debug--------------------
Compiling...
MapFile.cpp
Linking...
--------------------Configuration: DarkOre - Win32 Debug--------------------
Compiling...
data.cpp
glfxnz.cpp
main.cpp
MapFile.cpp
OreImage.cpp
render.cpp
Linking...
LINK : fatal error LNK1104: cannot open file "\Steve\Dark Ore\mf\Debug\mf.lib"
Error executing link.exe.

DarkOre.exe - 1 error(s), 0 warning(s)
-------------------------J_T_Biggs - 2001
Hmm, I''d have to see the project / workspace files, but you may not have the projects setup correctly. Is the mf project a ''Win32 Dynamic Link Library'' project?

And are you sure that the .lib file doesn''t get produced? It would be in mf/debug/mf.lib. It may be created and the DarkOre project might just be referencing the lib file by a bad absolute / relative path.
yes the project is a win32 dynamic link library and ive checked and mf.lib is not created... and its not only this project... ive also tried to make similar dll files and none of them have created .lib
-------------------------J_T_Biggs - 2001
Are you including mf.lib in your additional libraries path? If you are, you do not need to include the built libs in the projects library path, they are automatically included. Also, that message may appear if
1. The lib already exists and is read only
2. The path to create the lib is invalid.

Check out these settings.



-----------------------------
kevin@mayday-anime.com
http://games.mayday-anime.com
-----------------------------kevin@mayday-anime.comhttp://www.mayday-anime.com
I dont think any of those things are my problem:

http://www.mnuniverse.com/files/Image2.jpg

Edited by - J_T_Biggs on December 10, 2001 5:38:16 PM
-------------------------J_T_Biggs - 2001
I''ve had this problem before. Are you exporting any functions? Example, do you have something that looks like this:
  VOID SomeFunction();  

or something that looks like this?
  VOID __declspec(dllexport) SomeFunction();  

if it''s the first one, you arent exporting any symbols, and MSVC wont produce a .lib, as it assumes that you dont want one. What you have to do is add the __declspec(dllexport) to all of your functions, like I have it up there, and then in another header that you can include in another project, have the same prototypes as above, except using __declspec(dllimport), to tell the compiler that you are importing that function, and to link with the lib.

Z.
______________"Evil is Loud"
I just saw that you set the output to mf.dll I guess that has to be an error you are trying to do a lib. Do not specify an output name ever except if you need something special.

If you go to your debug directory, you''ll prob find a mf.dll simply rename that to mf.lib and you are going.

You could also try to dumpbin the file to see what it exports in order to make sure that you set up the exports right.

Hope this helps

-- Sturm

P.S.
And remember never specify a name in the debug, if it''s not needed. If in doubt simply DONT DO IT.

---------------------------------------------------
Life after death? No thanks, I want to live NOW
--- Sturm 2001
---------------------------------------------------Life after death? No thanks, I want to live NOW --- Sturm 2001

This topic is closed to new replies.

Advertisement