Measurement Computing   Easy to Use | Easy to Integrate | Easy to Support catalog banner

Step-By-Step: Compiling and running a C console application in...

Expand / Collapse
 

Step-By-Step: Compiling and running a C console application in C++.NET


Open Visual Studio.NET

Start a new Visual C++, Win32 Console Application

  1. Click on File -> New -> Project
  2. The new Project dialog box appears
  3. In the LEFT window: Open the Visual C++ Projects folder
  4. In the LEFT window: Open the Win32 folder
  5. In the RIGHT window: click once on “Win32 Console Project”
  6. Below enter a name for the project, suggest you enter the name of our sample (for example ulai01)
  7. Click OK
  8. The Win32 Application Wizard dialog box appears
  9. Click on Application Settings
  10. Place a check mark for “Empty project”
  11. Click Finish

Add the Source file

  1. Referring to the Windows Solution Explorer at the right of your VS.NET window,
  2. Right mouse click on the Source Files folder
  3. Select ADD >
  4. Select Existing Item…
  5. The Add existing item dialog box appears
  6. Navigate your way to our source directory c:\Program Files\Measurement Computing\DAQ\c\sample32 and select the .c file you want to compile (for this example ulai01.c) and click OK

Add the library file

  1. Referring to the Windows Solution Explorer at the right of your VS.NET window,
  2. Right mouse click on the Resource Files folder
  3. Select ADD >
  4. Select Add Existing Item…
  5. The Existing Item dialog box appears
  6. Navigate your way to our source directory c:\Program Files\Measurement Computing\DAQ\c (go up one level)
  7. From the list of files, select cbw32.lib, and click OK

Add the header file (.h)

  1. Referring to the Windows Solution Explorer at the right of your VS.NET window,
  2. Right mouse click on the Header Files folder
  3. Select ADD >
  4. Select Existing Item…
  5. The Add Existing Item dialog box appears
  6. Navigate your way to our source directory c:\Program Files\Measurement Computing\DAQ\c
  7. From the list of files, select cbw.h, and click OK

Build the project

 

  1. From the Visual Studio menu, select Build > Build Solution

Run the program by pressing F5




Rate this Article:

Add Your Comments


For comments email TechSupport@mccdaq.com.

Details
Article ID: 50141

Last Modified:6/25/2013 10:18:53 AM

Article has been viewed 3,015 times.

Options