Giter VIP home page Giter VIP logo

cmake-hello-world's Introduction

cmake-hello-world's People

Contributors

jameskbride avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cmake-hello-world's Issues

Problems on up-to-date ubuntu - need to add an include dir.

I'm running stock ubuntu with all the updates, and had issues compiling:

% make
Scanning dependencies of target Hello
[ 50%] Building CXX object Hello/CMakeFiles/Hello.dir/Speaker.cpp.o
Linking CXX static library libHello.a
[ 50%] Built target Hello
Scanning dependencies of target CMakeHelloWorld
[100%] Building CXX object CMakeFiles/CMakeHelloWorld.dir/HelloWorld.cpp.o
/home/lubuntu/cmake-hello-world/HelloWorld.cpp:1:21: fatal error: Speaker.h: No such file or directory
compilation terminated.
make[2]: *** [CMakeFiles/CMakeHelloWorld.dir/HelloWorld.cpp.o] Error 1
make[1]: *** [CMakeFiles/CMakeHelloWorld.dir/all] Error 2
make: *** [all] Error 2

The following change made the issue go away:

git diff -u
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 68be95c..a9bb5c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,6 +7,7 @@ set (CMakeHelloWorld_VERSION_MINOR 0)
 
 #include the subdirectory containing our libs
 add_subdirectory (Hello)
+include_directories(Hello)
 
 #indicate the entry point for the executable
 add_executable (CMakeHelloWorld Hello HelloWorld.cpp)

The C compiler is not able to compile a simple test program. It fails with the following output: make: /Applications/Xcode: No such file or directory

Am not sure if the issue belongs here. . . I have:

- git cloned your project

- created a build dir inside your project sir

- changed to build and cmake ..

am getting the following error:

Last login: Wed Oct 14 13:12:07 on ttys000

The default interactive shell is now zsh.
To update your account to use zsh, please run chsh -s /bin/zsh.
For more details, please visit https://support.apple.com/kb/HT208050.
PrivateNetwork:~ excel$ cd Downloads/
PrivateNetwork:Downloads excel$ git clone https://github.com/jameskbride/cmake-hello-world.git

Cloning into 'cmake-hello-world'...
remote: Enumerating objects: 56, done.
remote: Total 56 (delta 0), reused 0 (delta 0), pack-reused 56
Unpacking objects: 100% (56/56), done.
PrivateNetwork:Downloads excel$ cd cmake-hello-world
PrivateNetwork:cmake-hello-world excel$ ls

CMakeLists.txt Hello HelloWorld.cpp LICENSE README.md
PrivateNetwork:cmake-hello-world excel$ mkdir build
PrivateNetwork:cmake-hello-world excel$ cd build/
PrivateNetwork:build excel$ cmake ..

-bash: cmake: command not found
PrivateNetwork:build excel$ PATH="/Applications/CMake.app/Contents/bin":"$PATH"
PrivateNetwork:build excel$ cmake .
.
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /Applications/Xcode 11.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode 11.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc - broken
CMake Error at /Applications/CMake.app/Contents/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler

"/Applications/Xcode 11.3.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc"

is not able to compile a simple test program.

It fails with the following output:

Change Dir: /Users/excel/Downloads/cmake-hello-world/build/CMakeFiles/CMakeTmp

Run Build Command(s):/usr/bin/make cmTC_faeb8/fast && /Applications/Xcode 11.3.app/Contents/Developer/usr/bin/make  -f CMakeFiles/cmTC_faeb8.dir/build.make CMakeFiles/cmTC_faeb8.dir/build
make: /Applications/Xcode: No such file or directory
make: *** [cmTC_faeb8/fast] Error 1

CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!
See also "/Users/excel/Downloads/cmake-hello-world/build/CMakeFiles/CMakeOutput.log".
See also "/Users/excel/Downloads/cmake-hello-world/build/CMakeFiles/CMakeError.log".
PrivateNetwork:build excel$

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.