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

Ubuntu 13.04 compilation error #50

Closed
Ericson2314 opened this issue Sep 4, 2013 · 21 comments
Closed

Ubuntu 13.04 compilation error #50

Ericson2314 opened this issue Sep 4, 2013 · 21 comments

Comments

@Ericson2314
Copy link
Contributor

Got this error compiling openSpades. Looks like some header file is missing, or some #define or lack there of is hiding something maybe?

Building CXX object Sources/CMakeFiles/OpenSpades.dir/Core/ConcurrentDispatch.cpp.o
<some/path>/openspades/Sources/Core/ConcurrentDispatch.cpp: In function ‘int GetNumCores()’:
<some/path>/openspades/Sources/Core/ConcurrentDispatch.cpp:65:20: error: ‘_SC_NPROCESSORS_ONLN’ was not declared in this scope
<some/path>/openspades/Sources/Core/ConcurrentDispatch.cpp:65:40: error: ‘sysconf’ was not declared in this scope
In file included from <some/path>/openspades/Sources/Core/ConcurrentDispatch.cpp:22:0:
<some/path>/openspades/Sources/Core/ConcurrentDispatch.h: In constructor ‘spades::ConcurrentDispatch::ConcurrentDispatch(std::string)’:
<some/path>/openspades/Sources/Core/ConcurrentDispatch.h:52:29: warning: ‘spades::ConcurrentDispatch::entry’ will be initialized after [-Wreorder]
<some/path>/openspades/Sources/Core/ConcurrentDispatch.h:51:15: warning:   ‘std::string spades::ConcurrentDispatch::name’ [-Wreorder]
<some/path>/openspades/Sources/Core/ConcurrentDispatch.cpp:237:2: warning:   when initialized here [-Wreorder]
<some/path>/openspades/Sources/Core/ConcurrentDispatch.cpp: In function ‘int GetNumCores()’:
<some/path>/openspades/Sources/Core/ConcurrentDispatch.cpp:67:1: warning: control reaches end of non-void function [-Wreturn-type]
make[3]: *** [Sources/CMakeFiles/OpenSpades.dir/Core/ConcurrentDispatch.cpp.o] Error 1
make[2]: *** [Sources/CMakeFiles/OpenSpades.dir/all] Error 2
make[1]: *** [Sources/CMakeFiles/OpenSpades.dir/rule] Error 2
make: *** [OpenSpades] Error 2
@learn-more
Copy link
Contributor

Can you paste the generated OpenSpades.h ?

@ghost
Copy link

ghost commented Sep 4, 2013

Same error on Linux Mint 14, which is based on 12.04 I believe. Was using autoconf 2.69 mind you, as per the thread.

@Ericson2314
Copy link
Contributor Author

//This header is generated by CMake, do not edit it. (Changes will be lost)
// Instead edit OpenSpades.h.in, and run CMake again.

#define OpenSpades_VERSION_MAJOR 0
#define OpenSpades_VERSION_MINOR 0
#define OpenSpades_VERSION_REVISION 7

#define OS_STRINGIFY2(x)    #x
#define OS_STRINGIFY(x)     OS_STRINGIFY2(x)

#define OpenSpades_VER_STR  "OpenSpades " OS_STRINGIFY(OpenSpades_VERSION_MAJOR) "." OS_STRINGIFY(OpenSpades_VERSION_MINOR) "." OS_STRINGIFY(OpenSpades_VERSION_REVISION)
#define PACKAGE_STRING      OpenSpades_VER_STR

/* #undef HAS_OPENAL */

/* #undef RESDIR_DEFINED */
#define RESDIR ""

@ghost
Copy link

ghost commented Sep 7, 2013

adding #include <unistd.h> at the beginning of Sources/Core/ConcurrentDispatch.cpp solves the problem for me.
#ifdef HAS_UNISTD_H is broken.

@learn-more
Copy link
Contributor

Ubuntu 12.04 x64 does work, but i see some old data in that file could you try again with the latest? (and ofcourse also run cmake again, you should always do that after adding / removing files or changing build config)

@Ericson2314
Copy link
Contributor Author

/home/john/Code/git/openspades/Sources/AngelScript/addons/scripthelper.h fails to build now. I am 32-bit btw.

OpenSpades.h:

//This header is generated by CMake, do not edit it. (Changes will be lost)
// Instead edit OpenSpades.h.in, and run CMake again.

#define OpenSpades_VERSION_MAJOR 0
#define OpenSpades_VERSION_MINOR 0
#define OpenSpades_VERSION_REVISION 7

#define OS_STRINGIFY2(x)    #x
#define OS_STRINGIFY(x)     OS_STRINGIFY2(x)

#define OpenSpades_VER_STR  "OpenSpades " OS_STRINGIFY(OpenSpades_VERSION_MAJOR) "." OS_STRINGIFY(OpenSpades_VERSION_MINOR) "." OS_STRINGIFY(OpenSpades_VERSION_REVISION)
#define PACKAGE_STRING      OpenSpades_VER_STR

/* #undef HAS_OPENAL */

/* #undef RESDIR_DEFINED */
#define RESDIR ""

@learn-more
Copy link
Contributor

'fails to build now'
that is the most in-depth description i have ever heard...

@Ericson2314
Copy link
Contributor Author

Fair.

[  3%] Building CXX object Sources/AngelScript/projects/cmake_addons/CMakeFiles/Angelscript_addons.dir/__/__/addons/scripthelper.cpp.o
In file included from /usr/include/c++/4.7/type_traits:35:0,
                 from /path/to/openspades/Sources/AngelScript/addons/scripthelper.h:40,
                 from /path/to/openspades/Sources/AngelScript/addons/scripthelper.cpp:2:
/usr/include/c++/4.7/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
In file included from /path/to/openspades/Sources/AngelScript/addons/scripthelper.cpp:2:0:
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h: In function ‘asUINT GetTypeTraits()’:
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:46:25: error: ‘is_default_constructible’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:46:56: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:46:57: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:46:69: error: ‘has_trivial_default_constructor’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:46:107: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:46:108: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:51:23: error: ‘is_destructible’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:51:45: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:51:46: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:51:58: error: ‘has_trivial_destructor’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:51:87: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:51:88: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:53:31: error: ‘is_copy_assignable’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:53:56: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:53:57: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:53:69: error: ‘has_trivial_copy_assign’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:53:99: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:53:100: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:54:28: error: ‘is_copy_constructible’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:54:56: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:54:57: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:54:69: error: ‘has_trivial_copy_constructor’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:54:104: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:54:105: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:55:17: error: ‘is_floating_point’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:55:41: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:55:42: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:56:21: error: ‘is_integral’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:56:39: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:56:40: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:56:51: error: ‘is_pointer’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:56:68: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:56:69: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:56:80: error: ‘is_enum’ is not a member of ‘std’
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:56:94: error: expected primary-expression before ‘>’ token
/path/to/openspades/Sources/AngelScript/addons/scripthelper.h:56:95: error: ‘::value’ has not been declared
/path/to/openspades/Sources/AngelScript/addons/scripthelper.cpp: In function ‘void PrintException(asIScriptContext*, bool)’:
/path/to/openspades/Sources/AngelScript/addons/scripthelper.cpp:480:19: warning: unused variable ‘engine’ [-Wunused-variable]
make[2]: *** [Sources/AngelScript/projects/cmake_addons/CMakeFiles/Angelscript_addons.dir/__/__/addons/scripthelper.cpp.o] Error 1
make[1]: *** [Sources/AngelScript/projects/cmake_addons/CMakeFiles/Angelscript_addons.dir/all] Error 2
make: *** [all] Error 2

@Jordach
Copy link

Jordach commented Sep 15, 2013

A friend of mine in IRC has this too: Xubuntu 13.04
http://irc.minetest.ru/minetest/2013-09-15#i_3320871
http://paste.ubuntu.com/6111291/ (pastebin link, just to make life easier)

@NotAFile
Copy link
Contributor

#69, same issue :(

@learn-more
Copy link
Contributor

looks like you guys are running an older version of g++ ?

could you try from https://github.com/learn-more/openspades and report back?
(don't forget to run cmake)

@NotAFile
Copy link
Contributor

Fails with a similar message :(, if not the same

actually, yeah, the same

also, (make -v)

GNU Make 3.81
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i686-pc-linux-gnu

and (gcc -v)

Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.3-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --enable-objc-gc --enable-targets=all --with-cloog --enable-cloog-backend=ppl --disable-cloog-version-check --disable-ppl-version-check --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)

and (g++ -v)

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-linux-gnu/4.7/lto-wrapper
Target: i686-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.7.3-1ubuntu1' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --with-system-zlib --enable-objc-gc --enable-targets=all --with-cloog --enable-cloog-backend=ppl --disable-cloog-version-check --disable-ppl-version-check --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu
Thread model: posix
gcc version 4.7.3 (Ubuntu/Linaro 4.7.3-1ubuntu1)

These are all the versions which came with my OS

@Ericson2314
Copy link
Contributor Author

Same error again, and same compiler version. Why not add -std=c++11 or -std=gnu++11.

@Ericson2314
Copy link
Contributor Author

https://github.com/learn-more/openspades/pull/1 helps lot, but errors again with

[ 35%] Building CXX object Sources/CMakeFiles/OpenSpades.dir/Core/ConcurrentDispatch.cpp.o
In file included from /home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.cpp:22:0:
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.h:61:8: warning: unused parameter ‘disp’ [-Wunused-parameter]
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.cpp: In function ‘int GetNumCores()’:
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.cpp:65:20: error: ‘_SC_NPROCESSORS_ONLN’ was not declared in this scope
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.cpp:65:40: error: ‘sysconf’ was not declared in this scope
In file included from /home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.cpp:22:0:
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.h: In constructor ‘spades::ConcurrentDispatch::ConcurrentDispatch(std::string)’:
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.h:52:29: warning: ‘spades::ConcurrentDispatch::entry’ will be initialized after [-Wreorder]
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.h:51:15: warning:   ‘std::string spades::ConcurrentDispatch::name’ [-Wreorder]
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.cpp:237:2: warning:   when initialized here [-Wreorder]
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.cpp: In function ‘int GetNumCores()’:
/home/john/Code/git/openspades/Sources/Core/ConcurrentDispatch.cpp:67:1: warning: control reaches end of non-void function [-Wreturn-type]
make[2]: *** [Sources/CMakeFiles/OpenSpades.dir/Core/ConcurrentDispatch.cpp.o] Error 1
make[1]: *** [Sources/CMakeFiles/OpenSpades.dir/all] Error 2
make: *** [all] Error 2

@Ericson2314
Copy link
Contributor Author

It now compiles on my machine: I think because the combination of C++11 and #78. If you can too, @NotAFile, we should close this.

@NotAFile
Copy link
Contributor

YES! Thank you #78
but still, I can't sudo make install :(, it does not seem to exist. (no rule to make install)

@learn-more
Copy link
Contributor

yes, install target is not enabled in cmake, one would need to review what files need to be included, and create an install target.

@NotAFile
Copy link
Contributor

NotAFile commented Oct 5, 2013

@learn-more a more detailed instruction is appreciated :)

@learn-more
Copy link
Contributor

@NotAFile
Copy link
Contributor

NotAFile commented Oct 5, 2013

Thanks! I don't know what to do now, but I learned something new :P

@Ericson2314
Copy link
Contributor Author

Proper packages would be MUCH better than make install. I opened a new issue for this: #81.

Closing this as neither packaging nor make install has to do with compiling problems on Ubuntu.

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

No branches or pull requests

4 participants