Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble with CMake and Visual C++ 2010

I am trying to get started with Cmake and started with a simple tutorial found on the site. The c++ code is as simple as possible here:

#include <iostream>

int main(int argc, char *argv[])
{
std::cout << "Hello, World!" << std::endl;
return 0;
}

The Cmake file is:

cmake_minimum_required (VERSION 2.6)
project (Tutorial)
add_executable(Tutorial main.cpp)

I generate the Visual Studio C++ solution and project files using the cmake-gui. I am able to build the project, but when I try to run the project I get a prompt stating that the ZERO_CHECK project is out of date and asks if I would like to rebuild it. When I select 'Yes' I get an error stating: 'Unable to start program ..Path../Debug/ALL_BUILD The system cannot find the file specified'. I did a lot of searching but was unable to find anyone who has had a similar error. Has anyone encountered something like this before?

like image 792
Jeff Melton Avatar asked May 12 '12 16:05

Jeff Melton


1 Answers

Usually CMake sets the ALL_BUILD project as the startup project. You should right click on your Tutorial project in the solution explorer and set it as startup project. Then it should work.

like image 187
LiMuBei Avatar answered Sep 20 '22 23:09

LiMuBei