Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //tutorial.cpp
- // A simple program that computes the square root of a number
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main (int argc, char *argv[])
- {
- if (argc < 2)
- {
- fprintf(stdout,"Usage: %s number\n",argv[0]);
- return 1;
- }
- double inputValue = atof(argv[1]);
- double outputValue = sqrt(inputValue);
- fprintf(stdout,"The square root of %g is %g\n",
- inputValue, outputValue);
- return 0;
- }
- ------------------------------------------------------
- #CMakeLists.txt
- cmake_minimum_required (VERSION 2.6)
- project (Tutorial)
- add_executable(Tutorial tutorial.cpp)
- ------------------------------
- Environment:
- Windows 7 64 bit
- Windows SDK 7 is installed
- N.B.: No visual studio 2010 is installed
- Commad line:
- Run the following command from the shortcut "Windows SDK 7.1 Command Prompt"
- cmake -G "Visual Studio 10 Win64" .
- ------------------------------------------------------------------------------------
- result when using cmake version: cmake-3.7.1-win64-x64 , FAIL
- -- The C compiler identification is unknown
- -- The CXX compiler identification is unknown
- CMake Error at CMakeLists.txt:2 (project):
- No CMAKE_C_COMPILER could be found.
- CMake Error at CMakeLists.txt:2 (project):
- No CMAKE_CXX_COMPILER could be found.
- -- Configuring incomplete, errors occurred!
- See also "C:/tutor/lab1/CMakeFiles/CMakeOutput.log".
- See also "C:/tutor/lab1/CMakeFiles/CMakeError.log".
- ----------------------------------
- result when using cmake: cmake-3.6.3-win64-x64 , SUCESS
- -- The C compiler identification is MSVC 16.0.30319.1
- -- The CXX compiler identification is MSVC 16.0.30319.1
- -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe
- -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe -- works
- -- Detecting C compiler ABI info
- -- Detecting C compiler ABI info - done
- -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe
- -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/bin/x86_amd64/cl.exe -- works
- -- Detecting CXX compiler ABI info
- -- Detecting CXX compiler ABI info - done
- -- Detecting CXX compile features
- -- Detecting CXX compile features - done
- -- Configuring done
- -- Generating done
- -- Build files have been written to: C:/tutor/lab1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement