Skip to main content
gamedev.net
🔒 Locked

DLLs

Started by The Lion King 10 replies 1.5k views
Original Post
The Lion King
The Lion King
Hi, I have created DLLs with Visual C++ 6 and the compiler generates both .dll and .lib while so that we can add it either at run-time or compile time. But ... I have started using Visual Studio .NET now ... and when I create a DLL and compile it, it only makes a .dll file ... no .lib file. Is there something I have to do to get the .lib file with the DLL? Thanks! I can survive anything ... even NUKES!!! The Lion King
Zipster
Zipster
.NET does things differently. For starters, everything is contained in "assemblies", which are either EXE files or DLL files. If you want to use a DLL in a .NET project, you don''t link with a library, you reference an assembly (you can only reference DLL assemblies in this way) and the IDE extracts all the classes and functions from the assembly. You can then begin using them.

Now, are you using managed extensions? It sounds like you don''t want to, because if you''re still writing unmanaged C++ code, you''ll still want that library file. However managed extensions tell MSVC not to create it, because it thinks you''re writing a .NET application where only the DLL would be needed.
_the_phantom_
_the_phantom_
if you start a normal C++ Win32 project, change it to a DLL and bash compile it will produce both a .lib and a .dll file
The Lion King
The Lion King
No ... I am not using .NET ...

so ... you mean that I cannot use dlls created with Visual Studio .NET during compile time ...
The Lion King
The Lion King
quote:
Original post by _the_phantom_
if you start a normal C++ Win32 project, change it to a DLL and bash compile it will produce both a .lib and a .dll file

It works in Visual C++ 6 but not in Visual Studio .NET 2003 ... that is what I am asking ... how do I make one ?

plotark
plotark
Are you sure you used __declspec(dllexport) stuff in your project? If not Visual don''t create lib file. You can have a look to the directory where your iib file is created in properties/link/Advanced/Import library

Plotark
Zipster
Zipster
I''m sorry, I might not have been clear enough... you need to turn off managed extensions from your project options. Project Properties -> Configuration Properties -> General -> Use Managed Extensions.
The Lion King
The Lion King
No ... I am using the .def file ... does that have to do something with it :?

Thanks Zipster ... I haven''t tried that ... I will when I will reach home
ArmitageIII87
ArmitageIII87
This one is subtle...you must export something in order to generate your .lib and .exp files in VS .NET. This was not a requirement in VS 6.0. www.codeproject.com has tons of examples of how to use Dll''s exporting classes and functions.
ArmitageIII87
ArmitageIII87
I''m assuming you are writing C/C++ correct. I noticed that there were some posts talking about managed code and the such.
The Lion King
The Lion King
the .def file I think is used for exporting isn''t it ... anyway I haven''t tried the other option ... I will try it when I will get home.

And like I mentioned before I am using just plain C++ no managed stuff

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.