Windouws_7に、Ubuntuと、CmakeとをVirtualBoxでインストールして、ここでCmakeの練習を始めています。
UbuntuのHome下にwindows/01.hello/を作り、
Buildに使う以下の2つのファイルを保存しました。
###1つ目
ruby:hello.cpp
1#include <iostream> 2int main() 3{ 4 std::cout << "Hello, World!!\n"; 5 return 0; 6}
###二つ目
CMakeLists.txt
1project(hello) 2add_executable(hello hello.cpp)
「01.hello」フォルダに来て、そこへ「build」フォルダを作り、
chyfarm@chyfarm-VirtualBox:~/windows/01.hello$ mkdir build
この「build」フォルダへ移動してから
chyfarm@chyfarm-VirtualBox:~/windows/01.hello$ cd build
「cmake」したのですが、
chyfarm@chyfarm-VirtualBox:~/windows/01.hello/build$ cmake
同じように ↓ 構文エラーが出ます。
Usage cmake [options] <path-to-source> cmake [options] <path-to-existing-build> Specify a source directory to (re-)generate a build system for it in the current working directory. Specify an existing build directory to re-generate its build system. chyfarm@chyfarm-VirtualBox:~/windows/01.hello/build$ cmake </windows/01.hello> bash: 予期しないトークン `newline' 周辺に構文エラーがあります
これはどこに誤りがありますか?
<path-to-source>と言うので、いろいろ試したのですが、「bash: 予期しないトークン `newline' 周辺に構文エラーがあります」ばかりで、(頭の中が)混乱して来ました。
:~/windows$ cd .. :~$ cmake build </windows/01.hello> //構文エラー :~$ cmake build <./windows/01.hello> //構文エラー :~$ cmake build <windows/01.hello> //構文エラー :~$ cd windows :~/windows$ cmake --build <01.hello> //構文エラー
よろしくお願いします。
回答1件
あなたの回答
tips
プレビュー