Bitcoin Forum
September 30, 2016, 06:38:58 AM *
News: Due to DDoS attacks, there may be periodic downtime.
 
   Home   Help Search Donate Login Register  
Pages: « 1 [2]  All
  Print  
Author Topic: A few suggestions  (Read 18090 times)
satoshi
Founder
Sr. Member
*
qt
Offline Offline

Activity: 364


View Profile
December 14, 2009, 05:15:56 PM
 #21

Can anyone shed some light here?

g++ -c -O0 -Wno-invalid-offsetof -Wformat -g -D__WXMAC__ -DNOPCH -DBUILD_MACOSX -I"/usr/include" -I"/usr/local/include/wx-2.8" -I"/usr/local/include" -I"/usr/local/boost_1_41_0" -I"/sw/include/db4" -I"/usr/local/ssl/include" -I"/usr/local/lib/wx/include/mac-ansi-release-2.8" -o headers.h.gch headers.h
...
ui.h:430: error: no matching function for call to 'wxTextCtrl::SetValue(const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)'
/usr/local/include/wx-2.8/wx/textctrl.h:303: note: candidates are: virtual void wxTextCtrlBase::SetValue(const wxString&)

It looks like the implicit conversion from std::string to wxString isn't working.  That's used everywhere, the conversion needs to work.

wxString is complicated by supporting win32's 16-bit wchar and 8-bit ansi dual-compile.  You can get that problem on Windows if the "unicode" (meaning wchar) build is used, so that wxString is wchar and std::string is char.

It's probably some wxWidgets compile defines or build configuration.  What "configure" options did you use?

I'm not sure __WXMAC__ is the right define.  It may be the Mac Classic support that's complicating wxString, and we only want OSX.  Try __WXOSX__ (or see below)

http://docs.wxwidgets.org/stable/wx_cppconst.html
"There are two wxWidgets ports to Mac OS. One of them, wxMac, exists in two versions: Classic and Carbon. The Classic version is the only one to work on Mac OS version 8. The Carbon version may be built either as CFM or Mach-O (binary format, like ELF) and the former may run under OS 9 while the latter only runs under OS X. Finally, there is a new Cocoa port which can only be used under OS X. To summarize:

    * If you want to test for all Mac platforms, classic and OS X, you should test both __WXMAC__ and __WXCOCOA__.
    * If you want to test for any GUI Mac port under OS X, use __WXOSX__.
    * If you want to test for any port under Mac OS X, including, for example, wxGTK and also wxBase, use __DARWIN__"
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
December 15, 2009, 05:21:09 AM
 #22

Okay, I will look into the std::string issue. It is also throwing the same std::string issue on the latest version of Ubuntu Linux. So this isn't just OSX related. I have to say that my main background is C, not C++ so I am still learning some of the C++ data types/headers/and other specifics "as I go". Smiley

There are only defines for __WXCOCOA__ and __WXMAC__ in wx/defs.h (I must be missing something here..maybe my wxwidgets needs to be rebuilt -- I'll try that). I have tried combinations of those existing defines without success. The other option is to use gtk on OSX but the windowing will be slower and (my opinion) "ugly". Carbon would be the best selection for OSX.  I'll keep hacking at it until I get it working. Smiley

I also now have a working startup script for FreeBSD that will launch xorg's virtual framebuffer onto the localhost, fire up bitcoin and have the X11 screen output get stuffed into memory (instead of the monitor). This is a real big hack, but it does enable someone to run bitcoin as a pseudo unix daemon. I have had the code running for over 12h now and I don't detect any memory leaks or other weirdness.

Also I have a simple network monitor that will detect if bitcoin has crashed/stopped responding on port 8333, send me a page, and start the daemon back up again. This setup is ideal. I have started deploying seeds on servers I control that are all over the world. Smiley

One question: how do I enable the debug.log? I have tried stopping bitcoin and touching ~/.bitcoin/debug.log and starting bitcoin again. It never seems to write to the file. Am I missing something?

I will include these tools once I get SF setup.

Cheers!
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
December 15, 2009, 05:30:53 AM
 #23

Okay, I am on SF now. Username "madhatter2".

Smiley
satoshi
Founder
Sr. Member
*
qt
Offline Offline

Activity: 364


View Profile
December 15, 2009, 08:37:32 PM
 #24

It is also throwing the same std::string issue on the latest version of Ubuntu Linux.
Then it must be something you're doing differently with building or configuring wxWidgets.

What options did you use on the wxWidgets "configure" script?  The options I used are in build-unix.txt.

Quote
One question: how do I enable the debug.log? I have tried stopping bitcoin and touching ~/.bitcoin/debug.log and starting bitcoin again. It never seems to write to the file. Am I missing something?
Never heard of that happening.  Is there anything in debug.log?  If you touched the file, that sounds like something is there.  Does the program have write access to the file?
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
December 15, 2009, 09:14:13 PM
 #25

I used the default build options. I will try the options from your txt file. On FreeBSD it just worked right from the normal ports system. Which is excellent. It means that installing bitcoin via the same ports system (my goal) will be a snap.

Yes, the debug.log has the proper permissions. I'll re-read the source. There must be something I am missing.
sirius
Bitcoiner
Staff
Sr. Member
****
Offline Offline

Activity: 429



View Profile
December 16, 2009, 03:49:23 PM
 #26

I worked around the string problem by using wxWidgets 2.9. It worked with the default configuration.

Identifi - Decentralized address book with trust ratings
I'm not a forum admin - please contact theymos instead.
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
December 17, 2009, 01:21:49 PM
 #27

[madhatter@10 /home/madhatter/src/bitcoin]# diff -u headers.h.orig headers.h     
--- headers.h.orig      2009-12-14 12:29:39.000000000 +0000
+++ headers.h   2009-12-14 12:41:08.000000000 +0000
@@ -35,7 +35,12 @@
 #include <limits.h>
 #include <float.h>
 #include <assert.h>
+#ifndef BUILD_FREEBSD //malloc.h is part of stdlib.h on FreeBSD
 #include <malloc.h>
+#endif
+#ifdef BUILD_FREEBSD
+#include <netinet/in.h>
+#endif
 #include <memory>
 #define BOUNDSCHECK 1
 #include <sstream>

[madhatter@10 /home/madhatter/src/bitcoin]# cat makefile.fbsd
# Copyright (c) 2009 Satoshi Nakamoto
# Distributed under the MIT/X11 software license, see the accompanying
# file license.txt or http://www.opensource.org/licenses/mit-license.php.


ifneq "$(BUILD)" "debug"
ifneq "$(BUILD)" "release"
BUILD=debug
endif
endif
ifeq "$(BUILD)" "debug"
D=d
DEBUGFLAGS=-g
endif



INCLUDEPATHS= \
 -I"/usr/include" \
 -I"/usr/local/include" \
 -I"/usr/local/include/db47" \
 -I"/usr/local/include/wx-2.8" \
 -I"/usr/local/lib/wx/include/gtk2-ansi-release-2.8"

LIBPATHS= \
 -L"/usr/lib" \
 -L"/usr/local/lib" \
 -L"/usr/local/lib/db47"

LIBS= \
 -Wl,-Bstatic \
   -l boost_system -l boost_filesystem \
   -l db_cxx \
 -Wl,-Bdynamic \
   -l wx_base-2.8 \
   -l wx_gtk2_core-2.8 \
   -l wx_gtk2_html-2.8 \
   -l wx_gtk2_richtext-2.8 \
   -l crypto \
   -l gtk-x11-2.0 -l gthread-2.0 -l SM

WXDEFS=-D__WXGTK__ -DNOPCH -DBUILD_FREEBSD
CFLAGS=-O0 -Wno-invalid-offsetof -Wformat $(DEBUGFLAGS) $(WXDEFS) $(INCLUDEPATHS)
HEADERS=headers.h util.h main.h serialize.h uint256.h key.h bignum.h script.h db.h base58.h



all: bitcoin


headers.h.gch: headers.h $(HEADERS) net.h irc.h market.h uibase.h ui.h
        g++ -c $(CFLAGS) -o $@ $<

obj/util.o: util.cpp                $(HEADERS)
        g++ -c $(CFLAGS) -o $@ $<

obj/script.o: script.cpp            $(HEADERS)
        g++ -c $(CFLAGS) -o $@ $<

obj/db.o: db.cpp                    $(HEADERS) market.h
        g++ -c $(CFLAGS) -o $@ $<

obj/net.o: net.cpp                  $(HEADERS) net.h
        g++ -c $(CFLAGS) -o $@ $<

obj/main.o: main.cpp                $(HEADERS) net.h market.h sha.h
        g++ -c $(CFLAGS) -o $@ $<

obj/market.o: market.cpp            $(HEADERS) market.h
        g++ -c $(CFLAGS) -o $@ $<

obj/ui.o: ui.cpp                    $(HEADERS) net.h uibase.h ui.h market.h
        g++ -c $(CFLAGS) -o $@ $<

obj/uibase.o: uibase.cpp            uibase.h
        g++ -c $(CFLAGS) -o $@ $<

obj/sha.o: sha.cpp                  sha.h
        g++ -c $(CFLAGS) -O3 -o $@ $<

obj/irc.o: irc.cpp                  $(HEADERS)
        g++ -c $(CFLAGS) -o $@ $<




OBJS=obj/util.o obj/script.o obj/db.o obj/net.o obj/main.o obj/market.o \
        obj/ui.o obj/uibase.o obj/sha.o obj/irc.o

bitcoin: headers.h.gch $(OBJS)
        g++ $(CFLAGS) -o $@ $(LIBPATHS) $(OBJS) $(LIBS)

clean:
        -rm obj/*
        -rm headers.h.gch
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
December 17, 2009, 01:23:43 PM
 #28

To build on FreeBSD:

Install all of the required software from /usr/ports and then compile using the makefile.fbsd

"It just works". Smiley
satoshi
Founder
Sr. Member
*
qt
Offline Offline

Activity: 364


View Profile
December 17, 2009, 06:38:06 PM
 #29

That's good, is it running fine on FreeBSD?

I committed the changes to headers.h.  For consistency, I used __BSD__.  The complete list of defines is at http://docs.wxwidgets.org/stable/wx_cppconst.html
#ifdef __BSD__
#include <netinet/in.h>
#endif

malloc.h is only needed on windows, I'll move that into the __WXMSW__ section before it causes any more trouble.
The Doctor
Newbie
*
Offline Offline

Activity: 1


View Profile WWW
December 18, 2009, 03:11:53 PM
 #30

Hi.  I would like to second the headless/non-GUI mode for /*nix/i systems.  It would be useful to be able to start the Bitcoin software from an initscript or one's ~/.bashrc (or equivalent) file and let it run in the background, silently cranking away.

Also, what would the feasibility of changing the location of the wallet.dat file be for the Win32 client?  I ask this because I was playing around with the .zipped Windows Bitcoin client yesterday, and it struck me that it would make a good portable application.  I was toying with the idea of decompressing it into a TrueCrypt volume on a USB drive so that it could, say, be taken on the road, run for a few hours, and then shut down just before the volume was unmounted, but it created the wallet.dat file in the C:\Documents and Settings\username\Application Data\Bitcoin directory.  In effect, using a portable version of Bitcoin to eventually grow a portable wallet.
satoshi
Founder
Sr. Member
*
qt
Offline Offline

Activity: 364


View Profile
December 18, 2009, 05:37:48 PM
 #31

What you can currently do is set "Minimize to the tray" in options, then run it as "bitcoin -min" so it starts minimized.  The only visible part will be a small (20x20) icon on the tray, which can be doubleclicked if you want to access the UI.  Note: there's a bug with tray icons sometimes disappearing on 64-bit Karmic Koala, not sure if it's from 64-bit or Karmic, it was fine on 32-bit Jaunty.

We didn't have time to implement the "Start Bitcoin on system startup" feature on Linux in time for 0.2 so it's greyed out.  I figured Linux people wouldn't mind doing that manually anyway.  I guess they need to know about the -min switch to do it right.

You can locate the data directory where you want with the "-datadir=<directory>" switch.  I know someone is already doing that to put it on a TrueCrypt USB drive.
The Madhatter
Hero Member
*****
Offline Offline

Activity: 490


My avatar pic says it all


View Profile
December 30, 2009, 01:40:50 AM
 #32

Hello,

Great to see that the minor FreeBSD-specific changes have been added to the SVN. Thanks! Smiley

I am in the process of setting up more bitcoin seed notes (geographically distributed) as soon as I can find the time. (I am currently in the middle of moving the computer lab).

I should have some more minor cleanups/compile fixes here soon.

Cheers!
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!