Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: ironsniper on March 19, 2016, 03:19:34 AM



Title: mac wallet compile
Post by: ironsniper on March 19, 2016, 03:19:34 AM
has anyone successfully compile a wallet on mac using bitcoin source coder version 0.9.4 and got the wallet to work on a system that has never had a wallet on it? if so please reply here or pm me as i am having issues and could use some help/advice thanks


Title: Re: mac wallet compile
Post by: tonytumble on March 19, 2016, 04:54:05 PM
has anyone successfully compile a wallet on mac using bitcoin source coder version 0.9.4 and got the wallet to work on a system that has never had a wallet on it? if so please reply here or pm me as i am having issues and could use some help/advice thanks

what issues are you having? I compiled it successfully. follow the mac-build instructions. This is what i did.


Title: Re: mac wallet compile
Post by: ironsniper on March 20, 2016, 12:22:10 AM
compiling is one thing but i cannot get it to work on any other macs but my own, if it is a wallet compiled with qt4 i have no problems getting to work on other macs but qt5 and this newer source code is different


Title: Re: mac wallet compile
Post by: ca333 on March 20, 2016, 08:47:50 PM
compiling is one thing but i cannot get it to work on any other macs but my own, if it is a wallet compiled with qt4 i have no problems getting to work on other macs but qt5 and this newer source code is different

because this computers do not have the dependcies installed. You need to deploy the application for release and put/link all libraries in/to the application.

resources:
https://bitcointalk.org/index.php?topic=205017.msg2151575#msg2151575
https://bitcointalk.org/index.php?topic=205017.msg2155735#msg2155735
https://bitcointalk.org/index.php?topic=205017.msg2194628#msg2194628



Title: Re: mac wallet compile
Post by: ironsniper on March 27, 2016, 04:18:26 PM
compiling is one thing but i cannot get it to work on any other macs but my own, if it is a wallet compiled with qt4 i have no problems getting to work on other macs but qt5 and this newer source code is different

because this computers do not have the dependcies installed. You need to deploy the application for release and put/link all libraries in/to the application.

resources:
https://bitcointalk.org/index.php?topic=205017.msg2151575#msg2151575
https://bitcointalk.org/index.php?topic=205017.msg2155735#msg2155735
https://bitcointalk.org/index.php?topic=205017.msg2194628#msg2194628


i know, and i can get it to work that way all day long if it is a wallet based on older source code and compiled with qt4 but if it is code based off of 0.9.x source code i cant get it to work at all


Title: Re: mac wallet compile
Post by: ca333 on March 27, 2016, 05:00:31 PM
compiling is one thing but i cannot get it to work on any other macs but my own, if it is a wallet compiled with qt4 i have no problems getting to work on other macs but qt5 and this newer source code is different

because this computers do not have the dependcies installed. You need to deploy the application for release and put/link all libraries in/to the application.

resources:
https://bitcointalk.org/index.php?topic=205017.msg2151575#msg2151575
https://bitcointalk.org/index.php?topic=205017.msg2155735#msg2155735
https://bitcointalk.org/index.php?topic=205017.msg2194628#msg2194628


i know, and i can get it to work that way all day long if it is a wallet based on older source code and compiled with qt4 but if it is code based off of 0.9.x source code i cant get it to work at all

please make gist/pastebin of your error log.


Title: Re: mac wallet compile
Post by: ironsniper on March 31, 2016, 03:04:16 PM
just ignore my first question, the person i was doing the wallet for has moved on to an easier source code, but now i have a new question, how do i compile a wallet on 10.11 that will work on 10.6 and up?


Title: Re: mac wallet compile
Post by: jonnybravo0311 on March 31, 2016, 08:19:35 PM
You need to have the earlier OS version libraries.


Title: Re: mac wallet compile
Post by: ironsniper on April 01, 2016, 01:23:11 AM
the .sdk's? if thats it i have those i just need to figure out how to implement them


Title: Re: mac wallet compile
Post by: ca333 on April 01, 2016, 10:19:17 PM
the .sdk's? if thats it i have those i just need to figure out how to implement them

like explained in the documentation for maximum compatibility you should build all deps with the flags:

-mmacosx-version-min=10.7 -arch x86_64 -isysroot $(xcode-select --print-path)/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk

replace the version, architecture specification and sdk directory with yours desired ones to provide support for all versions >= the one from flag. One option is also to have a virtual machine with osx10.6 and build the wallet here and then only deploy it:
when build is finished you have to deploy the application to "put" all libraries inside the app-bundle and link them to bitcoin
so when you share it nobody needs the dependcies preinstalled.


reference:
https://github.com/bitcoin/bitcoin/blob/master/doc/build-osx.md#creating-a-release-build
https://github.com/bitcoin/bitcoin/blob/master/doc/release-process.md
https://github.com/bitcoin/bitcoin/tree/master/contrib/macdeploy


Title: Re: mac wallet compile
Post by: ironsniper on April 02, 2016, 02:04:40 AM
so i dont use homebrew or macports i just download all of the source code and compile from there?


Title: Re: mac wallet compile
Post by: ironsniper on April 09, 2016, 11:03:18 PM
i am unable to compile anything now, i keep getting the error ld: symbol(s) not found for architecture x86_64, no matter what i try i cannot get past this error, i have tried it on two different mac books, so far i can only compile on a pos imac running 10.7, is there any fix for this at all?


Title: Re: mac wallet compile
Post by: ironsniper on April 11, 2016, 02:45:33 PM
thanks


Title: Re: mac wallet compile
Post by: ironsniper on April 13, 2016, 03:43:17 PM
250k 1337 to whoever can help me solve this error when trying to compile a wallet to work on older versions of os x

Code:
clang: error: invalid arch name '-arch -all_load'
make: *** [Alphacoin-Qt.app/Contents/MacOS/Alphacoin-Qt] Error 1
19:57:38: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project alphacoin-qt (kit: Desktop)
When executing step "Make"


Title: Re: mac wallet compile
Post by: jonnybravo0311 on April 13, 2016, 05:07:53 PM
As I stated to you in PM, the error is that you aren't providing an architecture to the compiler.  You need to do something like "-arch native".  If you're trying to build for old OS X, you'll probably want to use "-arch i386".

Alphacoin?  That code hasn't been touched in 3 years.  Why are you trying to compile a dead coin wallet?

By the way, here's AlphaCoin compiled on OS X 10.11.4:

http://s16.postimg.org/j6q1nt9w5/Screen_Shot_2016_04_13_at_1_37_07_PM.png

It needs some help... the icon set is Litecoin... lol


Title: Re: mac wallet compile
Post by: ironsniper on April 13, 2016, 06:41:27 PM
i know all that and i only use alphacoin as a test, it was the first wallet i compiled as my fiancee needed a copy for windows, but i tried setting that setting and i dont know where else to put it as it is already set in the .pro file

edit here it is
Code:
# use: qmake "RELEASE=1"
contains(RELEASE, 1) {
    # Mac: compile for maximum compatibility (10.5, 32-bit)
    macx:QMAKE_CXXFLAGS += -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk
    macx:QMAKE_CFLAGS += -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk
    macx:QMAKE_LFLAGS += -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk


Title: Re: mac wallet compile
Post by: jonnybravo0311 on April 13, 2016, 06:57:05 PM
Those settings are only applied if you're building the release.  You'd have to run qmake RELEASE=1 for it to attempt to apply those settings.

What does the Makefile look like - especially the CFLAGS and CXXFLAGS?  It is there you'll find the architecture being used.  For example, after running qmake USE_QRCODE=1 on my system, my Makefile looks like this:

Code:
CC            = clang
CXX           = clang++
DEFINES       = -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6 -DUSE_QRCODE -DUSE_UPNP=1 -DSTATICLIB -DHAVE_BUILD_INFO -DMAC_OSX -DMSG_NOSIGNAL=0 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS        = -pipe -mmacosx-version-min=10.7 -O2 -arch x86_64 -Wall -W $(DEFINES)
CXXFLAGS      = -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -fstack-protector -O2 -arch x86_64 -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -D__NO_SYSTEM_INCLUDES $(DEFINES)
...

Notice the -arch x86_64.  Also notice the min OS version: 10.7.  Building for earlier versions of OS X requires you to have the proper SDKs installed, or that you build it directly on the older OS that contains the SDKs to which the build refers.


Title: Re: mac wallet compile
Post by: ironsniper on April 13, 2016, 07:15:01 PM
the error i posted above is what i get when i use RELEASE=1 and i do have the correct sdk's


Title: Re: mac wallet compile
Post by: jonnybravo0311 on April 13, 2016, 07:23:54 PM
Run qmake and post the contents of the Makefile it creates here.


Title: Re: mac wallet compile
Post by: ironsniper on April 13, 2016, 07:32:39 PM
Run qmake and post the contents of the Makefile it creates here.

i have tried other wallets aswell and get the same thing
it wont let me paste it here for some reason but here it is on pastebin

http://pastebin.com/ZrAW2jsd

edit i saw an error in the paste bin and have fixed it manually in the make file and now am getting a new message

Code:
ld: library not found for -lcrt1.10.6.o


Title: Re: mac wallet compile
Post by: jonnybravo0311 on April 13, 2016, 07:43:07 PM
What you posted doesn't make sense if you're trying to build on the old architecture (unless that's the mistake you fixed manually).  Here's what happens when I run qmake RELEASE=1 USE_QRCODE=1:

Code:
CC            = clang
CXX           = clang++
DEFINES       = -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6 -DUSE_QRCODE -DUSE_UPNP=1 -DSTATICLIB -DHAVE_BUILD_INFO -DMAC_OSX -DMSG_NOSIGNAL=0 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS        = -pipe -mmacosx-version-min=10.7 -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -O2 -arch x86_64 -Wall -W $(DEFINES)
CXXFLAGS      = -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -fstack-protector -O2 -arch x86_64 -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -D__NO_SYSTEM_INCLUDES $(DEFINES)

Your new error should be resolved by doing this in terminal:
Code:
xcode-select --install



Title: Re: mac wallet compile
Post by: ironsniper on April 13, 2016, 07:45:38 PM
What you posted doesn't make sense if you're trying to build on the old architecture (unless that's the mistake you fixed manually).  Here's what happens when I run qmake RELEASE=1 USE_QRCODE=1:

Code:
CC            = clang
CXX           = clang++
DEFINES       = -DQT_GUI -DBOOST_THREAD_USE_LIB -DBOOST_SPIRIT_THREADSAFE -DUSE_IPV6 -DUSE_QRCODE -DUSE_UPNP=1 -DSTATICLIB -DHAVE_BUILD_INFO -DMAC_OSX -DMSG_NOSIGNAL=0 -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
CFLAGS        = -pipe -mmacosx-version-min=10.7 -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -O2 -arch x86_64 -Wall -W $(DEFINES)
CXXFLAGS      = -pipe -stdlib=libc++ -mmacosx-version-min=10.7 -mmacosx-version-min=10.5 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -fstack-protector -O2 -arch x86_64 -fdiagnostics-show-option -Wall -Wextra -Wformat -Wformat-security -Wno-unused-parameter -D__NO_SYSTEM_INCLUDES $(DEFINES)

Your new error should be resolved by doing this in terminal:
Code:
xcode-select --install



i already have the command line tools installed


Title: Re: mac wallet compile
Post by: jonnybravo0311 on April 13, 2016, 08:07:17 PM
Well then I don't know what to tell you.  Something strange is going on with your build machine.  The Makefile you posted doesn't match the output of what should be there with RELEASE=1.  The library it is complaining about comes as a part of the command line tools.  Are you sure you have the proper versions of Xcode and the CLT installed for the version of the OS you're trying to use?


Title: Re: mac wallet compile
Post by: ironsniper on April 13, 2016, 08:15:09 PM
Well then I don't know what to tell you.  Something strange is going on with your build machine.  The Makefile you posted doesn't match the output of what should be there with RELEASE=1.  The library it is complaining about comes as a part of the command line tools.  Are you sure you have the proper versions of Xcode and the CLT installed for the version of the OS you're trying to use?
yup


Title: Re: mac wallet compile
Post by: ironsniper on April 15, 2016, 12:52:01 AM
am i correct in assuming that in order to compile a wallet to work on 10.6 and up i need to compile it on 10.6?


Title: Re: mac wallet compile
Post by: cr1776 on April 15, 2016, 01:03:10 AM
am i correct in assuming that in order to compile a wallet to work on 10.6 and up i need to compile it on 10.6?

I don't think so.  Likewise I don't think 0.9.4 was tested on pre-10.7 systems so that may be part of the issue.


Title: Re: mac wallet compile
Post by: ironsniper on April 15, 2016, 01:04:29 AM
if i remember right 0.9.4 is compiled with qt5, i avoid any code compiled with qt5 as i have nothing but issues, what i compile is qt4


Title: Re: mac wallet compile
Post by: ironsniper on April 16, 2016, 07:21:45 PM
does anyone know how to fix this error message? i get it from some coins but not others

Code:
Undefined symbols for architecture x86_64:
  "Db::verify(char const*, char const*, std::__1::basic_ostream<char, std::__1::char_traits<char> >*, unsigned int)", referenced from:
      CDBEnv::Verify(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >,
bool (*)(CDBEnv&, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >)) in db.o
      CDBEnv::Salvage(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, bool, std::__1::vector<std::__1::pair<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >,
std::__1::vector<unsigned char, std::__1::allocator<unsigned char> > >, std::__1::allocator<std::__1::pair<std::__1::vector<unsigned char, std::__1::allocator<unsigned char> >, std::__1::vector<unsigned char,
std::__1::allocator<unsigned char> > > > >&) in db.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [coinname-Qt.app/Contents/MacOS/coinname-Qt] Error 1
14:12:31: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project coinnqm-qt (kit: Desktop)
When executing step "Make"


Title: Re: mac wallet compile
Post by: bumbacoin on April 18, 2016, 01:30:45 PM
i googled the above post error, and possibly it's to do with yr db version.

----

probably not relevant any more to this thread :)
but you can see which dependencies are linked where by right clicking on coin-qt > show package contents > then navigate into Contents/MacOS
then do an otools on the coin-qt exec
something like

otools -L coin-qt.app/Contents/MacOS/coin-qt

then you can see if some of the deps are not correctly simlinked.

. i generally type otools -L then click drag the exec onto the command line and it completes full address for me


--


Title: Re: mac wallet compile
Post by: bumbacoin on April 18, 2016, 01:46:14 PM
i have a problem with building a stand alone app from 0.9.x up
how do you package the exec into an app?

        ./autogen.sh
        ./configure --with-gui=qt5
        make

ends up with bitcoin-qt in the qt folder, but i canna work out how to app it :p



Title: Re: mac wallet compile
Post by: ironsniper on April 18, 2016, 02:28:52 PM
i googled the above post error, and possibly it's to do with yr db version.

----

probably not relevant any more to this thread :)
but you can see which dependencies are linked where by right clicking on coin-qt > show package contents > then navigate into Contents/MacOS
then do an otools on the coin-qt exec
something like

otools -L coin-qt.app/Contents/MacOS/coin-qt

then you can see if some of the deps are not correctly simlinked.

. i generally type otools -L then click drag the exec onto the command line and it completes full address for me


--

no it is not db thanks to someone else i have gotten it figured out, as to your other question i gave up trying to compile any coin based off of 0.9 source code for mac i only do 0.9 for windows


Title: Re: mac wallet compile
Post by: ironsniper on April 20, 2016, 02:23:47 AM
hey all so i am working on a mac wallet and have packaged up the app and when i run it i get this error message

Code:
Error: Specified data directory "" does not exist.


Title: Re: mac wallet compile
Post by: bumbacoin on April 22, 2016, 04:00:01 AM

hey all so i am working on a mac wallet and have packaged up the app and when i run it i get this error message

Code:
Error: Specified data directory "" does not exist.

never seen such an error,
you could try specifiying a datadir
open a command line console
type

open blah/blah/qt.app --args -datadir=blah/blah/choosedatadir


Title: Re: mac wallet compile
Post by: ironsniper on April 23, 2016, 04:44:51 AM

hey all so i am working on a mac wallet and have packaged up the app and when i run it i get this error message

Code:
Error: Specified data directory "" does not exist.

never seen such an error,
you could try specifiying a datadir
open a command line console
type

open blah/blah/qt.app --args -datadir=blah/blah/choosedatadir

nope that didnt work and now for some reason when i try to package the apps and try to run them they just crash, i have messed up my compiler bad