Tech Articles

Sample C program to test Visual Studio C compiler configuration


Tech Articles ID    KB8020812
Status:    Published
Published date:    11/14/2012
Updated:    02/13/2020
Reported In:   Easy5 - EASY5
Environment:   x86-64 (AMD64 and EM_64T)
  Intel IA-32 (32-bit compat)
Created with Version:   EASY5 (2018.0.2)
 

Abstract (Question)

This KB describes how to execute a simple C code program to test the configuration of the Visual Studio C compiler outside of EASY5 on a Windows machine. Successful completion of the compile and linking process ensures that the compiler environment is configured properly.

Description (Answer)

Please perform the TEST number that EASY5 Tech Support specifies. If you have not been given a specific Test number(s) to try, then do all three and report back the results of all the tests performed to EASY5 Tech Support. Please be specific as to which test(s) you performed, how far through the test(s) you got, and the resulting error messasge(s) or output.


TEST 1:

1. Save the attached C code program "test.c" into a working directory.

2. Open a Windows Command Shell

3. Change into the working directory where you placed the test  program.

4. Then execute the following line (command IS CASE SENSITIVE):
cl test.c
 

5. It should come back with compiler and linker versions and also
-out:test.exe
test.obj

If this is the case, the compilation was successful. Now go to step 6.
If it came back with an error message, contact EASY5 tech support with the exact text (or screenshot) of the error message reported.

6. Once the file has been successfully compiled, execute the program by typing in:
test.exe
It should come back with the response:
Hello World
If this is the case, the c compiler is configured and operating successfully. If it gives any error messages, contact EASY5 tech support with those messages.


TEST 2:

1. Save the attached c code program "test.c" into a working directory (if you haven't already done so from a previous test).

2. Open the Visual Studio Compiler Environment Command Shell. To do this, follow the steps for your specific compiler version and operating system:


- For Microsoft Visual Studio 2005, 2008 or 2010, running on 32 bit Windows, go to Start > All Programs > Microsoft Visual Studio (version) > Visual Studio Tools >Visual Studio (version) Command Prompt (version)

- For Microsoft Visual Studio 2008 or later, running on 64 bit Windows, go to Start > All Programs > Microsoft Visual Studio (version) > Visual Studio Tools >Visual Studio (version) x64 Win64 Command Prompt (version),   or it may be in      Start > All Programs > Microsoft Visual Studio (version) > Developer Command Prompt   or something similar depending on the compiler version and your particular installation.
 

3. Change into the working directory where you placed the test program.

4. Then execute the following line (command IS CASE SENSITIVE):
cl test.c
 

5. It should come back with compiler and linker versions and also
-out:test.exe
test.obj

If this is the case, the compilation was sucessful. Now go to step 6.
If it came back with an error message, contact EASY5 tech support with the exact text (or screenshot) of the error message reported.

6. Once the file has been sucessfully compiled, execute the program by typing in:
test.exe
It should come back with the response:
Hello World
If this is the case, the c compiler is configured and operating sucessfully. If it gives any error messages, contact EASY5 tech support with those messages.


TEST 3:

1. Save the attached c code program "test.c" into a working directory (if you haven't already done so from a previous test).

2. Open an EASY5 Command Shell from the Start menu. (To do this, go to Start > All Programs > MSC.Software > (EASY5 version) > Shell > EASY5 Command Shell.)

3. Change into the working directory where you placed the test Fortran program.

4. Then execute the following line (command IS CASE SENSITIVE):
cl test.c
 

5. It should come back with compiler and linker versions and also
-out:test.exe
test.obj

If this is the case, the compilation was successful. Now go to step 6.
If it came back with an error message, contact EASY5 tech support with the exact text (or screenshot) of the error message reported.

6. Once the file has been successfully compiled, execute the program by typing in:
test.exe
It should come back with the response:
Hello World
If this is the case, the c compiler is configured and operating sucessfully. If it gives any error messages, contact EASY5 tech support with those messages.

English Attachment

test.c
94Bytes • < 1 minute @ 56k, < 1 minute @ broadband



Rate this Page
Rate the quality of this article from 5 (high) to 1 (low):
1
2
3
4
5
 
How can we improve this?