Find the answer to your Linux question:
Results 1 to 2 of 2
I thought I would try bitcoin but I am unable to compile the latest bitcoin client (bitcoin-0.3.24). I'm using 32-bit Slackware 13.1.0. When I initially attempted to compile I got ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Jul 2007
    Posts
    111

    Unable to compile bitcoin


    I thought I would try bitcoin but I am unable to compile the latest bitcoin client (bitcoin-0.3.24).

    I'm using 32-bit Slackware 13.1.0. When I initially attempted to compile I got errors related to wxWidgets being missing. This was resolved by compiling and installing wxWidgets. However I still get the following error:

    Code:
    g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL -DUSE_UPNP=0 -I/usr/local/lib/wx/include/gtk2-unicode-2.9 -I/usr/loal/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -DGUI -o obj/util.o util.cpp
    In file included from main.h:11,
                     from headers.h:96,
                     from util.cpp:4:
    db.h: In member function 'bool CDB::Exists(const K&)':
    db.h:149: error: 'class Db' has no member named 'exists'
    make: *** [obj/util.o] Error 1
    I have tried to grep for the class definition of "Db" but I am unable to find it. Where is it? Is this a programming error from the developers of bitcoin, or is this a particular issue at my system?

    However, most importantly, if there is a solution for this problem then please tell me.

    I also tried simply running the binary that was distributed with the package, but that resulted in the following error:

    Code:
    ./bitcoin: symbol lookup error: ./bitcoin: undefined symbol: gtk_widget_get_realized
    On the bitcoin forum I was told the following

    You might need libdb4.8++-dev or something like it.
    I've been trying this for a few hours now. I downloaded libdb4.8-dev_4.8.24-1ubuntu1_i386.deb from Ubuntu -- Package Download Selection -- libdb4.8-dev_4.8.24-1ubuntu1_i386.deb. Converted it to TGZ with Alien and installed it, then finally ran ldconfig.

    The compilation still fails, but the compiler added one new line:

    Code:
     /usr/include/db_cxx.h:796: error: 'DB_XIDDATASIZE' was not declared in this scope
    The full compiler error is:

    Code:
    g++ -c -O2 -Wno-invalid-offsetof -Wformat -g -D__WXDEBUG__ -DNOPCH -DFOURWAYSSE2 -DUSE_SSL -DUSE_UPNP=0 -I/usr/local/lib/wx/include/gtk2-unicode-2.9 -I/usr/local/include/wx-2.9 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread -DGUI -o obj/util.o util.cpp
    In file included from headers.h:43,
                     from util.cpp:4:
    /usr/include/db_cxx.h:796: error: 'DB_XIDDATASIZE' was not declared in this scope
    In file included from main.h:11,
                     from headers.h:96,
                     from util.cpp:4:
    db.h: In member function 'bool CDB::Exists(const K&)':
    db.h:149: error: 'class Db' has no member named 'exists'
    make: *** [obj/util.o] Error 1
    Any ideas?

  2. #2
    Linux Newbie
    Join Date
    Jul 2007
    Posts
    111
    I might be making some progress here, I'm not sure.

    I've been trying to follow the guide at (the PDF file) error: "class Db" has no member named "exists" - Atomic 3.0
    I installed all of the dependencies and then tried to use the Makefile presented in the document. This however only resulted in errors from make -- not errors from the compiler. With an unspecified rule.

    I was unable to modify the Makefile trivially so I made more than just a few modifications, this is my Makefile for bitcoin now:

    Code:
    DEPSDIR=/tmp/bitcoin/deps
    
    INCLUDEPATHS= -I"$(DEPSDIR)/include"
    LIBPATHS= -L"$(DEPSDIR)/lib"
    WXLIBS=$(shell $(DEPSDIR)/bin/wx-config --libs --static)
    WXBASELIBS=$(shell $(DEPSDIR)/bin/wx-config --libs base --static)
    
    LIBS= -dead_strip \
     $(DEPSDIR)/lib/libdb_cxx-4.8.a \
     $(DEPSDIR)/lib/libboost_system.a \
     $(DEPSDIR)/lib/libboost_filesystem.a \
     $(DEPSDIR)/lib/libcrypto.a
    
    WXDEFS=$(shell $(DEPSDIR)/bin/wx-config --cxxflags) -DNOPCH
    DEBUGFLAGS=-g -DwxDEBUG_LEVEL=0
    CFLAGS=-O2 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
    HEADERS=headers.h strlcpy.h serialize.h uint256.h util.h key.h bignum.h base58.h script.h db.h net.h irc.h main.h rpc.h uibase.h ui.h init.h sha.h
    
    
    OBJS= \
        obj/util.o \
        obj/script.o \
        obj/db.o \
        obj/net.o \
        obj/irc.o \
        obj/main.o \
        obj/rpc.o \
        obj/init.o \
        cryptopp/obj/sha.o \
        cryptopp/obj/cpu.o
    
    
    all : bitcoin
    
    obj/%.o : %.cpp
    	g++ $(CFLAGS) -c $<
    
    cryptopp/obj/%.o: cryptopp/%.cpp
    	g++ $(CFLAGS) -c $<
    
    bitcoin : $(OBJS) obj/ui.o obj/uibase.o 
    	g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXLIBS) $(LIBS)
    
    headers.h.gch : headers.h $(HEADERS)
    	g++ $(CFLAGS) -c $<
    
    obj/nogui/%.o : %.cpp $(HEADERS)
    	g++ $(CFLAGS) -DwxUSE_GUI=0 -c $<
    
    bitcoind : $(OBJS:obj/%=obj/nogui/%) obj/sha.o
    	g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(WXBASELIBS) $(LIBS)
    
    clean :
    	-rm -f bitcoin bitcoind
    	-rm -f obj/*
    	-rm -f obj/nogui/*
    	-rm -f headers.h.gch
    This at least does not stop prior to compilation even starting (unlike the previously mentioned Makefile). However I get the following compiler errors:

    Code:
    ui.cpp:19: error: expected constructor, destructor, or type conversion before '(' token
    ui.cpp:22: error: expected constructor, destructor, or type conversion before '*' token
    ui.cpp:24: error: 'wxLocale' does not name a type
    ...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •