Форум программистов
 

Восстановите пароль или Зарегистрируйтесь на форуме, о проблемах и с заказом рекламы пишите сюда - alarforum@yandex.ru, проверяйте папку спам!

Вернуться   Форум программистов > C/C++ программирование > Общие вопросы C/C++
Регистрация

Восстановить пароль
Повторная активизация e-mail

Купить рекламу на форуме - 42 тыс руб за месяц

Ответ
 
Опции темы Поиск в этой теме
Старый 09.07.2017, 13:27   #1
Solaire
Новичок
Джуниор
 
Регистрация: 09.07.2017
Сообщений: 1
По умолчанию Ошибка при сборке программы

Здравствуйте.

Пытаюсь собрать исполняемый файл из этих (https://github.com/fireice-uk/xmr-stak-cpu) исходников.

Скачал зависимости hwloc-win64-build-1.11.7, libmicrohttpd-0.9.55-w32-bin, OpenSSL-Win64.
Скачал MinGW-W64 (https://sourceforge.net/projects/mingw-w64/) и установил с параметрами:
Version: 7.1.0
Architecture: x86_64
Threads: win32
Exceptions: seh
Build revision: 0
Используя Code Bloks 16.01, указав месторасположение зависимостей и компилятора, запустил сборку.
Вышла куча ошибок:
Код:
||=== Build: Debug in xmr-stak-cpu (compiler: GNU GCC Compiler) ===|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|47|error: 'mutex' in namespace 'std' does not name a type|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|48|error: 'condition_variable' in namespace 'std' does not name a type|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp||In member function 'T thdq<T>::pop()':|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|14|error: 'mutex' is not a member of 'std'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|14|error: 'mutex' is not a member of 'std'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|14|error: template argument 1 is invalid|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|14|error: 'mutex_' was not declared in this scope|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|14|note: suggested alternative: 'putenv'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|15|error: 'cond_' was not declared in this scope|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp||In member function 'void thdq<T>::pop(T&)':|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|23|error: 'mutex' is not a member of 'std'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|23|error: 'mutex' is not a member of 'std'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|23|error: template argument 1 is invalid|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|23|error: 'mutex_' was not declared in this scope|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|23|note: suggested alternative: 'putenv'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|24|error: 'cond_' was not declared in this scope|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp||In member function 'void thdq<T>::push(const T&)':|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|31|error: 'mutex' is not a member of 'std'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|31|error: 'mutex' is not a member of 'std'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|31|error: template argument 1 is invalid|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|31|error: 'mutex_' was not declared in this scope|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|31|note: suggested alternative: 'putenv'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|33|error: request for member 'unlock' in 'mlock', which is of non-class type 'int'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|34|error: 'cond_' was not declared in this scope|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp||In member function 'void thdq<T>::push(T&&)':|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|39|error: 'mutex' is not a member of 'std'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|39|error: 'mutex' is not a member of 'std'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|39|error: template argument 1 is invalid|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|39|error: 'mutex_' was not declared in this scope|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|39|note: suggested alternative: 'putenv'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|41|error: request for member 'unlock' in 'mlock', which is of non-class type 'int'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\thdq.hpp|42|error: 'cond_' was not declared in this scope|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\executor.h|51|error: 'mutex' in namespace 'std' does not name a type|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\executor.h|56|error: 'thread' in namespace 'std' does not name a type|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\executor.h|85|error: field 'httpReady' has incomplete type 'std::promise<void>'|
C:\mingw-w64\x86_64-7.1.0-win32-seh-rt_v5-rev0\mingw64\lib\gcc\x86_64-w64-mingw32\7.1.0\include\c++\future|134|note: declaration of 'class std::promise<void>'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\executor.h|86|error: 'mutex' in namespace 'std' does not name a type|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\executor.h||In member function 'void executor::ex_start()':|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\executor.h|22|error: 'my_thd' was not declared in this scope|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\executor.h|22|note: suggested alternative: 'minethd'|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\executor.h|22|error: expected type-specifier|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\minethd.h|132|error: 'thread' in namespace 'std' does not name a type|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\console.h|40|error: 'mutex' in namespace 'std' does not name a type|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\cli-miner.cpp||In function 'void do_benchmark()':|
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\cli-miner.cpp|190|error: 'std::this_thread' has not been declared|
||=== Build failed: 33 error(s), 0 warning(s) (0 minute(s), 18 second(s)) ===|
На stackoverflow.com пишут "The MinGW-w64 projects provides the necessary runtime support. Check out http://mingw-w64.sourceforge.net/"

Скачал MinGW-w64 оттуда (http://win-builds.org/doku.php/downl...n_from_windows), указал в Code Blocks.
При сборке выходит ошибка:
Код:
C:\Users\User\Downloads\xmr-stak-cpu-1.2.0-1.4.1\cli-miner.cpp|1|error: bad value (haswell) for -march= switch|
Как правильно собрать программу?
Solaire вне форума Ответить с цитированием
Старый 09.07.2017, 20:29   #2
alexzk
Форумчанин
 
Регистрация: 12.04.2017
Сообщений: 889
По умолчанию

уберите -march= параметр из настроек, он не работает с мингв. Можно попробовать -march=native сначала.
alexzk вне форума Ответить с цитированием
Старый 09.07.2017, 23:20   #3
_Bers
Старожил
 
Регистрация: 16.12.2011
Сообщений: 2,329
По умолчанию

добавьте
Цитата:
-std=c++11
или выше.
_Bers вне форума Ответить с цитированием
Ответ


Купить рекламу на форуме - 42 тыс руб за месяц



Похожие темы
Тема Автор Раздел Ответов Последнее сообщение
Ошибка при сборке boost на Windows gunsoy Общие вопросы C/C++ 23 04.09.2015 20:12
Ошибка при сборке ( выпуск) номер -1073741511 lexflax Qt и кроссплатформенное программирование С/С++ 1 16.11.2013 16:33
проблемы при сборке проекта brutalis Qt и кроссплатформенное программирование С/С++ 2 21.01.2013 18:50
Ошибка при сборке проекта в QT. JoberLord Qt и кроссплатформенное программирование С/С++ 4 17.04.2010 16:33