Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't actually build with different build directory as suggested #45

Closed
315234 opened this issue Nov 27, 2013 · 9 comments
Closed

Can't actually build with different build directory as suggested #45

315234 opened this issue Nov 27, 2013 · 9 comments
Labels
Milestone

Comments

@315234
Copy link

315234 commented Nov 27, 2013

Build fails when building in a separate directory since the compiler cannot find config.h

@rizsotto
Copy link
Owner

thanks for the report. i need some more information in order to help you.

  • what OS/distro?
  • what CMake version?
  • commands (and their outputs) you've executed after git clone?

@315234
Copy link
Author

315234 commented Nov 27, 2013

Here you go (OS X 10.9):

bashprompt:~>git clone https://github.com/rizsotto/Bear.git
Cloning into 'Bear'...
remote: Counting objects: 1552, done.
remote: Compressing objects: 100% (815/815), done.
remote: Total 1552 (delta 802), reused 1454 (delta 721)
Receiving objects: 100% (1552/1552), 291.05 KiB | 307.00 KiB/s, done.
Resolving deltas: 100% (802/802), done.
Checking connectivity... done
bashprompt:~>cd Bear/
bashprompt:Bear>mkdir build
bashprompt:Bear>cd build/
bashprompt:build>cmake ../src/
-- The C compiler identification is Clang 5.0.0
-- The CXX compiler identification is Clang 5.0.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Looking for vfork
-- Looking for vfork - found
-- Looking for execve
-- Looking for execve - found
-- Looking for execv
-- Looking for execv - found
-- Looking for execvpe
-- Looking for execvpe - not found
-- Looking for execvp
-- Looking for execvp - found
-- Looking for execvP
-- Looking for execvP - found
-- Looking for execl
-- Looking for execl - found
-- Looking for execlp
-- Looking for execlp - found
-- Looking for execle
-- Looking for execle - found
-- Looking for _NSGetEnviron
-- Looking for _NSGetEnviron - found
CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 2.8)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /Users/Username/Bear/build
bashprompt:build>make
Scanning dependencies of target bear
[ 10%] Building C object CMakeFiles/bear.dir/stringarray.o
[ 20%] Building C object CMakeFiles/bear.dir/protocol.o
[ 30%] Building C object CMakeFiles/bear.dir/main.o
/Users/Username/Bear/src/main.c:69:24: error: use of undeclared identifier 'DEFAULT_CONFIG_FILE'
        .config_file = DEFAULT_CONFIG_FILE,
                       ^
/Users/Username/Bear/src/main.c:70:24: error: use of undeclared identifier 'DEFAULT_OUTPUT_FILE'
        .output_file = DEFAULT_OUTPUT_FILE,
                       ^
/Users/Username/Bear/src/main.c:71:24: error: use of undeclared identifier 'DEFAULT_PRELOAD_FILE'
        .libear_file = DEFAULT_PRELOAD_FILE,
                       ^
/Users/Username/Bear/src/main.c:347:13: error: use of undeclared identifier 'BEAR_VERSION'
            BEAR_VERSION);
            ^
/Users/Username/Bear/src/main.c:368:13: error: use of undeclared identifier 'DEFAULT_CONFIG_FILE'
            DEFAULT_CONFIG_FILE,
            ^
5 errors generated.
make[2]: *** [CMakeFiles/bear.dir/main.o] Error 1
make[1]: *** [CMakeFiles/bear.dir/all] Error 2
make: *** [all] Error 2
bashprompt:build>which cmake
/usr/local/bin/cmake
bashprompt:build>cmake --version
cmake version 2.8.12.1
bashprompt:build>uname -a
Darwin bashprompt 13.0.0 Darwin Kernel Version 13.0.0: Thu Sep 19 22:22:27 PDT 2013; root:xnu-2422.1.72~6/RELEASE_X86_64 x86_64
bashprompt:build>brew --version
0.9.5

@rizsotto
Copy link
Owner

thanks!
unfortunately i don't have any access to OSX systems.
and i do build this code in a separate build directory since i started this project.
so, can't really reproduce the issue.

@breser
Copy link
Contributor

breser commented Nov 27, 2013

I'll take a look at it.

@rizsotto
Copy link
Owner

Ben, that would be wonderful! :)

@breser
Copy link
Contributor

breser commented Nov 27, 2013

Your cmake command should be:
cmake ..

@breser
Copy link
Contributor

breser commented Nov 27, 2013

I am however seeing a different problem on OS X.

@315234
Copy link
Author

315234 commented Nov 27, 2013

I can build with cmake ... Sorry for the noise.

@rizsotto
Copy link
Owner

thanks guys! i'm closing this ticket then...
Ben, you got a good eyes, i did not catch the '../src' :)

and please report the problem what you see (there is another open ticket for OSX already. ;))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants