MathLibrary and MathClient projects in MS Visual Studio 2015

Home and Applets > Download SVD-GPU Application Source Code > MathLibrary and MathClient Projects in MS Visual Studio 2015

Two projects from Microsoft (Reference 1) are presented. MathLibrary project generates a DLL file and a LIB file that are used by MathClient project. DLLs are linked into a program at run time instead of build time.
Both Visual Studio 2015 projects contain cpp files in Windows 10 X64 environment. CUDA is not involved.

*** Outline ***

  1. MathLibrary project in MS Visual Studio 2015
  2. MathClient project in MS Visual Studio 2015
  3. References

MathLibrary project in MS Visual Studio 2015

  1. In Start Page - Microsoft Visual Studio, select New Project...
  2. Select Win32 Console Application.
    Provid the name of the project: MathLibrary.
    Click OK button.
  3. Welcome to the Win32 Application Wizard panel appears. Click Next > button.
  4. Application Settings panel appears. Tick DLL for Application type.

    Click Finish button.
  5. The Visual Studio editor appears.

    Five files are generated: stdafx.h, targetver.h, stdafx.cpp, dllmain.cpp, and an empty MathLibrary.cpp file.
  6. Select x64 platform.
  7. The project folder contains:


  8. Open MathLibrary.cpp from Reference 1. Copy and paste its content into the source file MathLibrary.cpp.
  9. Right click the folder of Header Files in Solution Explorer for adding a new item. Select Add then New Item...
  10. Select Header File(.h).
    Provid the name of Header File(.h): MathLibrary.h. The file extension is .h.

    Click Add button. An source file appears for editing.
  11. Open MathLibrary.h from Reference 1. Copy and paste its content into the source file MathLibrary.h.
  12. Right click the file MathLibrary.cpp in Solution Explorer. Select Properties.
    The Item Type is C/C++ compiler. Close the panel.
  13. Right click the file MathLibrary.h in Solution Explorer. Select Properties.
    The Item Type is C/C++ header. Close the panel.
  14. Select Build menu then Build Solution.

  15. The project folder contains:


    The files MathLibrary.dll and MathLibrary.lib are generated in the folder C:\Users\Papa\Documents\Visual Studio 2015\Projects\MathLibrary\x64\Debug.

MathClient project in MS Visual Studio 2015

  1. In Start Page, select New Project...
  2. Select Win32 Console Application.
    Provid the name of the project: MathClient.
    Click OK button.
  3. Welcome to the Win32 Application Wizard panel appears. Click Next > button.
  4. Application Settings panel appears. Select Empty project then click Finish button.
  5. The Visual Studio editor appears.
  6. Select x64 platform.
  7. Right click the folder of Source Files in Solution Explorer for adding a new item. Select Add then New Item...
  8. Provid the name of Visual C++ File(.cpp): MathClient.cpp.
    Click Add button.
  9. An empty source file appears for editing.
  10. Open MathClient.cpp from Reference 1. Copy and paste its content into the source file MathClient.cpp.
  11. Right click the folder of Header Files in Solution Explorer for adding a new item. Select Add then New Item...
  12. Select Header File(.h).
    Provid the name of Header File(.h): MathLibrary.h. Click Add button. An source file appears for editing.
  13. Open MathLibrary.h from Reference 1. Copy and paste its content into the source file MathLibrary.h.
  14. Copy the file MathLibrary.lib from the folder C:\Users\Papa\Documents\Visual Studio 2015\Projects\MathLibrary\x64\Debug. Paste it into the folder C:\Users\Papa\Documents\Visual Studio 2015\Projects\MathClient\MathClient.
  15. The project folder contains:


  16. Visual Studio 2015 editor looks like:

  17. Right click the project MathClient in Solution Explorer. Select Properties, Linker, and Input. Add MathLibrary.lib; in Additional Dependencies.

    Click the mouse for activing Appliquer button.
    Click Appliquer button then OK button.
  18. Select Build menu then Rebuild Solution.

  19. The project folder contains:


  20. Select and copy the file MathLibrary.dll from the folder C:\Users\Papa\Documents\Visual Studio 2015\Projects\MathLibrary\x64\Debug. Paste it into the folder C:\Users\Papa\Documents\Visual Studio 2015\Projects\MathClient\x64\Debug.

  21. Select Debug menu then Start Without Debugging

References

  1. Microsoft: Walkthrough: Create and use your own Dynamic Link Library (C++) with Visual Studio 2015
  2. National Instruments: Building a DLL with Visual C++
  3. wikiHow: How to create DLL files

Solid-state NMR bibliography for:

Aluminum-27
Antimony-121/123
Arsenic-75
Barium-135/137
Beryllium-9
Bismuth-209
Boron-11
Bromine-79/81
Calcium-43
Cesium-133
Chlorine-35/37
Chromium-53
Cobalt-59
Copper-63/65
Deuterium-2
Gallium-69/71
Germanium-73
Gold-197
Hafnium-177/179
Indium-113/115
Iodine-127
Iridium-191/193
Krypton-83
Lanthanum-139
Lithium-7
Magnesium-25
Manganese-55
Mercury-201
Molybdenum-95/97
Neon-21
Nickel-61
Niobium-93
Nitrogen-14
Osmium-189
Oxygen-17
Palladium-105
Potassium-39/41
Rhenium-185/187
Rubidium-85/87
Ruthenium-99/101
Scandium-45
Sodium-23
Strontium-87
Sulfur-33
Tantalum-181
Titanium-47/49
Vanadium-51
Xenon-131
Zinc-67
Zirconium-91
[Contact me] - Last updated June 13, 2020
Copyright © 2002-2020 pascal-man.com. All rights reserved.