novacoin-project / novacoin

Novacoin sources tree
MIT License
114 stars 517 forks source link

ambiguous conversion for functional-style cast from 'int' to 'DbEnv' #375

Closed kenneth closed 2 years ago

kenneth commented 6 years ago

build error in osx

src/db.cpp:42:9: error: ambiguous conversion for functional-style cast from 'int' to 'DbEnv'
        DbEnv(0).remove(strPath.c_str(), 0);
        ^~~~~~~
/usr/local/opt/berkeley-db/include/db_cxx.h:516:2: note: candidate constructor
        DbEnv(u_int32_t flags);
        ^
/usr/local/opt/berkeley-db/include/db_cxx.h:518:2: note: candidate constructor
        DbEnv(DB_ENV *dbenv);
        ^
/usr/local/opt/berkeley-db/include/db_cxx.h:916:2: note: candidate constructor
        DbEnv(const DbEnv &);
        ^
1 error generated.
make: *** [build/db.o] Error 1
Iwwerall commented 6 years ago

Try replacing: DbEnv(0).remove(strPath.c_str(), 0); with DbEnv((u_int32_t)0).remove(strPath.c_str(), 0);