Post
Topic
Board Altcoin Discussion
Re: [HOWTO] compile altcoin for windows on linux using mxe and mingw
by
do0d
on 23/01/2018, 14:25:17 UTC
Thanks for the great tutorial.  So far I've been able to get through a few problems, but I'm stuck now with a Berkley DB linking problem.  I've recompiled it and tried a couple different versions.  I also removed all the Berkley DB files to see if I get a different error and it is the same, but everything looks correct when I check paths/names.  I'm not sure what I am doing wrong, but I'm getting these errors (small snippet since they are all the same undefined reference error):

Code:
./build/init.o:init.cpp:(.text$_ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_[__ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_]+0x172): undefined reference to `Dbt::Dbt(void*, unsigned int)'
./build/init.o:init.cpp:(.text$_ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_[__ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_]+0x192): undefined reference to `Dbt::Dbt()'
./build/init.o:init.cpp:(.text$_ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_[__ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_]+0x498): undefined reference to `Dbt::~Dbt()'
./build/init.o:init.cpp:(.text$_ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_[__ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_]+0x4ad): undefined reference to `Dbt::~Dbt()'
./build/init.o:init.cpp:(.text$_ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_[__ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_]+0x614): undefined reference to `Dbt::~Dbt()'
./build/init.o:init.cpp:(.text$_ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_[__ZN3CDB4ReadINSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE13CBlockLocatorEEbRKT_RT0_]+0x629): undefined reference to `Dbt::~Dbt()'
./build/db.o:db.cpp:(.text+0x38d): undefined reference to `DbEnv::DbEnv(unsigned int)'
./build/db.o:db.cpp:(.text+0x17c6): undefined reference to `DbEnv::close(unsigned int)'
./build/db.o:db.cpp:(.text+0x17f8): undefined reference to `DbEnv::DbEnv(unsigned int)'
./build/db.o:db.cpp:(.text+0x1818): undefined reference to `DbEnv::remove(char const*, unsigned int)'
./build/db.o:db.cpp:(.text+0x182a): undefined reference to `DbEnv::~DbEnv()'
./build/db.o:db.cpp:(.text+0x1844): undefined reference to `DbEnv::strerror(int)'
./build/db.o:db.cpp:(.text+0x187b): undefined reference to `DbEnv::~DbEnv()'
./build/db.o:db.cpp:(.text+0x1933): undefined reference to `DbEnv::~DbEnv()'
./build/db.o:db.cpp:(.text+0x19e7): undefined reference to `DbEnv::~DbEnv()'
./build/db.o:db.cpp:(.text+0x1e05): undefined reference to `DbEnv::set_lg_dir(char const*)'
./build/db.o:db.cpp:(.text+0x1e69): undefined reference to `DbEnv::set_cachesize(unsigned int, unsigned int, int)'
./build/db.o:db.cpp:(.text+0x1e7e): undefined reference to `DbEnv::set_lg_bsize(unsigned int)'
./build/db.o:db.cpp:(.text+0x1e93): undefined reference to `DbEnv::set_lg_max(unsigned int)'
./build/db.o:db.cpp:(.text+0x1ea8): undefined reference to `DbEnv::set_lk_max_locks(unsigned int)'
./build/db.o:db.cpp:(.text+0x1ebd): undefined reference to `DbEnv::set_lk_max_objects(unsigned int)'

Figured it out.  Solution for anyone else:
In my .pro file I was using:
BDB_INCLUDE_PATH=${MXE_LIB_PATH}
BDB_LIB_PATH=${MXE_LIB_PATH}
Because the install was putting the files there.  I'm not sure why that didn't work, but when I switched them to this it started working:
BDB_INCLUDE_PATH="/mnt/db-5.3.28/build_mxe"
BDB_LIB_PATH="/mnt/db-5.3.28/build_mxe"