AlexMerced (OP)
|
|
May 05, 2013, 03:00:23 AM |
|
Ok, I followed the directions for compiling outlined in this thread which apparently work with the newer versions of bitcoin which are different than the older version which Litecoin is forked from: https://bitcointalk.org/index.php?topic=149479.0I edited the dependency directors in the makefile.mingw which now saids: # Copyright (c) 2009-2010 Satoshi Nakamoto # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php.
USE_UPNP:=0
INCLUDEPATHS= \ -I"C:\deps\boost_1_53_0" \ -I"C:\deps\db-4.8.30.NC\build_unix" \ -I"C:\deps\openssl-1.0.1e\include"
LIBPATHS= \ -L"C:\deps\boost_1_53_0\stage\lib" \ -L"C:\deps\db-4.8.30.NC\build_unix" \ -L"C:\deps\openssl-1.0.1e"
LIBS= \ -l boost_system-mgw46-mt-sd-1_53 \ -l boost_filesystem-mgw46-mt-sd-1_53 \ -l boost_program_options-mgw46-mt-sd-1_53 \ -l boost_thread-mgw46-mt-sd-1_53 \ -l db_cxx \ -l ssl \ -l crypto
DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6 DEBUGFLAGS=-g CFLAGS=-mthreads -O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS)
TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data)
ifdef USE_UPNP INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw" LIBPATHS += -L"C:\miniupnpc-1.6-mgw" LIBS += -l miniupnpc -l iphlpapi DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP) endif
LIBS += -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l mswsock -l shlwapi
# TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are HEADERS = $(wildcard *.h)
OBJS= \ obj/version.o \ obj/checkpoints.o \ obj/netbase.o \ obj/addrman.o \ obj/crypter.o \ obj/key.o \ obj/db.o \ obj/init.o \ obj/irc.o \ obj/keystore.o \ obj/main.o \ obj/net.o \ obj/protocol.o \ obj/bitcoinrpc.o \ obj/rpcdump.o \ obj/rpcnet.o \ obj/rpcrawtransaction.o \ obj/script.o \ obj/scrypt.o \ obj/sync.o \ obj/util.o \ obj/wallet.o \ obj/walletdb.o \ obj/noui.o
all: litecoind.exe
obj/scrypt.o: scrypt.c gcc -c $(CFLAGS) -o $@ $^
obj/%.o: %.cpp $(HEADERS) g++ -c $(CFLAGS) -o $@ $<
litecoind.exe: $(OBJS:obj/%=obj/%) g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS)
TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp))
obj-test/%.o: test/%.cpp $(HEADERS) g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $<
test_litecoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS)
clean: -del /Q litecoind test_litecoin -del /Q obj\* -del /Q obj-test\* -del /Q build.h
Compiled it and got this:
|
|
|
|
|
|
|
|
|
You get merit points when someone likes your post enough to give you some. And for every 2 merit points you receive, you can send 1 merit point to someone else!
|
|
|
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
|
|
|
|
Mylon
Full Member
Offline
Activity: 140
Merit: 100
Mining FTW
|
|
May 05, 2013, 08:02:26 AM |
|
Looks like your issue in this is from the tutorial you used: 2.2 Berkeley DB: http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gzWe'll use version 4.8 to preserve binary wallet compatibility. From a MinGW shell unpack the source archive, configure, edit line 113 of db.h then make: cd /c/deps/ tar xvfz db-4.8.30.NC.tar.gz cd db-4.8.30.NC/build_unix ../dist/configure --disable-replication --enable-mingw --enable-cxx
after configuring make sure to edit your build_unix/db.h by replacing line 113: typedef pthread_t db_threadid_t;
with typedef u_int32_t db_threadid_t;
Thanks to Icy, see: https://bitcointalk.org/index.php?topic=45507.0Not sure how you would be able to fix it though... all of my self compiles up to date, always had 50% tutorial, and 50% errors which needed googling to resolve. (was just looking at dependency issues myself)
|
"All Your Base Are Belong To Us" by CATS
|
|
|
wiggi
|
|
May 05, 2013, 11:55:05 AM |
|
A quick fix for the "pthread_t has a previous declaration as..." error: use the old qtgui_deps_1.zip for database and only the newest boost and openssl versions, i.e. in the .pro file: # Dependency library locations can be customized with: # BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH, # BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively BOOST_LIB_SUFFIX=-mgw46-mt-sd-1_53 BOOST_INCLUDE_PATH=C:\deps\boost_1_53_0 BOOST_LIB_PATH=C:\deps\boost_1_53_0\stage\lib OPENSSL_INCLUDE_PATH=c:/deps/openssl-1.0.1e/include OPENSSL_LIB_PATH=c:/deps/openssl-1.0.1e
To get it to compile, I also commented out the "# regenerate src/build.h" section, and changed # windows:BOOST_LIB_SUFFIX = -mgw44-mt-1_43 windows:BOOST_LIB_SUFFIX = -mgw46-mt-1_53
and #windows:LIBS += -lole32 -luuid -lgdi32 windows:LIBS += -lole32 -loleaut32 -luuid -lwsock32 -lgdi32 -lm
|
|
|
|
AlexMerced (OP)
|
|
May 05, 2013, 02:15:55 PM |
|
A quick fix for the "pthread_t has a previous declaration as..." error: use the old qtgui_deps_1.zip for database and only the newest boost and openssl versions, i.e. in the .pro file: # Dependency library locations can be customized with: # BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH, # BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively BOOST_LIB_SUFFIX=-mgw46-mt-sd-1_53 BOOST_INCLUDE_PATH=C:\deps\boost_1_53_0 BOOST_LIB_PATH=C:\deps\boost_1_53_0\stage\lib OPENSSL_INCLUDE_PATH=c:/deps/openssl-1.0.1e/include OPENSSL_LIB_PATH=c:/deps/openssl-1.0.1e
To get it to compile, I also commented out the "# regenerate src/build.h" section, and changed # windows:BOOST_LIB_SUFFIX = -mgw44-mt-1_43 windows:BOOST_LIB_SUFFIX = -mgw46-mt-1_53
that and #windows:LIBS += -lole32 -luuid -lgdi32 windows:LIBS += -lole32 -loleaut32 -luuid -lwsock32 -lgdi32 -lm
thanks, giving it a shot
|
|
|
|
AlexMerced (OP)
|
|
May 05, 2013, 02:22:06 PM |
|
A quick fix for the "pthread_t has a previous declaration as..." error: use the old qtgui_deps_1.zip for database and only the newest boost and openssl versions, i.e. in the .pro file: # Dependency library locations can be customized with: # BOOST_INCLUDE_PATH, BOOST_LIB_PATH, BDB_INCLUDE_PATH, # BDB_LIB_PATH, OPENSSL_INCLUDE_PATH and OPENSSL_LIB_PATH respectively BOOST_LIB_SUFFIX=-mgw46-mt-sd-1_53 BOOST_INCLUDE_PATH=C:\deps\boost_1_53_0 BOOST_LIB_PATH=C:\deps\boost_1_53_0\stage\lib OPENSSL_INCLUDE_PATH=c:/deps/openssl-1.0.1e/include OPENSSL_LIB_PATH=c:/deps/openssl-1.0.1e
To get it to compile, I also commented out the "# regenerate src/build.h" section, and changed # windows:BOOST_LIB_SUFFIX = -mgw44-mt-1_43 windows:BOOST_LIB_SUFFIX = -mgw46-mt-1_53
and #windows:LIBS += -lole32 -luuid -lgdi32 windows:LIBS += -lole32 -loleaut32 -luuid -lwsock32 -lgdi32 -lm
still have the same error
|
|
|
|
AlexMerced (OP)
|
|
May 05, 2013, 02:33:23 PM |
|
A quick fix for the "pthread_t has a previous declaration as..." error: use the old qtgui_deps_1.zip for database
where do I find the old qtguit_deps_1.zip and where do I unpack it to?
|
|
|
|
wiggi
|
|
May 05, 2013, 05:16:40 PM |
|
where do I find the old qtguit_deps_1.zip
and where do I unpack it to?
qtgui_deps_1.zip: Old link is dead, no mirror, uploaded what I think is the original: http://www1.datafilehost.com/d/8561ef9aI don't have the .sig file. Md5 checksum of uploaded file is a3840184ea3bedb8eedb755265ca6e42. To unpack, copy \lib and \include folder over C:\MinGW\lib and C:\MinGW\include, respectively. If QtSDK is installed, there is also C:\QtSDK\mingw\lib and C:\QtSDK\mingw\include but these are normally not used. (?) Not sure about litecoin-master, or the daemon/makefile.mingw, but the 0.6.3c (the official release) Qt-client is fine. (compile from Qt4.8.4 command prompt started as admin, not from Qt-Creator) Also, only DLLs from C:\MinGW\bin and C:\Qt\4.8.4\bin work. (other versions of the same DLLs crash the executable)
|
|
|
|
wiggi
|
|
May 05, 2013, 07:19:16 PM Last edit: May 14, 2013, 03:38:55 PM by wiggi |
|
Found the cause of this error: it's a naming collision, pthread_t in the Ltc source is something different than pthread_t in Berkeley DB. (and pthread_t doesn't appear in Btc0.8.1)
EDIT: Solution: rename all occurrences of pthread_t between "#ifdef WIN32" and "#else" in Ltc0.6.3 to pthreadfoo_t Now it compiles with the new Berkeley DB deps. (but is still compatible to the old ones)
|
|
|
|
AlexMerced (OP)
|
|
May 05, 2013, 09:14:06 PM |
|
sweet thanks, much appreciated, so now to hunt down and change everything, lol
|
|
|
|
AlexMerced (OP)
|
|
May 06, 2013, 11:35:18 PM |
|
Found the cause of this error: it's a naming collision, pthread_t in the Ltc source is something different than pthread_t in Berkeley DB. (and pthread_t doesn't appear in Btc0.8.1)
Solution: rename all occurrences of pthread_t in Ltc0.6.3 to pthreadfoo_t Now it compiles with the new Berkeley DB deps. (but is still compatible to the old ones)
do you know which files pthread_t is mentioned I'm going through the files and doing a find & replace and not finding any instances so far.
|
|
|
|
AlexMerced (OP)
|
|
May 07, 2013, 11:47:09 AM |
|
Bump for answers
|
|
|
|
JohnDorien
|
|
May 07, 2013, 11:51:35 AM |
|
add -D__NO_SYSTEM_INCLUDES to the crypto def parameters in the makefile, that made it work for me as it seemed to be a collision of bdb and sys definitions. Maybe if you have a look at my compiling problem, too? https://bitcointalk.org/index.php?topic=196652.0
|
|
|
|
AlexMerced (OP)
|
|
May 07, 2013, 02:50:03 PM |
|
add -D__NO_SYSTEM_INCLUDES to the crypto def parameters in the makefile, that made it work for me as it seemed to be a collision of bdb and sys definitions. Maybe if you have a look at my compiling problem, too? https://bitcointalk.org/index.php?topic=196652.0thanks, I'll try that when I get back home from work today
|
|
|
|
wiggi
|
|
May 07, 2013, 02:59:23 PM |
|
do you know which files pthread_t is mentioned I'm going through the files and doing a find & replace and not finding any instances so far.
in Util.h https://github.com/litecoin-project/litecoin/blob/0.6.3/src/util.hand only the first 4 "pthread_t" out of 8 (i.e. between "#ifdef WIN32" and "#else", it's better to leave the Linux part alone) But -D__NO_SYSTEM_INCLUDES would be the clean solution.
|
|
|
|
AlexMerced (OP)
|
|
May 07, 2013, 03:06:59 PM |
|
thanks, will do, you guys are the best!
|
|
|
|
AlexMerced (OP)
|
|
May 07, 2013, 11:28:59 PM |
|
New Problem, this one I think I know how to fix but thought I'd still post it cause I'm sure someone reading this thread in the future will have the same problem and will need the solution so if you know the solution please respond. the contents of my makefile # Copyright (c) 2009-2010 Satoshi Nakamoto # Distributed under the MIT/X11 software license, see the accompanying # file license.txt or http://www.opensource.org/licenses/mit-license.php. USE_UPNP:=0 INCLUDEPATHS= \ -I"C:\deps\boost_1_53_0" \ -I"C:\deps\db-4.8.30.NC\build_unix" \ -I"C:\deps\openssl-1.0.1e\include" LIBPATHS= \ -L"C:\deps\boost_1_53_0\stage\lib" \ -L"C:\deps\db-4.8.30.NC\build_unix" \ -L"C:\deps\openssl-1.0.1e" LIBS= \ -l boost_system-mgw46-mt-sd-1_53 \ -l boost_filesystem-mgw46-mt-sd-1_53 \ -l boost_program_options-mgw46-mt-sd-1_53 \ -l boost_thread-mgw46-mt-sd-1_53 \ -l db_cxx \ -l ssl \ -l crypto DEFS=-DWIN32 -D_WINDOWS -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6 -D__NO_SYSTEM_INCLUDES DEBUGFLAGS=-g CFLAGS=-mthreads -O2 -w -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter $(DEBUGFLAGS) $(DEFS) $(INCLUDEPATHS) TESTDEFS = -DTEST_DATA_DIR=$(abspath test/data) ifdef USE_UPNP INCLUDEPATHS += -I"C:\miniupnpc-1.6-mgw" LIBPATHS += -L"C:\miniupnpc-1.6-mgw" LIBS += -l miniupnpc -l iphlpapi DEFS += -DSTATICLIB -DUSE_UPNP=$(USE_UPNP) endif LIBS += -l kernel32 -l user32 -l gdi32 -l comdlg32 -l winspool -l winmm -l shell32 -l comctl32 -l ole32 -l oleaut32 -l uuid -l rpcrt4 -l advapi32 -l ws2_32 -l mswsock -l shlwapi # TODO: make the mingw builds smarter about dependencies, like the linux/osx builds are HEADERS = $(wildcard *.h) OBJS= \ obj/version.o \ obj/checkpoints.o \ obj/netbase.o \ obj/addrman.o \ obj/crypter.o \ obj/key.o \ obj/db.o \ obj/init.o \ obj/irc.o \ obj/keystore.o \ obj/main.o \ obj/net.o \ obj/protocol.o \ obj/bitcoinrpc.o \ obj/rpcdump.o \ obj/rpcnet.o \ obj/rpcrawtransaction.o \ obj/script.o \ obj/scrypt.o \ obj/sync.o \ obj/util.o \ obj/wallet.o \ obj/walletdb.o \ obj/noui.o all: litecoind.exe obj/scrypt.o: scrypt.c gcc -c $(CFLAGS) -o $@ $^ obj/%.o: %.cpp $(HEADERS) g++ -c $(CFLAGS) -o $@ $< litecoind.exe: $(OBJS:obj/%=obj/%) g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ $(LIBS) TESTOBJS := $(patsubst test/%.cpp,obj-test/%.o,$(wildcard test/*.cpp)) obj-test/%.o: test/%.cpp $(HEADERS) g++ -c $(TESTDEFS) $(CFLAGS) -o $@ $< test_litecoin.exe: $(TESTOBJS) $(filter-out obj/init.o,$(OBJS:obj/%=obj/%)) g++ $(CFLAGS) -o $@ $(LIBPATHS) $^ -lboost_unit_test_framework $(LIBS) clean: -del /Q litecoind test_litecoin -del /Q obj\* -del /Q obj-test\* -del /Q build.h
|
|
|
|
AlexMerced (OP)
|
|
May 08, 2013, 11:23:19 AM |
|
Bump for answers
|
|
|
|
JohnDorien
|
|
May 08, 2013, 11:26:04 AM |
|
compile with USE_UPNP= at the end of compiling statement
|
|
|
|
AlexMerced (OP)
|
|
May 08, 2013, 11:56:48 AM |
|
compile with USE_UPNP= at the end of compiling statement
will give that a shot when I get home today so basically your saying I should type into the command line the following mingw32-make -f makefile.mingw USE_PNP=
|
|
|
|
JohnDorien
|
|
May 08, 2013, 12:00:53 PM |
|
compile with USE_UPNP= at the end of compiling statement
will give that a shot when I get home today so basically your saying I should type into the command line the following mingw32-make -f makefile.mingw USE_PNP= correct
|
|
|
|
|