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

build error "could not bind to an lvalue of type 'const char [41]'" #1952

Closed
pureland opened this issue Aug 22, 2019 · 6 comments
Closed

build error "could not bind to an lvalue of type 'const char [41]'" #1952

pureland opened this issue Aug 22, 2019 · 6 comments
Labels
3d Bug Classification indicating the existing implementation does not match the intention of the design 6 Build Impact flag identifying the build process

Comments

@pureland
Copy link

pureland commented Aug 22, 2019

Instructions
Please include a detailed Title above. Next, please complete the following sections below:

  • Build Error
    Reference to type 'const std::string' (aka 'const basic_string<char, char_traits<char>, allocator<char> >') could not bind to an lvalue of type 'const char [41]'

  • Build Environment
    Xcode Version 10.1 (10B61)/ clang version 4.0.1 (tags/RELEASE_401/final)

  • Console Logs (optional)

bitshares-core/libraries/fc/include/fc/variant.hpp:571:10: error: reference to type 'const std::string' (aka 'const basic_string<char, char_traits<char>,
      allocator<char> >') could not bind to an lvalue of type 'const char [41]'
         _FC_ASSERT( max_depth > 0, "Recursion depth exceeded!" );
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Build Environment
Details about the build environment, including the relevant required libraries. Much of this information can be found in the CMakeFiles/CMakeOutput.log.

  • Host OS: macOS Mojave
  • Host Physical RAM 32GB
  • Source Branch/Tag: master
  • OpenSSL Version: 1.1.0g
  • Boost Version: 1.59
  • C++ Compiler: clang version 4.0.1 (tags/RELEASE_401/final)
@pmconrad pmconrad added 3d Bug Classification indicating the existing implementation does not match the intention of the design 6 Build Impact flag identifying the build process labels Aug 22, 2019
@pmconrad
Copy link
Contributor

Thanks. Can you please check if the error also occurs in the latest testnet release?
Need to

git checkout test-3.3.1
git submodule update --init --recursive
make

inside your checked out core directory.

@pmconrad
Copy link
Contributor

pmconrad commented Aug 22, 2019

@pureland @jmjatlanta could you test if this change fixes the problem: bitshares/bitshares-fc@78ffb6d ?

@jmjatlanta
Copy link
Contributor

@pureland @jmjatlanta could you test if this change fixes the problem: bitshares/bitshares-fc@78ffb6d ?

I am unable to replicate the problem on my mac. I will take a look at my environment and see if I can cause it.

@jmjatlanta
Copy link
Contributor

What about fc::throw_assertion_failure( std::string(#cond) + ": " + msg);

Perhaps a bit more readable. Just my opinion. I have been unable to cause the problem. I now have multiple versions of clang. Perhaps cmake is not calling the (older) clang version I am expecting.

@pmconrad
Copy link
Contributor

Not that it matters much, but that's two runtime-concatenations of strings, whereas mine is just a string literal.

pmconrad added a commit to pmconrad/bitshares-core that referenced this issue Aug 30, 2019
@pmconrad
Copy link
Contributor

pmconrad commented Sep 1, 2019

Fixed with #1949

@pmconrad pmconrad closed this as completed Sep 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3d Bug Classification indicating the existing implementation does not match the intention of the design 6 Build Impact flag identifying the build process
Projects
None yet
Development

No branches or pull requests

3 participants