Link Dll Dev C++

Nov 29, 2016  Download Dev-C for free. A free, portable, fast and simple C/C IDE. A new and improved fork of Bloodshed Dev-C. External Link. Enterprise is a universal rapid application development platform for build business management solutions in HORECA, Retail, Manufacture, Logistic, Finance and other industries. It has the breadth of. May 23, 2014  General C Programming; Explicit Linking of DLL. Explicit Linking of DLL. Hi all, I am working on Explicit Linking of a DLL to an executable. Theoretically, I really understand what it means. But, when it comes to application, I have some troubles. 1) I try to export a class using C Language approach. (I would ask for other.

Dev.dll Explanationlink

Dev.dll, is a dll file developed by Canon Inc..

The size of this dll file is 0.09 MB and its download links are healthy. It has been downloaded 1104 times already.

Table of Contents

  • Methods to Solve the Dev.dll Errors
    • Method 5: Getting Rid of Dev.dll Errors by Updating the Windows Operating System
Dev

Operating Systems Compatible with the Dev.dll Filelink

Other Versions of the Dev.dll Filelink

The latest version of the Dev.dll file is 7.0.3.0 version released for use on 2012-07-31. Before this, there were 1 versions released. All versions released up till now are listed below from newest to oldest

  1. 7.0.3.0 - 32 Bit (x86) (2012-07-31) Download directly this version now
  2. 7.0.3.0 - 32 Bit (x86)Download directly this version now
Link Dll Dev C++

How to Download Dev.dlllink

  1. First, click the 'Download' button with the green background (The button marked in the picture).
  2. When you click the 'Download' button, the 'Downloading' window will open. Don't close this window until the download process begins. The download process will begin in a few seconds based on your Internet speed and computer.

Methods to Solve the Dev.dll Errorslink

ATTENTION! Before beginning the installation of the Dev.dll file, you must download the file. If you don't know how to download the file or if you are having a problem while downloading, you can look at our download guide a few lines above.

Method 1: Solving the DLL Error by Copying the Dev.dll File to the Windows System Folderlink

  1. The file you downloaded is a compressed file with the extension '.zip'. This file cannot be installed. To be able to install it, first you need to extract the dll file from within it. So, first double-click the file with the '.zip' extension and open the file.
  2. You will see the file named 'Dev.dll' in the window that opens. This is the file you need to install. Click on the dll file with the left button of the mouse. By doing this, you select the file.
  3. Click on the 'Extract To' button, which is marked in the picture. In order to do this, you will need the Winrar software. If you don't have the software, it can be found doing a quick search on the Internet and you can download it (The Winrar software is free).
  4. After clicking the 'Extract to' button, a window where you can choose the location you want will open. Choose the 'Desktop' location in this window and extract the dll file to the desktop by clicking the 'Ok' button.
  5. Copy the 'Dev.dll' file you extracted and paste it into the 'C:WindowsSystem32' folder.
  6. If your operating system has a 64 Bit architecture, copy the 'Dev.dll' file and paste it also into the 'C:WindowssysWOW64' folder.
    NOTE! On 64 Bit systems, the dll file must be in both the 'sysWOW64' folder as well as the 'System32' folder. In other words, you must copy the 'Dev.dll' file into both folders.
  7. In order to complete this step, you must run the Command Prompt as administrator. In order to do this, all you have to do is follow the steps below.
    NOTE! We ran the Command Prompt using Windows 10. If you are using Windows 8.1, Windows 8, Windows 7, Windows Vista or Windows XP, you can use the same method to run the Command Prompt as administrator.
    1. Open the Start Menu and before clicking anywhere, type 'cmd' on your keyboard. This process will enable you to run a search through the Start Menu. We also typed in 'cmd' to bring up the Command Prompt.
    2. Right-click the 'Command Prompt' search result that comes up and click the Run as administrator' option.
  8. Paste the command below into the Command Line that will open up and hit Enter. This command will delete the damaged registry of the Dev.dll file (It will not delete the file we pasted into the System32 folder; it will delete the registry in Regedit. The file we pasted into the System32 folder will not be damaged).
    %windir%System32regsvr32.exe /u Dev.dll
  9. If you have a 64 Bit operating system, after running the command above, you must run the command below. This command will clean the Dev.dll file's damaged registry in 64 Bit as well (The cleaning process will be in the registries in the Registry Editor< only. In other words, the dll file you paste into the SysWoW64 folder will stay as it).
    %windir%SysWoW64regsvr32.exe /u Dev.dll
  10. In order to cleanly recreate the dll file's registry that we deleted, copy the command below and paste it into the Command Line and hit Enter.
    %windir%System32regsvr32.exe /i Dev.dll
  11. If the Windows version you use has 64 Bit architecture, after running the command above, you must run the command below. With this command, you will create a clean registry for the problematic registry of the Dev.dll file that we deleted.
    %windir%SysWoW64regsvr32.exe /i Dev.dll
  12. If you did the processes in full, the installation should have finished successfully. If you received an error from the command line, you don't need to be anxious. Even if the Dev.dll file was installed successfully, you can still receive error messages like these due to some incompatibilities. In order to test whether your dll problem was solved or not, try running the software giving the error message again. If the error is continuing, try the 2nd Method to solve this problem.

Method 2: Copying the Dev.dll File to the Software File Folderlink

  1. First, you need to find the file folder for the software you are receiving the 'Dev.dll not found', 'Dev.dll is missing' or other similar dll errors. In order to do this, right-click on the shortcut for the software and click the Properties option from the options that come up.
  2. Open the software's file folder by clicking on the Open File Location button in the Properties window that comes up.
  3. Copy the Dev.dll file.
  4. Paste the dll file you copied into the software's file folder that we just opened.
  5. When the dll file is moved to the software file folder, it means that the process is completed. Check to see if the problem was solved by running the software giving the error message again. If you are still receiving the error message, you can complete the 3rd Method as an alternative.

Method 3: Uninstalling and Reinstalling the Software that Gives You the Dev.dll Errorlink

  1. Push the 'Windows' + 'R' keys at the same time to open the Run window. Type the command below into the Run window that opens up and hit Enter. This process will open the 'Programs and Features' window.
    appwiz.cpl
  2. On the Programs and Features screen that will come up, you will see the list of softwares on your computer. Find the software that gives you the dll error and with your mouse right-click it. The right-click menu will open. Click the 'Uninstall' option in this menu to start the uninstall process.
  3. You will see a 'Do you want to uninstall this software?' confirmation window. Confirm the process and wait for the software to be completely uninstalled. The uninstall process can take some time. This time will change according to your computer's performance and the size of the software. After the software is uninstalled, restart your computer.
  4. After restarting your computer, reinstall the software that was giving the error.
  5. This process may help the dll problem you are experiencing. If you are continuing to get the same dll error, the problem is most likely with Windows. In order to fix dll problems relating to Windows, complete the 4th Method and 5th Method.

Dev C++ 5.11

Dev

Method 4: Solving the Dev.dll Problem by Using the Windows System File Checker (scf scannow)link

  1. In order to complete this step, you must run the Command Prompt as administrator. In order to do this, all you have to do is follow the steps below.
    NOTE! We ran the Command Prompt using Windows 10. If you are using Windows 8.1, Windows 8, Windows 7, Windows Vista or Windows XP, you can use the same method to run the Command Prompt as administrator.
    1. Open the Start Menu and before clicking anywhere, type 'cmd' on your keyboard. This process will enable you to run a search through the Start Menu. We also typed in 'cmd' to bring up the Command Prompt.
    2. Right-click the 'Command Prompt' search result that comes up and click the Run as administrator' option.
  2. After typing the command below into the Command Line, push Enter.
    sfc /scannow
  3. Depending on your computer's performance and the amount of errors on your system, this process can take some time. You can see the progress on the Command Line. Wait for this process to end. After the scan and repair processes are finished, try running the software giving you errors again.

Method 5: Getting Rid of Dev.dll Errors by Updating the Windows Operating Systemlink

Some softwares need updated dll files. When your operating system is not updated, it cannot fulfill this need. In some situations, updating your operating system can solve the dll errors you are experiencing.

In order to check the update status of your operating system and, if available, to install the latest update packs, we need to begin this process manually.

Depending on which Windows version you use, manual update processes are different. Because of this, we have prepared a special article for each Windows version. You can get our articles relating to the manual update of the Windows version you use from the links below.

Windows Update Guideslink

The Most Seen Dev.dll Errorslink

The Dev.dll file being damaged or for any reason being deleted can cause softwares or Windows system tools(Windows Media Player, Paint, etc.) that use this file to produce an error. Below you can find a list of errors that can be received when the Dev.dll file is missing.

If you have come across one of these errors, you can download the Dev.dll file by clicking on the 'Download' button on the top-left of this page. We explained to you how to use the file you'll download in the above sections of this writing. You can see the suggestions we gave on how to solve your problem by scrolling up on the page.

  1. 'Dev.dll not found.' error
  2. 'The file Dev.dll is missing.' error
  3. 'Dev.dll access violation.' error
  4. 'Cannot register Dev.dll.' error
  5. 'Cannot find Dev.dll.' error
  6. 'This application failed to start because Dev.dll was not found. Re-installing the application may fix this problem.' error

Dll Files Similar to the Dev.dll Filelink

The Location on our Site of the Dev.dll Filelink

  • Canon Inc.
    • Canon Inc. + Windows 10
    • Canon Inc. + Windows 8.1
    • Canon Inc. + Windows 8
    • Canon Inc. + Windows 7
    • Canon Inc. + Windows Vista
    • Canon Inc. + Windows XP
  • Windows 10
  • Windows 8.1
  • Windows 8
  • Windows 7
  • Windows Vista
  • Windows XP
-->

This step-by-step walkthrough shows how to use the Visual Studio IDE to create your own dynamic link library (DLL) written in Microsoft C++ (MSVC). Then it shows how to use the DLL from another C++ app. DLLs (also known as shared libraries in UNIX-based operating systems) are one of the most useful kinds of Windows components. You can use them as a way to share code and resources, and to shrink the size of your apps. DLLs can even make it easier to service and extend your apps.

In this walkthrough, you'll create a DLL that implements some math functions. Then you'll create a console app that uses the functions from the DLL. You'll also get an introduction to some of the programming techniques and conventions used in Windows DLLs.

This walkthrough covers these tasks:

  • Create a DLL project in Visual Studio.

  • Add exported functions and variables to the DLL.

  • Create a console app project in Visual Studio.

  • Use the functions and variables imported from the DLL in the console app.

  • Run the completed app.

Like a statically linked library, a DLL exports variables, functions, and resources by name. A client app imports the names to use those variables, functions, and resources. Unlike a statically linked library, Windows connects the imports in your app to the exports in a DLL at load time or at run time, instead of connecting them at link time. Windows requires extra information that isn't part of the standard C++ compilation model to make these connections. The MSVC compiler implements some Microsoft-specific extensions to C++ to provide this extra information. We explain these extensions as we go.

This walkthrough creates two Visual Studio solutions; one that builds the DLL, and one that builds the client app. The DLL uses the C calling convention. It can be called from apps written in other programming languages, as long as the platform, calling conventions, and linking conventions match. The client app uses implicit linking, where Windows links the app to the DLL at load-time. This linking lets the app call the DLL-supplied functions just like the functions in a statically linked library.

This walkthrough doesn't cover some common situations. The code doesn't show the use of C++ DLLs by other programming languages. It doesn't show how to create a resource-only DLL, or how to use explicit linking to load DLLs at run-time rather than at load-time. Rest assured, you can use MSVC and Visual Studio to do all these things.

For links to more information about DLLs, see Create C/C++ DLLs in Visual Studio. For more information about implicit linking and explicit linking, see Determine which linking method to use. For information about creating C++ DLLs for use with programming languages that use C-language linkage conventions, see Exporting C++ functions for use in C-language executables. For information about how to create DLLs for use with .NET languages, see Calling DLL Functions from Visual Basic Applications.

Prerequisites

  • A computer that runs Microsoft Windows 7 or later versions. We recommend Windows 10 for the best development experience.
  • A copy of Visual Studio. For information on how to download and install Visual Studio, see Install Visual Studio. When you run the installer, make sure that the Desktop development with C++ workload is checked. Don't worry if you didn't install this workload when you installed Visual Studio. You can run the installer again and install it now.

  • A copy of Visual Studio. For information on how to download and install Visual Studio 2015, see Install Visual Studio 2015. Use a Custom installation to install the C++ compiler and tools, since they're not installed by default.
  • An understanding of the basics of using the Visual Studio IDE. If you've used Windows desktop apps before, you can probably keep up. For an introduction, see Visual Studio IDE feature tour.

  • An understanding of enough of the fundamentals of the C++ language to follow along. Don't worry, we don't do anything too complicated.

Note

This walkthrough assumes you're using Visual Studio 2017 version 15.9 or later. Some earlier versions of Visual Studio 2017 had defects in the code templates, or used different user interface dialogs. To avoid problems, use the Visual Studio Installer to update Visual Studio 2017 to version 15.9 or later.

Create the DLL project

In this set of tasks, you create a project for your DLL, add code, and build it. To begin, start the Visual Studio IDE, and sign in if you need to. The instructions vary slightly depending on which version of Visual Studio you're using. Make sure you have the correct version selected in the control in the upper left of this page.

To create a DLL project in Visual Studio 2019

  1. On the menu bar, choose File > New > Project to open the Create a New Project dialog box.

  2. At the top of the dialog, set Language to C++, set Platform to Windows, and set Project type to Library.

  3. From the filtered list of project types, select Dynamic-link Library (DLL), and then choose Next.

  4. In the Configure your new project page, enter MathLibrary in the Project name box to specify a name for the project. Leave the default Location and Solution name values. Set Solution to Create new solution. Uncheck Place solution and project in the same directory if it's checked.

  5. Choose the Create button to create the project.

When the solution is created, you can see the generated project and source files in the Solution Explorer window in Visual Studio.

To create a DLL project in Visual Studio 2017

  1. On the menu bar, choose File > New > Project to open the New Project dialog box.

  2. In the left pane of the New Project dialog box, select Installed > Visual C++ > Windows Desktop. In the center pane, select Dynamic-Link Library (DLL). Enter MathLibrary in the Name box to specify a name for the project. Leave the default Location and Solution name values. Set Solution to Create new solution. Check Create directory for solution if it's unchecked.

  3. Choose the OK button to create the project.

When the solution is created, you can see the generated project and source files in the Solution Explorer window in Visual Studio.

To create a DLL project in Visual Studio 2015 and older versions

  1. On the menu bar, choose File > New > Project.

  2. In the left pane of the New Project dialog box, expand Installed > Templates, and select Visual C++, and then in the center pane, select Win32 Console Application. Enter MathLibrary in the Name edit box to specify a name for the project. Leave the default Location and Solution name values. Set Solution to Create new solution. Check Create directory for solution if it's unchecked.

  3. Choose the OK button to dismiss the New Project dialog and start the Win32 Application Wizard.

  4. Choose the Next button. On the Application Settings page, under Application type, select DLL.

  5. Choose the Finish button to create the project.

When the wizard completes the solution, you can see the generated project and source files in the Solution Explorer window in Visual Studio.

Right now, this DLL doesn't do very much. Next, you'll create a header file to declare the functions your DLL exports, and then add the function definitions to the DLL to make it more useful.

To add a header file to the DLL

  1. To create a header file for your functions, on the menu bar, choose Project > Add New Item.

  2. In the Add New Item dialog box, in the left pane, select Visual C++. In the center pane, select Header File (.h). Specify MathLibrary.h as the name for the header file.

  3. Choose the Add button to generate a blank header file, which is displayed in a new editor window.

  4. Replace the contents of the header file with this code:

This header file declares some functions to produce a generalized Fibonacci sequence, given two initial values. A call to fibonacci_init(1, 1) generates the familiar Fibonacci number sequence.

Notice the preprocessor statements at the top of the file. The new project template for a DLL project adds PROJECTNAME_EXPORTS to the defined preprocessor macros. In this example, Visual Studio defines MATHLIBRARY_EXPORTS when your MathLibrary DLL project is built.

When the MATHLIBRARY_EXPORTS macro is defined, the MATHLIBRARY_API macro sets the __declspec(dllexport) modifier on the function declarations. This modifier tells the compiler and linker to export a function or variable from the DLL for use by other applications. When MATHLIBRARY_EXPORTS is undefined, for example, when the header file is included by a client application, MATHLIBRARY_API applies the __declspec(dllimport) modifier to the declarations. This modifier optimizes the import of the function or variable in an application. For more information, see dllexport, dllimport.

To add an implementation to the DLL

  1. In Solution Explorer, right-click on the Source Files node and choose Add > New Item. Create a new .cpp file called MathLibrary.cpp, in the same way that you added a new header file in the previous step.

  2. In the editor window, select the tab for MathLibrary.cpp if it's already open. If not, in Solution Explorer, double-click MathLibrary.cpp in the Source Files folder of the MathLibrary project to open it.

  3. In the editor, replace the contents of the MathLibrary.cpp file with the following code:

  1. In the editor window, select the tab for MathLibrary.cpp if it's already open. If not, in Solution Explorer, double-click MathLibrary.cpp in the Source Files folder of the MathLibrary project to open it.

  2. In the editor, replace the contents of the MathLibrary.cpp file with the following code:

To verify that everything works so far, compile the dynamic link library. To compile, choose Build > Build Solution on the menu bar. The DLL and related compiler output are placed in a folder called Debug directly below the solution folder. If you create a Release build, the output is placed in a folder called Release. The output should look something like this:

Congratulations, you've created a DLL using Visual Studio! Next, you'll create a client app that uses the functions exported by the DLL.

Create a client app that uses the DLL

When you create a DLL, think about how client apps may use it. To call the functions or access the data exported by a DLL, client source code must have the declarations available at compile time. At link time, the linker requires information to resolve the function calls or data accesses. A DLL supplies this information in an import library, a file that contains information about how to find the functions and data, instead of the actual code. And at run time, the DLL must be available to the client, in a location that the operating system can find.

Whether it's your own or from a third-party, your client app project needs several pieces of information to use a DLL. It needs to find the headers that declare the DLL exports, the import libraries for the linker, and the DLL itself. One solution is to copy all of these files into your client project. For third-party DLLs that are unlikely to change while your client is in development, this method may be the best way to use them. However, when you also build the DLL, it's better to avoid duplication. If you make a local copy of DLL files that are under development, you may accidentally change a header file in one copy but not the other, or use an out-of-date library.

To avoid out-of-sync code, we recommend you set the include path in your client project to include the DLL header files directly from your DLL project. Also, set the library path in your client project to include the DLL import libraries from the DLL project. And finally, copy the built DLL from the DLL project into your client build output directory. This step allows your client app to use the same DLL code you build.

To create a client app in Visual Studio

  1. On the menu bar, choose File > New > Project to open the Create a new project dialog box.

  2. At the top of the dialog, set Language to C++, set Platform to Windows, and set Project type to Console.

  3. From the filtered list of project types, choose Console App then choose Next.

  4. In the Configure your new project page, enter MathClient in the Project name box to specify a name for the project. Leave the default Location and Solution name values. Set Solution to Create new solution. Uncheck Place solution and project in the same directory if it's checked.

  5. Choose the Create button to create the client project.

A minimal console application project is created for you. The name for the main source file is the same as the project name that you entered earlier. In this example, it's named MathClient.cpp. You can build it, but it doesn't use your DLL yet.

To create a client app in Visual Studio 2017

  1. To create a C++ app that uses the DLL that you created, on the menu bar, choose File > New > Project.

  2. In the left pane of the New Project dialog, select Windows Desktop under Installed > Visual C++. In the center pane, select Windows Console Application. Specify the name for the project, MathClient, in the Name edit box. Leave the default Location and Solution name values. Set Solution to Create new solution. Check Create directory for solution if it's unchecked.

  3. Choose OK to create the client app project.

A minimal console application project is created for you. The name for the main source file is the same as the project name that you entered earlier. In this example, it's named MathClient.cpp. You can build it, but it doesn't use your DLL yet.

To create a client app in Visual Studio 2015

  1. To create a C++ app that uses the DLL that you created, on the menu bar, choose File > New > Project.

  2. In the left pane of the New Project dialog, select Win32 under Installed > Templates > Visual C++. In the center pane, select Win32 Console Application. Specify the name for the project, MathClient, in the Name edit box. Leave the default Location and Solution name values. Set Solution to Create new solution. Check Create directory for solution if it's unchecked.

  3. Choose the OK button to dismiss the New Project dialog and start the Win32 Application Wizard. On the Overview page of the Win32 Application Wizard dialog box, choose the Next button.

  4. On the Application Settings page, under Application type, select Console application if it isn't already selected.

  5. Choose the Finish button to create the project.

When the wizard finishes, a minimal console application project is created for you. The name for the main source file is the same as the project name that you entered earlier. In this example, it's named MathClient.cpp. You can build it, but it doesn't use your DLL yet.

Link Dll Dev C Download

Next, to call the MathLibrary functions in your source code, your project must include the MathLibrary.h file. You could copy this header file into your client app project, then add it to the project as an existing item. This method can be a good choice for third-party libraries. However, if you're working on the code for your DLL and your client at the same time, the header files could get out of sync. To avoid this issue, set the Additional Include Directories path in your project to include the path to the original header.

To add the DLL header to your include path

  1. Right-click on the MathClient node in Solution Explorer to open the Property Pages dialog.

  2. In the Configuration drop-down box, select All Configurations if it's not already selected.

  3. In the left pane, select Configuration Properties > C/C++ > General.

  4. In the property pane, select the drop-down control next to the Additional Include Directories edit box, and then choose Edit.

  5. Double-click in the top pane of the Additional Include Directories dialog box to enable an edit control. Or, choose the folder icon to create a new entry.

  6. In the edit control, specify the path to the location of the MathLibrary.h header file. You can choose the ellipsis (...) control to browse to the correct folder.

    You can also enter a relative path from your client source files to the folder that contains the DLL header files. If you followed the directions to put your client project in a separate solution from the DLL, the relative path should look like this:

    ....MathLibraryMathLibrary

    If your DLL and client projects are in the same solution, the relative path might look like this:

    ..MathLibrary

    When the DLL and client projects are in other folders, adjust the relative path to match. Or, use the ellipsis control to browse for the folder.

  7. After you've entered the path to the header file in the Additional Include Directories dialog box, choose the OK button. In the Property Pages dialog box, choose the OK button to save your changes.

Dev C++ For Windows 10

You can now include the MathLibrary.h file and use the functions it declares in your client application. Replace the contents of MathClient.cpp by using this code:

This code can be compiled, but not linked. If you build the client app now, the error list shows several LNK2019 errors. That's because your project is missing some information: You haven't specified that your project has a dependency on the MathLibrary.lib library yet. And, you haven't told the linker how to find the MathLibrary.lib file.

Dev C++ Download Windows 10

To fix this issue, you could copy the library file directly into your client app project. The linker would find and use it automatically. However, if both the library and the client app are under development, that might lead to changes in one copy that aren't shown in the other. To avoid this issue, you can set the Additional Dependencies property to tell the build system that your project depends on MathLibrary.lib. And, you can set an Additional Library Directories path in your project to include the path to the original library when you link.

To add the DLL import library to your project

  1. Right-click on the MathClient node in Solution Explorer and choose Properties to open the Property Pages dialog.

  2. In the Configuration drop-down box, select All Configurations if it's not already selected. It ensures that any property changes apply to both Debug and Release builds.

  3. In the left pane, select Configuration Properties > Linker > Input. In the property pane, select the drop-down control next to the Additional Dependencies edit box, and then choose Edit.

  4. In the Additional Dependencies dialog, add MathLibrary.lib to the list in the top edit control.

  5. Choose OK to go back to the Property Pages dialog box.

  6. In the left pane, select Configuration Properties > Linker > General. In the property pane, select the drop-down control next to the Additional Library Directories edit box, and then choose Edit.

  7. Double-click in the top pane of the Additional Library Directories dialog box to enable an edit control. In the edit control, specify the path to the location of the MathLibrary.lib file. By default, it's in a folder called Debug directly under the DLL solution folder. If you create a release build, the file is placed in a folder called Release. You can use the $(IntDir) macro so that the linker can find your DLL, no matter which kind of build you create. If you followed the directions to put your client project in a separate solution from the DLL project, the relative path should look like this:

    ....MathLibrary$(IntDir)

    If your DLL and client projects are in other locations, adjust the relative path to match.

  8. Once you've entered the path to the library file in the Additional Library Directories dialog box, choose the OK button to go back to the Property Pages dialog box. Choose OK to save the property changes.

Your client app can now compile and link successfully, but it still doesn't have everything it needs to run. When the operating system loads your app, it looks for the MathLibrary DLL. If it can't find the DLL in certain system directories, the environment path, or the local app directory, the load fails. Depending on the operating system, you'll see an error message like this:

One way to avoid this issue is to copy the DLL to the directory that contains your client executable as part of the build process. You can add a Post-Build Event to your project, to add a command that copies the DLL to your build output directory. The command specified here copies the DLL only if it's missing or has changed. It uses macros to copy to and from the Debug or Release locations, based on your build configuration.

To copy the DLL in a post-build event

  1. Right-click on the MathClient node in Solution Explorer and choose Properties to open the Property Pages dialog.

  2. In the Configuration drop-down box, select All Configurations if it isn't already selected.

  3. In the left pane, select Configuration Properties > Build Events > Post-Build Event.

  4. In the property pane, select the edit control in the Command Line field. If you followed the directions to put your client project in a separate solution from the DLL project, then enter this command:

    xcopy /y /d '....MathLibrary$(IntDir)MathLibrary.dll' '$(OutDir)'

    If your DLL and client projects are in other directories, change the relative path to the DLL to match.

  5. Choose the OK button to save your changes to the project properties.

C++ Static Link Dll

Now your client app has everything it needs to build and run. Build the application by choosing Build > Build Solution on the menu bar. The Output window in Visual Studio should have something like the following example depending on your version of Visual Studio:

Congratulations, you've created an application that calls functions in your DLL. Now run your application to see what it does. On the menu bar, choose Debug > Start Without Debugging. Visual Studio opens a command window for the program to run in. The last part of the output should look like:

Press any key to dismiss the command window.

Now that you've created a DLL and a client application, you can experiment. Try setting breakpoints in the code of the client app, and run the app in the debugger. See what happens when you step into a library call. Add other functions to the library, or write another client app that uses your DLL.

Dev C++ Link Dll

When you deploy your app, you must also deploy the DLLs it uses. The simplest way to make the DLLs that you build, or that you include from third parties, available is to put them in the same directory as your app. It's known as app-local deployment. For more information about deployment, see Deployment in Visual C++.

See also