Title: Help Compiling Litecoin for Windows Post by: AlexMerced on 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.0 I edited the dependency directors in the makefile.mingw which now saids: Code: # Copyright (c) 2009-2010 Satoshi Nakamoto Compiled it and got this: http://img.photobucket.com/albums/v416/alexmerced/CMDboost3.png Title: Re: Help Compiling Litecoin for Windows Post by: Mylon on 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.gz (http://download.oracle.com/berkeley-db/db-4.8.30.NC.tar.gz) Not 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)We'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: Code: cd /c/deps/ after configuring make sure to edit your build_unix/db.h by replacing line 113: Code: typedef pthread_t db_threadid_t; Code: typedef u_int32_t db_threadid_t; Title: Re: Help Compiling Litecoin for Windows Post by: wiggi on 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: Code: # Dependency library locations can be customized with: To get it to compile, I also commented out the "# regenerate src/build.h" section, and changed Code: # windows:BOOST_LIB_SUFFIX = -mgw44-mt-1_43 and Code: #windows:LIBS += -lole32 -luuid -lgdi32 Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on 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: Code: # Dependency library locations can be customized with: To get it to compile, I also commented out the "# regenerate src/build.h" section, and changed Code: # windows:BOOST_LIB_SUFFIX = -mgw44-mt-1_43 that and Code: #windows:LIBS += -lole32 -luuid -lgdi32 thanks, giving it a shot Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on 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: Code: # Dependency library locations can be customized with: To get it to compile, I also commented out the "# regenerate src/build.h" section, and changed Code: # windows:BOOST_LIB_SUFFIX = -mgw44-mt-1_43 and Code: #windows:LIBS += -lole32 -luuid -lgdi32 still have the same error :( Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on 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? Title: Re: Help Compiling Litecoin for Windows Post by: wiggi on 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/8561ef9a I 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) Title: Re: Help Compiling Litecoin for Windows Post by: wiggi on May 05, 2013, 07:19:16 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) 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) Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on May 05, 2013, 09:14:06 PM sweet thanks, much appreciated, so now to hunt down and change everything, lol
Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on 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. Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on May 07, 2013, 11:47:09 AM Bump for answers
Title: Re: Help Compiling Litecoin for Windows Post by: JohnDorien on 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 Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on 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.0 thanks, I'll try that when I get back home from work today Title: Re: Help Compiling Litecoin for Windows Post by: wiggi on 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. https://github.com/litecoin-project/litecoin/blob/0.6.3/src/util.h and 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. Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on May 07, 2013, 03:06:59 PM thanks, will do, you guys are the best!
Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on 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.
http://img.photobucket.com/albums/v416/alexmerced/CMDboost4.png the contents of my makefile Quote # 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 Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on May 08, 2013, 11:23:19 AM Bump for answers
Title: Re: Help Compiling Litecoin for Windows Post by: JohnDorien on May 08, 2013, 11:26:04 AM compile with USE_UPNP= at the end of compiling statement
Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on 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 Quote mingw32-make -f makefile.mingw USE_PNP= Title: Re: Help Compiling Litecoin for Windows Post by: JohnDorien on 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 Quote mingw32-make -f makefile.mingw USE_PNP= correct Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on May 09, 2013, 01:11:33 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 Quote mingw32-make -f makefile.mingw USE_PNP= correct I got the same error, if I went into the source and commented out miniupnp.h would that be adviseable? Title: Re: Help Compiling Litecoin for Windows Post by: Petr1fied on May 09, 2013, 01:18:04 AM I found commenting out this line worked:
Code: USE_UPNP:=0 At least when it came to compiling the daemon anyway. Title: Re: Help Compiling Litecoin for Windows Post by: Petr1fied on May 09, 2013, 06:31:48 PM OK figured out the correct way to resolve this issue by actually reading doc/build-msw.txt
Download this (http://miniupnp.tuxfamily.org/files/download.php?file=miniupnpc-1.8.20130503.tar.gz) and extract to C:\deps In a command prompt: Code: cd C:\deps\miniupnpc-1.8.20130503 In your alt coins src folder open makefile.mingw and change the miniupnpc part to this: Code: ifdef USE_UPNP The daemon should compile without problems after that regardless of whether or not you add USE_PNP= to the build parameters. You can even remove the comment on the line I mentioned in my previous post (if you added it). Still trying to figure out why I can't get the wallet to compile though. :'( Title: Re: Help Compiling Litecoin for Windows Post by: JohnDorien on May 09, 2013, 06:34:37 PM Sorry i made a mistake it has to be USE_UPNP=
Sorry for the forgotten "u" :) Title: Re: Help Compiling Litecoin for Windows Post by: Petr1fied on May 09, 2013, 06:38:06 PM damn, can't believe I didn't notice the lack of a U. That's copy and paste for you. I wondered why it didn't make a difference. :D
Still with the method I mentioned above you can compile with UPNP support if you want it. Title: Re: Help Compiling Litecoin for Windows Post by: wiggi on May 10, 2013, 07:06:39 PM Another daemon compile error, "Building headless Bitcoin and Bitcoin-qt on Windows" says
3.3 From a Windows command prompt run: cd C:\bitcoin\bitcoin-master\src mingw32-make -f makefile.mingw That's ok for bitcoin-master, litecoin0.6.3c gives me this error: make (e=5): Access is denied But it works from MinGw/MSYS shell. Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on May 11, 2013, 09:24:34 PM Ok I successfully compiled the daemon, when I try to compile litecoin.exe here is what I get
http://img.photobucket.com/albums/v416/alexmerced/CMDboost5.png Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on May 13, 2013, 12:05:56 AM bump
Title: Re: Help Compiling Litecoin for Windows Post by: nocoin on May 13, 2013, 12:16:00 AM Obviously, you need db_cxx.h somewhere in include dir. It's from berkeley db, as I remember.
Title: Re: Help Compiling Litecoin for Windows Post by: defaced on May 13, 2013, 12:21:08 AM May i suggest using gitian and gitian-win32 on linux and crosscompile, you will thank me later.
There is updated files here https://github.com/franko-org/franko/tree/master/contrib/gitian-descriptors Title: Re: Help Compiling Litecoin for Windows Post by: js2082 on May 13, 2013, 12:44:28 AM this is the berkeley DB include file, put it in your -I path.
Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on May 13, 2013, 12:53:10 PM May i suggest using gitian and gitian-win32 on linux and crosscompile, you will thank me later. There is updated files here https://github.com/franko-org/franko/tree/master/contrib/gitian-descriptors I appreciate that and I'll try that later on, I just know a lot of people have trouble doing this so I figured if I try to figure this out and document my efforts in this thread it'll help a lot of people down the road. Title: Re: Help Compiling Litecoin for Windows Post by: Remember remember the 5th of November on May 13, 2013, 12:56:57 PM I've compiled Bitcoind and Bitcoin-Qt AND PPCoind directly under Windows and MinGW.
Title: Re: Help Compiling Litecoin for Windows Post by: AlexMerced on May 13, 2013, 02:16:56 PM I've compiled Bitcoind and Bitcoin-Qt AND PPCoind directly under Windows and MinGW. How about litecoin? Title: Re: Help Compiling Litecoin for Windows Post by: worldspace on September 20, 2013, 08:43:05 PM i was able to compile bitcoin and litecoin but litecoin crashes at start :'(
|