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

DIFFICULTY_TARGET_V1 was not declared in this scope? #2760

Closed
thawwed opened this issue Nov 4, 2017 · 12 comments
Closed

DIFFICULTY_TARGET_V1 was not declared in this scope? #2760

thawwed opened this issue Nov 4, 2017 · 12 comments
Labels

Comments

@thawwed
Copy link

thawwed commented Nov 4, 2017

I am trying to build from the source and I keep getting this error. Any advice is much appreciated, as I am beating my head on the wall over this one.

[ 70%] Building CXX object tests/core_tests/CMakeFiles/coretests.dir/block_validation.cpp.o
/root/monero/tests/core_tests/block_validation.cpp: In function ‘bool {anonymous}::lift_up_difficulty(std::vector<boost::variant<cryptonote::block, cryptonote::transaction, cryptonote::account_base, callback_entry, serialized_object<cryptonote::block>, serialized_object<cryptonote::transaction>, event_visitor_settings> >&, std::vector<long unsigned int>&, std::vector<long unsigned int>&, test_generator&, size_t, cryptonote::block, const cryptonote::account_base&)’:
/root/monero/tests/core_tests/block_validation.cpp:48:85: error: ‘DIFFICULTY_TARGET_V1’ was not declared in this scope
       difficulty_type diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);
                                                                                     ^
/root/monero/tests/core_tests/block_validation.cpp: In member function ‘bool gen_block_invalid_nonce::generate(std::vector<boost::variant<cryptonote::block, cryptonote::transaction, cryptonote::account_base, callback_entry, serialized_object<cryptonote::block>, serialized_object<cryptonote::transaction>, event_visitor_settings> >&) const’:
/root/monero/tests/core_tests/block_validation.cpp:178:81: error: ‘DIFFICULTY_TARGET_V1’ was not declared in this scope
   difficulty_type diffic = next_difficulty(timestamps, commulative_difficulties,DIFFICULTY_TARGET_V1);
                                                                                 ^
In file included from /root/monero/src/cryptonote_basic/cryptonote_basic.h:47:0,
                 from /root/monero/src/cryptonote_basic/account.h:33,
                 from /root/monero/src/cryptonote_basic/account_boost_serialization.h:33,
                 from /root/monero/tests/core_tests/chaingen.h:47,
                 from /root/monero/tests/core_tests/block_validation.cpp:31:
/root/monero/tests/core_tests/block_validation.cpp: In member function ‘bool gen_block_unlock_time_is_timestamp_in_future::generate(std::vector<boost::variant<cryptonote::block, cryptonote::transaction, cryptonote::account_base, callback_entry, serialized_object<cryptonote::block>, serialized_object<cryptonote::transaction>, event_visitor_settings> >&) const’:
/root/monero/src/cryptonote_config.h:85:57: error: ‘DIFFICULTY_TARGET_V1’ was not declared in this scope
 #define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN             DIFFICULTY_TARGET_V1 //just alias; used by tests
                                                         ^
/root/monero/tests/core_tests/block_validation.cpp:267:87: note: in expansion of macro ‘DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN’
   miner_tx.unlock_time = blk_0.timestamp + 3 * CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW * DIFFICULTY_BLOCKS_ES
                                                                                       ^
/root/monero/tests/core_tests/block_validation.cpp: In member function ‘bool gen_block_invalid_binary_format::generate(std::vector<boost::variant<cryptonote::block, cryptonote::transaction, cryptonote::account_base, callback_entry, serialized_object<cryptonote::block>, serialized_object<cryptonote::transaction>, event_visitor_settings> >&) const’:
/root/monero/tests/core_tests/block_validation.cpp:575:67: error: ‘DIFFICULTY_TARGET_V1’ was not declared in this scope
     diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);
                                                                   ^
/root/monero/tests/core_tests/block_validation.cpp:590:65: error: ‘DIFFICULTY_TARGET_V1’ was not declared in this scope
   diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);
                                                                 ^
tests/core_tests/CMakeFiles/coretests.dir/build.make:86: recipe for target 'tests/core_tests/CMakeFiles/coretests.dir/block_validation.cpp.o' failed
make[3]: *** [tests/core_tests/CMakeFiles/coretests.dir/block_validation.cpp.o] Error 1

@moneromooo-monero
Copy link
Collaborator

Which commit hash are you building ?

@thawwed
Copy link
Author

thawwed commented Nov 4, 2017 via email

@moneromooo-monero
Copy link
Collaborator

git show

@thawwed
Copy link
Author

thawwed commented Nov 4, 2017 via email

@moneromooo-monero
Copy link
Collaborator

This will just avoid building tests. Please post the output of git show.

@moneromooo-monero
Copy link
Collaborator

Oh, and also please report your OS, architecture, and compiler please. Because it seems to be particular to one of those since it doesn't happen to me.

@thawwed
Copy link
Author

thawwed commented Nov 5, 2017

I am using Ubuntu 16.04 LTS and I am brand new to Linux, so please excuse me for not knowing what architecture or compiler means. Either way, I have everything working now, but I appreciate your time in trying to help.

@thawwed thawwed closed this as completed Nov 5, 2017
@dabnebula
Copy link

Hey, I am having this same issue right now, even when running "sudo make release".

git show - etnadmin@ip-172-31-23-143:~/electroneum$ git show
commit 53f8b3f
Author: Richard Ells richard@ells.co.uk
Date: Tue Oct 31 23:10:15 2017 +0000

Update README.md

diff --git a/README.md b/README.md
index fdf6a6f..a194c05 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@

Electroneum

-Copyright (c) 2017, The Electroneum Project
-Copyright (c) 2014-2017, The Monero Project
-Portions Copyright (c) 2012-2013, The Cryptonote developers
+Copyright (c) 2017, The Electroneum Project
+Copyright (c) 2014-2017, The Monero Project
+Portions Copyright (c) 2012-2013, The Cryptonote developers

Development Resources

Introduction

etnadmin@ip-172-31-23-143:/electroneum$ git show verbose
fatal: ambiguous argument 'verbose': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git [...] -- [...]'
etnadmin@ip-172-31-23-143:
/electroneum$ git show --all
commit 53f8b3f
Author: Richard Ells richard@ells.co.uk
Date: Tue Oct 31 23:10:15 2017 +0000

Update README.md

diff --git a/README.md b/README.md
index fdf6a6f..a194c05 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@

Electroneum

-Copyright (c) 2017, The Electroneum Project
-Copyright (c) 2014-2017, The Monero Project
-Portions Copyright (c) 2012-2013, The Cryptonote developers
+Copyright (c) 2017, The Electroneum Project
+Copyright (c) 2014-2017, The Monero Project
+Portions Copyright (c) 2012-2013, The Cryptonote developers

Development Resources

Introduction

commit c328163
Merge: 793bc97 cb23be8
Author: Riccardo Spagni ric@spagni.net
Date: Wed Oct 25 15:26:58 2017 +0200

Merge pull request #2724

cb23be8f Wallet API: always use approximate calc of blockchain height (Jaquee)

(END)

Update README.md

diff --git a/README.md b/README.md
index fdf6a6f..a194c05 100644
--- a/README.md
+++ b/README.md
@@ -1,14 +1,14 @@

Electroneum

-Copyright (c) 2017, The Electroneum Project
-Copyright (c) 2014-2017, The Monero Project
-Portions Copyright (c) 2012-2013, The Cryptonote developers
+Copyright (c) 2017, The Electroneum Project
+Copyright (c) 2014-2017, The Monero Project
+Portions Copyright (c) 2012-2013, The Cryptonote developers

Development Resources

Introduction

commit c328163
Merge: 793bc97 cb23be8
Author: Riccardo Spagni ric@spagni.net
Date: Wed Oct 25 15:26:58 2017 +0200

Merge pull request #2724

cb23be8f Wallet API: always use approximate calc of blockchain height (Jaquee)

(END)

@dabnebula
Copy link

I think I resolved this error by rm -r the electroneum directory and then starting from scratch. Assuming the first failure that I corrected cause an issue, but it's now beyond that percentage.. will update if any further issues building

@hyc
Copy link
Collaborator

hyc commented Nov 6, 2017

This is the Monero issue tracker, not the Electroneum issue tracker.

@hyc
Copy link
Collaborator

hyc commented Nov 6, 2017

+invalid

@adelinvrd
Copy link

I have the same error how can I fix it?

[ 58%] Building CXX object tests/core_tests/CMakeFiles/coretests.dir/block_validation.cpp.o /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp: In function 'bool {anonymous}::lift_up_difficulty(std::vector<boost::variant<cryptonote::block, cryptonote::transaction, cryptonote::account_base, callback_entry, serialized_object<cryptonote::block>, serialized_object<cryptonote::transaction>, event_visitor_settings> >&, std::vector<long unsigned int>&, std::vector<long unsigned int>&, test_generator&, size_t, cryptonote::block, const cryptonote::account_base&)': /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp:48:85: error: 'DIFFICULTY_TARGET_V1' was not declared in this scope difficulty_type diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1); ^ /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp: In member function 'bool gen_block_invalid_nonce::generate(std::vector<boost::variant<cryptonote::block, cryptonote::transaction, cryptonote::account_base, callback_entry, serialized_object<cryptonote::block>, serialized_object<cryptonote::transaction>, event_visitor_settings> >&) const': /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp:178:81: error: 'DIFFICULTY_TARGET_V1' was not declared in this scope difficulty_type diffic = next_difficulty(timestamps, commulative_difficulties,DIFFICULTY_TARGET_V1); ^ In file included from /dev/shm/electroneum-master/src/cryptonote_basic/cryptonote_basic.h:47:0, from /dev/shm/electroneum-master/src/cryptonote_basic/account.h:33, from /dev/shm/electroneum-master/src/cryptonote_basic/account_boost_serialization.h:33, from /dev/shm/electroneum-master/tests/core_tests/chaingen.h:47, from /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp:31: /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp: In member function 'bool gen_block_unlock_time_is_timestamp_in_future::generate(std::vector<boost::variant<cryptonote::block, cryptonote::transaction, cryptonote::account_base, callback_entry, serialized_object<cryptonote::block>, serialized_object<cryptonote::transaction>, event_visitor_settings> >&) const': /dev/shm/electroneum-master/src/cryptonote_config.h:85:57: error: 'DIFFICULTY_TARGET_V1' was not declared in this scope #define DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN DIFFICULTY_TARGET_V1 //just alias; used by tests ^ /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp:267:87: note: in expansion of macro 'DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN' miner_tx.unlock_time = blk_0.timestamp + 3 * CRYPTONOTE_MINED_MONEY_UNLOCK_WINDOW * DIFFICULTY_BLOCKS_ESTIMATE_TIMESPAN; ^ /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp: In member function 'bool gen_block_invalid_binary_format::generate(std::vector<boost::variant<cryptonote::block, cryptonote::transaction, cryptonote::account_base, callback_entry, serialized_object<cryptonote::block>, serialized_object<cryptonote::transaction>, event_visitor_settings> >&) const': /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp:575:67: error: 'DIFFICULTY_TARGET_V1' was not declared in this scope diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1); ^ /dev/shm/electroneum-master/tests/core_tests/block_validation.cpp:590:65: error: 'DIFFICULTY_TARGET_V1' was not declared in this scope diffic = next_difficulty(timestamps, cummulative_difficulties,DIFFICULTY_TARGET_V1);

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