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

debian installation error #46

Closed
fsdevblog opened this issue Dec 5, 2017 · 12 comments
Closed

debian installation error #46

fsdevblog opened this issue Dec 5, 2017 · 12 comments
Labels

Comments

@fsdevblog
Copy link

# cmake ..
-- The C compiler identification is GNU 4.9.2
-- The CXX compiler identification is GNU 4.9.2
-- 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
-- Found UV: /usr/lib/x86_64-linux-gnu/libuv.so  
-- Looking for syslog.h
-- Looking for syslog.h - found
-- Found mhd: /usr/include  
-- Configuring done
-- Generating done
-- Build files have been written to: /root/xmrig-proxy/build
root@user:~/xmrig-proxy/build# make
Scanning dependencies of target xmrig-proxy

[  2%] Building CXX object CMakeFiles/xmrig-proxy.dir/src/api/Api.cpp.o
In file included from /usr/include/c++/4.9/array:35:0,
                 from /root/xmrig-proxy/src/proxy/StatsData.h:29,
                 from /root/xmrig-proxy/src/api/ApiState.h:28,
                 from /root/xmrig-proxy/src/api/Api.cpp:28:
/usr/include/c++/4.9/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.
 #error This file requires compiler and library support for the \
  ^
/root/xmrig-proxy/src/api/Api.cpp:31:1: warning: identifier ‘nullptr’ is a keyword in C++11 [-Wc++0x-compat]
 ApiState *Api::m_state = nullptr;
 ^
In file included from /root/xmrig-proxy/src/api/ApiState.h:28:0,
                 from /root/xmrig-proxy/src/api/Api.cpp:28:
/root/xmrig-proxy/src/proxy/StatsData.h:87:30: warning: non-static data member initializers only available with -std=c++11 or -std=gnu++11
     double hashrate[5] { 0.0 };
                              ^
/root/xmrig-proxy/src/proxy/StatsData.h:88:10: error: ‘array’ in namespace ‘std’ does not name a template type
     std::array<uint64_t, 10> topDiff { { } };
          ^
/root/xmrig-proxy/src/proxy/StatsData.h:87:24: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
     double hashrate[5] { 0.0 };
                        ^
/root/xmrig-proxy/src/proxy/StatsData.h:87:30: warning: extended initializer lists only available with -std=c++11 or -std=gnu++11
     double hashrate[5] { 0.0 };
                              ^
/root/xmrig-proxy/src/proxy/StatsData.h: In member function ‘uint32_t StatsData::avgLatency() const’:
/root/xmrig-proxy/src/proxy/StatsData.h:70:9: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
         auto v = latency;
         ^
/root/xmrig-proxy/src/proxy/StatsData.h:70:14: error: ‘v’ does not name a type
         auto v = latency;
              ^
/root/xmrig-proxy/src/proxy/StatsData.h:71:26: error: ‘v’ was not declared in this scope
         std::nth_element(v.begin(), v.begin() + calls / 2, v.end());
                          ^
/root/xmrig-proxy/src/api/Api.cpp: At global scope:
/root/xmrig-proxy/src/api/Api.cpp:31:26: error: ‘nullptr’ was not declared in this scope
 ApiState *Api::m_state = nullptr;
                          ^
/root/xmrig-proxy/src/api/Api.cpp: In static member function ‘static char* Api::get(const char*, int*)’:
/root/xmrig-proxy/src/api/Api.cpp:53:16: error: ‘nullptr’ was not declared in this scope
         return nullptr;
                ^
CMakeFiles/xmrig-proxy.dir/build.make:54: recipe for target 'CMakeFiles/xmrig-proxy.dir/src/api/Api.cpp.o' failed
make[2]: *** [CMakeFiles/xmrig-proxy.dir/src/api/Api.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/xmrig-proxy.dir/all' failed
make[1]: *** [CMakeFiles/xmrig-proxy.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 8.9 (jessie)
Release:	8.9
Codename:	jessie
@fsdevblog
Copy link
Author

please close the issue. A solved the problem by setting CMAKE_CXX_FLAGS to -std=c++0x

@xmrig
Copy link
Owner

xmrig commented Dec 6, 2017

What gcc version you use?
Thank you.

@fsdevblog
Copy link
Author

@xmrig

# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Debian 4.9.2-10)

@Dmitrich777
Copy link

Dmitrich777 commented Dec 15, 2017

In which file I should add this option?
Thank you.

@fsdevblog
Copy link
Author

@Dmitrich777
into CMakeLists.txt

@xmrig xmrig added the bug label Dec 30, 2017
@Green-m
Copy link

Green-m commented Feb 7, 2018

I have the same issue.
In file CMakeLists.txt I changed like below:

set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS} -Wall")

The problem still exist, anyone can help?

@swampfighter
Copy link

Change
set(CMAKE_CXX_FLAGS "-std=c++0x ${CMAKE_CXX_FLAGS} -Wall")
to
set(CMAKE_CXX_FLAGS "-std=c++0x")

@Green-m
Copy link

Green-m commented Feb 8, 2018

@swampfighter

Thanks for your response.
I have changed line 171 like set(CMAKE_CXX_FLAGS "-std=c++0x")
But the error like this:

root@vultr:~/xmrig-proxy/build# make
Scanning dependencies of target xmrig-proxy
[  2%] Building CXX object CMakeFiles/xmrig-proxy.dir/src/api/Api.cpp.o
[  4%] Building CXX object CMakeFiles/xmrig-proxy.dir/src/api/ApiState.cpp.o
/root/xmrig-proxy/src/api/ApiState.cpp: In member function ‘void ApiState::genId()’:
/root/xmrig-proxy/src/api/ApiState.cpp:139:53: error: no match for ‘operator<’ (operand types are ‘uv_err_t {aka uv_err_s}’ and ‘int’)
     if (uv_interface_addresses(&interfaces, &count) < 0) {
                                                     ^
/root/xmrig-proxy/src/api/ApiState.cpp:146:58: error: ‘uv_interface_address_t’ has no member named ‘phys_addr’
             const size_t addrSize = sizeof(interfaces[i].phys_addr);
                                                          ^
/root/xmrig-proxy/src/api/ApiState.cpp:150:41: error: ‘uv_interface_address_t’ has no member named ‘phys_addr’
             memcpy(input, interfaces[i].phys_addr, addrSize);
                                         ^
CMakeFiles/xmrig-proxy.dir/build.make:77: recipe for target 'CMakeFiles/xmrig-proxy.dir/src/api/ApiState.cpp.o' failed
make[2]: *** [CMakeFiles/xmrig-proxy.dir/src/api/ApiState.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/xmrig-proxy.dir/all' failed
make[1]: *** [CMakeFiles/xmrig-proxy.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2

The environment is

root@vultr:~/xmrig-proxy/build# lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 8.10 (jessie)
Release:	8.10
Codename:	jessie

root@vultr:~/xmrig-proxy/build# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.9/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --with-arch-32=i586 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Debian 4.9.2-10) 

@swampfighter
Copy link

swampfighter commented Feb 8, 2018

The API issue is from libmicohttpd being too old. run 'cmake .. -DWITH_HTTPD=OFF' and then 'make' again.

See this: #86

@ElFutadoreMagnifico
Copy link

Its actually libmicrohttpd. A small typo mistake like this can give some headache to the less experienced users.

@ElFutadoreMagnifico
Copy link

In order to fix the libmicrohttpd update , you have to
wget https://ftp.gnu.org/gnu/libmicrohttpd/libmicrohttpd-latest.tar.gz
unzip and cd into directory
./configure
make
make install
make clean

@Green-m
Copy link

Green-m commented Feb 9, 2018

@ElFutadoreMagnifico @swampfighter

I found the issue that due to the older version of libuv. The version of libuv on my machine is 0.10

Same as Issue xmrig/xmrig#231

Solve the problem after updated libuv .

Thanks a lot for everyone.

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

6 participants