Creation of .dll file from .C file - dll

I want to know which compiler I can use to create a .dll file from a .C file.
I cant find any tutorial how to create a .dll file from a C file.
I am new to creating dll files . Please help
Thanks in advance

You mention that you want to create a DLL from a .C file. Just to clarify, are you using C (.c file) or C++ (.cpp) to write your code?Also, if you are using C++, are you using Visual Studio?
If you are using C: National Instruments provides an ANSI C Application Development Environment called LabWindows/CVI which makes building dlls a snap. It has templates for DLLs and you can build them either as stdcall or cdecl dlls.
Building a DLL with LabWindows/CVI 8.5 for use with LabVIEW 8.5
If you are using Visual C++: Look at the link that Al provided earlier.
Walkthrough: Creating and Using a Dynamic Link Library (C++)
If you aren't using CVI or Visual Studio, then really the best bet is to do a google search for "Create C DLL".
I would suggest if you have .C file go with Eclipse
EDITED
Eclipse Managed Build
+
Shared libraries with Eclipse CDT and cygwin on Windows

Related

How can I build the documentation for the EPPlus library?

I just downloaded the EPPlus library from GitHub. That's a library for working with Excel files in C#. The only documentation provided is a Sandcastle Help File Builder project (EPPlusDoc.shfbproj). I downloaded Sandcastle, opened the project in Visual Studio 2017 and ran it. I got an error message saying "BUILD FAILED: You must specify at least one documentation source in the form of an assembly or a Visual Studio solution/project file. The project shows two documentation sources: EPPlus.dll and EPPlus.xml. What do I have to do to build the documentation for this library?
(And why the heck didn't the developer just provide a simple .chm file instead of making me go through this exercise myself?

How can I DllImport a file from resources using VB.NET?

Is there any way in VB.NET to DllImport a dll file from the resources?
I really don't want to add the dll with the executable path.
You can embed a DLL into an executable:
Jeffrey Richter: Excerpt #2 from CLR via C#, Third Edition
Many applications consist of an EXE file that depends on many DLL
files. When deploying this application, all the files must be
deployed. However, there is a technique that you can use to deploy
just a single EXE file. First, identify all the DLL files that your
EXE file depends on that do not ship as part of the Microsoft .NET
Framework itself. Then add these DLLs to your Visual Studio project.
For each DLL file you add, display its properties and change its
“Build Action” to “Embedded Resource.” This causes the C# compiler to
embed the DLL file(s) into your EXE file, and you can deploy this one
EXE file.
At runtime, the CLR won’t be able to find the dependent DLL
assemblies, which is a problem. To fix this, when your application
initializes, register a callback method with the AppDomain’s
ResolveAssembly event.

Why implicit linking to DLL needs a lib file on Windows

On Linux platforms you need only the .so file when you want to implicitly link to it.
Why Microsoft developed the approach where you need a .lib file also. Doesn't the DLL contain all the information for the linker to be able to link to it?
From my experience the "Windows way" is more clumsy and creates problems when you want to mix different compilers and linkers.

Statically link to the dll files

I have already built a project, and run it in VS2010.
But if I want to run the .exe on other computers which does not
install Visual Studio, it will need .dll files (such as msvcrt.dll and
msvcp60.dll in WINDOWS\SYSTEM32, and some other dlls in the
development package). I didn't use MFC in this project. How to static
link all these dlls into the .exe file in Visual C++ so that I don't
have to copy all the dlls to the other machines?
BTW: I don't want to make install package either
Thanks
Siba
You can set your project to statically link the CRT, by using the /MT flag for the runtime library. Or, you could keep the /MD setting, and install the vcredist package along with your executable (you can get it from here, and also from one of your VS2010 installation folders). To get an idea of each options pros and cons, read this.
Oh, and a similar question has been asked before...

How to create DLL library on Windows with WxWidgets?

I'm looking for a simple example how to create a DLL library on Windows with WxWidgets.
I need use some wxWidgets API on DLL and it'll called from Delphi.
There is the "dll" sample showing how to do it in your wxWidgets directory or you can view it online at https://github.com/wxWidgets/wxWidgets/tree/v3.1.0/samples/dll
I think the easiest way is to install the free Visual C++ Express Edition, compile the DLL with that (Visual Studio project files are provided with WxWidgets). If it still works like in the old days, then you will also have to import the library for use in delphi with with the implib command.