Pages:
Author

Topic: Building headless Bitcoin and Bitcoin-qt on Windows - page 43. (Read 419389 times)

sr. member
Activity: 260
Merit: 251
So do I still need older mingw32 4.6.2 to compile old altcoins?
Don't quite know what or whom you are addressing?  But I'd say that it depends on the *coin?  Which version of which coin are you referring to?  And if the "makefile" for the old coin has a line such as
BOOST_SUFFIX?=-mgw46-mt-sd-1_52
or
   -lboost_thread-mgw46-mt-sd-1_53 \
then it sure looks like you need gcc 4.6.2 unless you change your makefiles yourself, and test yourself, and build the libraries yourself.

Hope this helps.

Ron
legendary
Activity: 1386
Merit: 1009
So do I still need older mingw32 4.6.2 to compile old altcoins?
sr. member
Activity: 260
Merit: 251
And I have news for you.  I have an addrman.h - serialize.h solution that compiles! Shocked
The reason MSVC++ gets ill at addrman.h as you say:

was not only those extra (()); around the big IMPLEMENT_SERIALIZE(...) macro in the CAddrMan class, that implements GetSerializeSize() Serialize() and Unserialize(), but also the extra complexity of the imbedded std::map mapUnkIds;!?

When the map<> is "levitated out" of the macro and placed in the #define IMPLEMENT_SERIALIZE(statements) macro in serialize.h the compiler hums!

Thanks Ron! Smiley I will try this--do you have those two files online somewhere so I can see exactly what you mean? 
No, but I'll put it here! This is 0.8.5 addrman.h though, not 0.8.6  I don't know if there's a difference?
Code:
#ifdef _MSC_VER
    IMPLEMENT_SERIALIZE
            (
            LOCK(cs);
                unsigned char
                    nVersion = 0;

                READWRITE(nVersion);
                READWRITE(nKey);
                READWRITE(nNew);
                READWRITE(nTried);

                CAddrMan
                    *am = const_cast(this);

                if (fWrite)
                {
                    int
                        nUBuckets = ADDRMAN_NEW_BUCKET_COUNT;

                    READWRITE(nUBuckets);
/************
                    std::map  
                        mapUnkIds;
************/  
                    int
                        nIds = 0;
                    for (std::map::iterator it = am->mapInfo.begin(); it != am->mapInfo.end(); it++)
                    {
                        if (nIds == nNew)
                            break; // this means nNew was wrong, oh ow
                        mapUnkIds[(*it).first] = nIds;

                        CAddrInfo
                            &info = (*it).second;

                        if (info.nRefCount)
                        {
                            READWRITE(info);
                            nIds++;
                        }
                    }
                    nIds = 0;
                    for (std::map::iterator it = am->mapInfo.begin(); it != am->mapInfo.end(); it++)
                    {
                        if (nIds == nTried)
                            break; /* this means nTried was wrong, oh ow */

                        CAddrInfo
                            &info = (*it).second;

                        if (info.fInTried)
                        {
                            READWRITE(info);
                            nIds++;
                        }
                    }
                    for (
                         std::vector >::iterator it = am->vvNew.begin();
                         it != am->vvNew.end();
                         it++
                        )
                    {
                        std::set
                            &vNew = (*it);

                        int
                            nSize = int( vNew.size() );

                        READWRITE(nSize);
                        for (std::set::iterator it2 = vNew.begin(); it2 != vNew.end(); it2++)
                        {
                        int
                            nIndex = mapUnkIds[*it2];
                        READWRITE(nIndex);
                        }
                    }
                }
                else
                {
                    int
                        nUBuckets = 0;

                    READWRITE(nUBuckets);
                    am->nIdCount = 0;
                    am->mapInfo.clear();
                    am->mapAddr.clear();
                    am->vRandom.clear();
                    am->vvTried =
                        std::vector >(
                                                        ADDRMAN_TRIED_BUCKET_COUNT,
                                                        std::vector(0)
                                                      );
                    am->vvNew =
                        std::vector >(
                                                    ADDRMAN_NEW_BUCKET_COUNT,
                                                    std::set()
                                                   );
                    for (int n = 0; n < am->nNew; n++)
                    {
                        CAddrInfo
                            &info = am->mapInfo[n];

                        READWRITE(info);
                        am->mapAddr[info] = n;
                        info.nRandomPos = int( vRandom.size() );
                        am->vRandom.push_back(n);
                        if (nUBuckets != ADDRMAN_NEW_BUCKET_COUNT)
                        {
                            am->vvNew[info.GetNewBucket(am->nKey)].insert(n);
                            info.nRefCount++;
                        }
                    }
                    am->nIdCount = am->nNew;

                    int
                        nLost = 0;

                    for (int n = 0; n < am->nTried; n++)
                    {
                        CAddrInfo
                            info;

                        READWRITE(info);

                        std::vector
                            &vTried = am->vvTried[info.GetTriedBucket(am->nKey)];

                        if (vTried.size() < ADDRMAN_TRIED_BUCKET_SIZE)
                        {
                            info.nRandomPos = int( vRandom.size() );
                            info.fInTried = true;
                            am->vRandom.push_back(am->nIdCount);
                            am->mapInfo[am->nIdCount] = info;
                            am->mapAddr[info] = am->nIdCount;
                            vTried.push_back(am->nIdCount);
                            am->nIdCount++;
                        }
                        else
                        {
                            nLost++;
                        }
                    }
                    am->nTried -= nLost;
                    for (int b = 0; b < nUBuckets; b++)
                    {
                        std::set
                            &vNew = am->vvNew[b];

                        int
                            nSize = 0;

                        READWRITE(nSize);
                        for (int n = 0; n < nSize; n++)
                        {
                            int
                                nIndex = 0;

                            READWRITE(nIndex);

                            CAddrInfo
                                &info = am->mapInfo[nIndex];

                            if (
                                (nUBuckets == ADDRMAN_NEW_BUCKET_COUNT) &&
                                (info.nRefCount < ADDRMAN_NEW_BUCKETS_PER_ADDRESS)
                               )
                            {
                                info.nRefCount++;
                                vNew.insert(nIndex);
                            }
                        }
                    }
                }
            )

#else
And in serialize.h :
Code:
#ifdef _MSC_VER
#define IMPLEMENT_SERIALIZE(statements)    \
    unsigned int GetSerializeSize(int nType, int nVersion) const  \
    {                                           \
        CSerActionGetSerializeSize ser_action;  \
        const bool fGetSize = true;             \
        const bool fWrite = false;              \
        const bool fRead = false;               \
        unsigned int nSerSize = 0;              \
        ser_streamplaceholder s;                \
        assert(fGetSize||fWrite||fRead); /* suppress warning */ \
        s.nType = nType;                        \
        s.nVersion = nVersion;                  \
    std::map  mapUnkIds;  \
        {statements}                            \
        return nSerSize;                        \
    }                                           \
    template                   \
    void Serialize(Stream& s, int nType, int nVersion) const  \
    {                                           \
        CSerActionSerialize ser_action;         \
        const bool fGetSize = false;            \
        const bool fWrite = true;               \
        const bool fRead = false;               \
        unsigned int nSerSize = 0;              \
        assert(fGetSize||fWrite||fRead); /* suppress warning */ \
    std::map  mapUnkIds;  \
        {statements}                            \
    }                                           \
    template                   \
    void Unserialize(Stream& s, int nType, int nVersion)  \
    {                                           \
        CSerActionUnserialize ser_action;       \
        const bool fGetSize = false;            \
        const bool fWrite = false;              \
        const bool fRead = true;                \
        unsigned int nSerSize = 0;              \
    std::map  mapUnkIds;  \
        assert(fGetSize||fWrite||fRead); /* suppress warning */ \
        {statements}                            \
    }
#else
Try that on your MSVC++ 2012 preprocessor/first pass! I think it will like it! My MSVC++ 2005 SP1 seems to digest it just fine.  I know it is kind of an engineering hack to just make it work, But I'm an engineer!  Software, hardware.  We just make things work.  It's sort of like what physicists do to mathematics Grin

Quote

 If I remove the extra parens, the MSVC preprocessor actually truncates the source so I think I have a good case for opening up a MS tech support ticket but I can't stomach that right now.

Quote
I am very curious, needless to say, how you have built your levelDB static .lib file! 

I built the whole 0.8.6 source from the distribution in the setup file, which includes the levelDB source--I never went to google to get it.  In other words, I installed 0.8.6 Bitcoin and used the src directory that ships with the installation.  I never had trouble building levelDB but I did create the project file from scratch.  I have no idea if my port of Bitcoin would pass all regression tests but it seems to work for me on testnet.

Just made a static library project for leveldb source tree, right out of the bitcoin sources. Actually downloaded all the versions too, from
https://code.google.com/p/leveldb/downloads/list
from 1.9 to 1.15, since bitcoin used 1.9 in 0.8.1  They all have the same directory "shape" as the leveldb directory in bitcoin.  Then "exclude from project" all the ones that say *_test.cc and *_bench.cc, "exclude" all port_*.* except port_win.*, ditto for env_*.cc except env_win.cc.  I kept memenv_test.cc because that is what bitcoin does when it builds its .a files?  That's about it. I don't even think you have to add LEVELDB_PLATFORM_WINDOWS to the prepocessor definitions? I think it "knows"?  Don't remember.  Oops, it seems I forgot a lot!  I worked from this:
http://leveldb.googlecode.com/git-history/windows/WINDOWS
Add each _test.cc, _bench.cc back in one at a time, compile (as and exe) any run them.  I did and the code passed all its own tests.  I think 12 of the 15, the other 3 need environment variables to drive the tests and I couldn't find any guidance on that Embarrassed  Another "how to build static libraries" videos seems needed!
Quote
Also, to continue from my personal message, one of the reasons I am publishing this is because I would like to see the mainstream financial world take a closer look at Bitcoin. 
I agree.  But I think you are too kind Grin   I want every desktop Windows machine on the internet using bitcoin! If you saw my link,
http://www.netmarketshare.com/operating-system-market-share.aspx?qprid=10&qpcustomd=0 in a previous messages here, there are 9 times more Windows desktops on the internet, that can be running full clients than all the others (Linux, mac, etc.) combined!   So I think that what you and I are doing is great!
Quote
I know from experience that many mainstream corporate software developers (at least the ones I know) will *NOT* enthusiastically embrace MinGW, gcc, etc, unless, maybe, if it involved Android.  But on Windows?? No way.   But the main reason is because I wanted to learn how it works and MSVC is great for stepping through code in debug. 
Absolutely! And the full screen real time debugger can do much more (this is to whet the appetite of those gcc-ers who have never seen a VC++ IDE in incremental link edit-compile-link-debug).  You can even edit while debugging and continue debugging!  All local variables, and automatics, globals, displayed in hex or decimal, with the ability to follow all the classes, members, derived, overloaded, resolved,..., watch points, intellisense,...  It may have been one of the few things that Microsoft got right. Oh and it can compile all of it for the ARM and other processor architectures too.  And it's all free with the Express editions.  The VS (Visual Studios) that one pays for have even more goodies. Even program guided optimization for those with the time and desire!  I'm not really trying to sell it since it is free Shocked  And it can help you edit and understand your code even if you stay in gcc!  Its  "solution explorer in Class View" shows all the classes, etc. etc.
Quote
 And then I thought it would be nice if I share my work Smiley
I thank you for that.  I will too, when I can get it to honestly save a new block (every time)!  It's close. I think I am getting some "deadlock" conditions while "-reindex"-ing and "compacting"?  Not always, leveldb will "corrupt" the last index file (.sst file in the chainstate directory) and drop out, letting bitcoin start to connect to peers.  Then random "deadlocks" occur in the net.cpp thread ThreadSocketHandler().  Back to debugging.

You know what Brian Kernighan said about debugging:
http://en.wikiquote.org/wiki/Brian_Kernighan

Ron
newbie
Activity: 25
Merit: 0
And I have news for you.  I have an addrman.h - serialize.h solution that compiles! Shocked
The reason MSVC++ gets ill at addrman.h as you say:

was not only those extra (()); around the big IMPLEMENT_SERIALIZE(...) macro in the CAddrMan class, that implements GetSerializeSize() Serialize() and Unserialize(), but also the extra complexity of the imbedded std::map mapUnkIds;!?

When the map<> is "levitated out" of the macro and placed in the #define IMPLEMENT_SERIALIZE(statements) macro in serialize.h the compiler hums!

Thanks Ron! Smiley I will try this--do you have those two files online somewhere so I can see exactly what you mean?   If I remove the extra parens, the MSVC preprocessor actually truncates the source so I think I have a good case for opening up a MS tech support ticket but I can't stomach that right now.

Quote
I am very curious, needless to say, how you have built your levelDB static .lib file! 

I built the whole 0.8.6 source from the distribution in the setup file, which includes the levelDB source--I never went to google to get it.  In other words, I installed 0.8.6 Bitcoin and used the src directory that ships with the installation.  I never had trouble building levelDB but I did create the project file from scratch.  I have no idea if my port of Bitcoin would pass all regression tests but it seems to work for me on testnet.

Also, to continue from my personal message, one of the reasons I am publishing this is because I would like to see the mainstream financial world take a closer look at Bitcoin.  I know from experience that many mainstream corporate software developers (at least the ones I know) will *NOT* enthusiastically embrace MinGW, gcc, etc, unless, maybe, if it involved Android.  But on Windows?? No way.   But the main reason is because I wanted to learn how it works and MSVC is great for stepping through code in debug.   And then I thought it would be nice if I share my work Smiley

 
hero member
Activity: 686
Merit: 504
always the student, never the master.
Hello Claire123,

Fantastic!

That is why I'm trying to offer an alternative build platform for Windows. The bitcoin source is the same. Not changed at all. Except with changes as above. It should (famous last words) be easier to pretty up a windows version in MSVC than in Qt. At least it seems so to me at this time. Qt is fine but it seems to have a lot of compatibility issues with its compiler, its libraries, etc.

Have you seen my thread on building BitcoinD and BitcoinQt using MSVC?
No I have not.  But I will be going there as soon as I finish responding here!
Quote
https://bitcointalksearch.org/topic/now-at-github-bitcoin-086-for-vs2013-32-and-64-bit-and-qt52-349094
Are you saying you want to get rid of Qt and use native Windows GUI?
Not really.  I'm saying that on the Windows platform we should have more choices.  And a working MSVC++ solution would be a start, allowing for alternate GUIs and daemons, and programs to talk to a normal full client daemon, etc.
Quote
I wonder if you could just turn the daemon into a DLL and then put a C# wrapper around it?  I've discovered that doing a GUI in C# is way easier than Qt.
Yes, and MSVC++ can gui up and application in short order with those same VS drag and drop design tools, etc.  For the fun of it, I just GUI'd up the Qt look and feel in design view and could make a pretty good imitation, FWIW  in short order.  Nothing behind it though.
Quote
Also, concerning the aborts when closing the application: when I was porting the latest bitcoin source (the unreleased latest from github) to MSVC about a month ago, I found a bug in their shutdown sequence that caused aborts.  It was due the shutdown unwinding the bitdb object which needed to be explicity closed() first.  The abort was happening in the boost string code and was difficult to track down.
I think you have found the bug I have been remarking upon since version 0.8.2 came out. Congratulations!
Quote
https://github.com/ClaireDuSoleil/bitcoin/commit/9987452a5d9c37afa8abf12abe85fc9429a3fb36

I don't know if this is what is causing this user's problem but I thought I would mention it.
I will look at that too!  I couldn't wait and went to read the first link.  Wow!  And I have news for you.  I have an
addrman.h - serialize.h solution that compiles! Shocked
The reason MSVC++ gets ill at addrman.h as you say:
Quote
Addrman.h was especially difficult and I ended up ... giving MSVC fits.
was not only those extra (()); around the big IMPLEMENT_SERIALIZE(...) macro in the CAddrMan class, that implements GetSerializeSize() Serialize() and Unserialize(), but also the extra complexity of the imbedded std::map mapUnkIds;!?

When the map<> is "levitated out" of the macro and placed in the #define IMPLEMENT_SERIALIZE(statements) macro in serialize.h the compiler hums!

My 0.8.5 MS'd sources compile fine.  But my MSVC++ static library build of the google levelDB blockchain database driver, seems to violate its own rules and I error at VerifyDB() at level 3, where serious levelDB "stuff" is happening.  Level 2 it's off to the races, until it gets a few new blocks and it actually has to write something to the .sst files in the chainstate directory.  I have tracked it down to (in levelDB source code terms)  the db/db_impl.cc code for DBImpl::Get(...) and possibly other methods' desire to do a MaybeScheduleCompaction.  The compaction deletes file(s) from the table of cached .sst files, somehow not notifying the rest of levelDB, and/or deleting them properly via DeleteEntry()!  Then when .sst file x is needed, db/table_cache.cc method TableCache::FindTable() doesn't find it in the table, and tries to open it, but it is open and Windows says no!  So FindTable() errors.

I think it is my MSVC++ version of levelDB (1.13 version) that isn't "locking" out the rest of itself correctly, when it is compacting, though I can't prove it.  When I compile out various MaybeScheduleCompaction() I can get through VerifyDB() at level 3, but when I get enough new blocks it still happens.  The result is a "spoiled" .sst file and so the whole chainstate index file system is vetoed and one must -reindex or bring a saved backup block testing blockchain to continue testing.  Which is what I have been doing for about a week now Sad

I am very curious, needless to say, how you have built your levelDB static .lib file!  I used the
files given in a google discussion I found at:
https://groups.google.com/forum/#!topic/leveldb/VuECZMnsob4
see message from Edouard A dated 6/20/11 where there are three (magic) files:
port_win.h, port_win.cc and env_boost.cc
They almost did it for me!  The std:move() in env_boost.cc LockFile(...) stops me dead with my MSVC++.  I like the older ones that still can do a straight console app, a simple windows form (aka ol' dialog box app), doesn't have a broken (too much) intellisense, etc. Grin
Anyway, I dug further and came upon this thread https://groups.google.com/forum/#!msg/leveldb/MpLZkz7rcHk/b9B3Eka6jdQJ with the same Edouard A  dated 7/3/12.  I used those files to create a levelDB113 static library project.  I will look forward to seeing how you did it!  See my message #322 on building the other static libraries.  Hope this helps.  I will Github some commits on a forked branch of 0.8.6 or 0.8.5 soon.  But I would like to have a truly working version first.

Ron

You make by far the most entertaining and knowledgeable posts on the forum. i enjoy reading them very much.
+1
sr. member
Activity: 260
Merit: 251
Hello Claire123,

Fantastic!

That is why I'm trying to offer an alternative build platform for Windows. The bitcoin source is the same. Not changed at all. Except with changes as above. It should (famous last words) be easier to pretty up a windows version in MSVC than in Qt. At least it seems so to me at this time. Qt is fine but it seems to have a lot of compatibility issues with its compiler, its libraries, etc.

Have you seen my thread on building BitcoinD and BitcoinQt using MSVC?
No I have not.  But I will be going there as soon as I finish responding here!
Quote
https://bitcointalksearch.org/topic/now-at-github-bitcoin-086-for-vs2013-32-and-64-bit-and-qt52-349094
Are you saying you want to get rid of Qt and use native Windows GUI?
Not really.  I'm saying that on the Windows platform we should have more choices.  And a working MSVC++ solution would be a start, allowing for alternate GUIs and daemons, and programs to talk to a normal full client daemon, etc.
Quote
I wonder if you could just turn the daemon into a DLL and then put a C# wrapper around it?  I've discovered that doing a GUI in C# is way easier than Qt.
Yes, and MSVC++ can gui up and application in short order with those same VS drag and drop design tools, etc.  For the fun of it, I just GUI'd up the Qt look and feel in design view and could make a pretty good imitation, FWIW  in short order.  Nothing behind it though.
Quote
Also, concerning the aborts when closing the application: when I was porting the latest bitcoin source (the unreleased latest from github) to MSVC about a month ago, I found a bug in their shutdown sequence that caused aborts.  It was due the shutdown unwinding the bitdb object which needed to be explicity closed() first.  The abort was happening in the boost string code and was difficult to track down.
I think you have found the bug I have been remarking upon since version 0.8.2 came out. Congratulations!
Quote
https://github.com/ClaireDuSoleil/bitcoin/commit/9987452a5d9c37afa8abf12abe85fc9429a3fb36

I don't know if this is what is causing this user's problem but I thought I would mention it.
I will look at that too!  I couldn't wait and went to read the first link.  Wow!  And I have news for you.  I have an
addrman.h - serialize.h solution that compiles! Shocked
The reason MSVC++ gets ill at addrman.h as you say:
Quote
Addrman.h was especially difficult and I ended up ... giving MSVC fits.
was not only those extra (()); around the big IMPLEMENT_SERIALIZE(...) macro in the CAddrMan class, that implements GetSerializeSize() Serialize() and Unserialize(), but also the extra complexity of the imbedded std::map mapUnkIds;!?

When the map<> is "levitated out" of the macro and placed in the #define IMPLEMENT_SERIALIZE(statements) macro in serialize.h the compiler hums!

My 0.8.5 MS'd sources compile fine.  But my MSVC++ static library build of the google levelDB blockchain database driver, seems to violate its own rules and I error at VerifyDB() at level 3, where serious levelDB "stuff" is happening.  Level 2 it's off to the races, until it gets a few new blocks and it actually has to write something to the .sst files in the chainstate directory.  I have tracked it down to (in levelDB source code terms)  the db/db_impl.cc code for DBImpl::Get(...) and possibly other methods' desire to do a MaybeScheduleCompaction.  The compaction deletes file(s) from the table of cached .sst files, somehow not notifying the rest of levelDB, and/or deleting them properly via DeleteEntry()!  Then when .sst file x is needed, db/table_cache.cc method TableCache::FindTable() doesn't find it in the table, and tries to open it, but it is open and Windows says no!  So FindTable() errors.

I think it is my MSVC++ version of levelDB (1.13 version) that isn't "locking" out the rest of itself correctly, when it is compacting, though I can't prove it.  When I compile out various MaybeScheduleCompaction() I can get through VerifyDB() at level 3, but when I get enough new blocks it still happens.  The result is a "spoiled" .sst file and so the whole chainstate index file system is vetoed and one must -reindex or bring a saved backup block testing blockchain to continue testing.  Which is what I have been doing for about a week now Sad

I am very curious, needless to say, how you have built your levelDB static .lib file!  I used the
files given in a google discussion I found at:
https://groups.google.com/forum/#!topic/leveldb/VuECZMnsob4
see message from Edouard A dated 6/20/11 where there are three (magic) files:
port_win.h, port_win.cc and env_boost.cc
They almost did it for me!  The std:move() in env_boost.cc LockFile(...) stops me dead with my MSVC++.  I like the older ones that still can do a straight console app, a simple windows form (aka ol' dialog box app), doesn't have a broken (too much) intellisense, etc. Grin
Anyway, I dug further and came upon this thread https://groups.google.com/forum/#!msg/leveldb/MpLZkz7rcHk/b9B3Eka6jdQJ with the same Edouard A  dated 7/3/12.  I used those files to create a levelDB113 static library project.  I will look forward to seeing how you did it!  See my message #322 on building the other static libraries.  Hope this helps.  I will Github some commits on a forked branch of 0.8.6 or 0.8.5 soon.  But I would like to have a truly working version first.

Ron
sr. member
Activity: 260
Merit: 251
What *coin and what version are we talking about here? See message #334.
What can MSVC 2010 do for you since I assume you built or had built for you a bitcoin-qt.exe using gcc? Are you using some commercial third party add on such as http://visualgdb.com/tutorials/mingw/ to gdb your code, perhaps?
Ron
As for MSVC I was running the exe itself in debug mode to catch any errors, but there was none. Anyway I solved my issues. There was a bad version of mingw32 somewhere in the mix, I only know because I removed everything and started clean and used easywinbuilder and it worked perfectly. I had previously tried easywinbuilder with no success but all is good now.
That's great! You have succeeded, now you get to do it again with the next version. Or are you off to modify your *coin sources to do new and better things?

Ron
newbie
Activity: 25
Merit: 0
That is why I'm trying to offer an alternative build platform for Windows. The bitcoin source is the same. Not changed at all. Except with changes as above. It should (famous last words) be easier to pretty up a windows version in MSVC than in Qt. At least it seems so to me at this time. Qt is fine but it seems to have a lot of compatibility issues with its compiler, its libraries, etc.

Have you seen my thread on building BitcoinD and BitcoinQt using MSVC?

https://bitcointalksearch.org/topic/now-at-github-bitcoin-086-for-vs2013-32-and-64-bit-and-qt52-349094

Are you saying you want to get rid of Qt and use native Windows GUI?

I wonder if you could just turn the daemon into a DLL and then put a C# wrapper around it?  I've discovered that doing a GUI in C# is way easier than Qt.

Also, concerning the aborts when closing the application: when I was porting the latest bitcoin source (the unreleased latest from github) to MSVC about a month ago, I found a bug in their shutdown sequence that caused aborts.  It was due the shutdown unwinding the bitdb object which needed to be explicity closed() first.  The abort was happening in the boost string code and was difficult to track down.

https://github.com/ClaireDuSoleil/bitcoin/commit/9987452a5d9c37afa8abf12abe85fc9429a3fb36

I don't know if this is what is causing this user's problem but I thought I would mention it.
newbie
Activity: 43
Merit: 0
something wrong in my try:
1.The whole process is very smooth until the step 2.3 which I got a reply:b2 command not found
2.in step 3.3,I got a reply as:"*** missing separator . stop" after I run the command:mingw32-make -f makefile.ming

what is the matter?
sr. member
Activity: 293
Merit: 250
So I believe there is just an issue with files that I have because it does not make sense the coin-qt.exe will not load, I have tried different coins with the same outcome. fresh VB
does VB stand for VirtualBox?
Quote
with win 7 ultimate on it 32 bit, built in 64 bit same thing. I have to be missing something vital, I hear that it is a memory error, but I do not have the error code, I have someone else working on it with me and I try to run it in VS 2010 but it does not throw any errors
What *coin and what version are we talking about here? See message #334.

What can MSVC 2010 do for you since I assume you built or had built for you a bitcoin-qt.exe using gcc? Are you using some commercial third party add on such as http://visualgdb.com/tutorials/mingw/ to gdb your code, perhaps?

Ron
As for MSVC I was running the exe itself in debug mode to catch any errors, but there was none. Anyway I solved my issues. There was a bad version of mingw32 somewhere in the mix, I only know because I removed everything and started clean and used easywinbuilder and it worked perfectly. I had previously tried easywinbuilder with no success but all is good now.
member
Activity: 84
Merit: 10

I've seen that also, however I couldn't reproduce the problem (it just worked like the previous versions did).
Did you need the workaround to compile boost? If so what are your system specs?


windows 8, x64. Yes i needed the workaround to compile a clean boost_1_55 download.
sr. member
Activity: 260
Merit: 251
So I believe there is just an issue with files that I have because it does not make sense the coin-qt.exe will not load, I have tried different coins with the same outcome. fresh VB
does VB stand for VirtualBox?
Quote
with win 7 ultimate on it 32 bit, built in 64 bit same thing. I have to be missing something vital, I hear that it is a memory error, but I do not have the error code, I have someone else working on it with me and I try to run it in VS 2010 but it does not throw any errors
What *coin and what version are we talking about here? See message #334.

What can MSVC 2010 do for you since I assume you built or had built for you a bitcoin-qt.exe using gcc? Are you using some commercial third party add on such as http://visualgdb.com/tutorials/mingw/ to gdb your code, perhaps?

Ron
sr. member
Activity: 260
Merit: 251
...
I think I found a problem.
It's in makefile-mingw of Litecoin
Is it different from bitcoin's makefile.mingw file?

If yes,can you write what i have to change,because i sepnt 3 hours ,and didn;t found.
Thanx in advice
Ah,

So finally we find out it's litecoin you are building. Well I don't follow litecoin. What version of litecoin? What version of bitcoin was/is litecoin basing its code from? There must be a litecoin specific forum where these matters are discussed? I don't know where it is though. It is hard enough just to keep track of bitcoin development Grin

Is there a place where you can just download a pre-built litecoind.exe and litecoin-qt.exe versions for windows ala sourceforge where bitcoin prebuilt for windows releases may be had?

If you must build your own, I would suggest that you do something like the following. Build a bitcoind.exe and bitcoin-qt.exe for the version that litecoin is derived from first. Then build the litecoind and litecoin-qt.exe and note the differences in the code and the make files. Using the correct libraries and compiler for the bitcoin version chosen is important, I should think.

This would work for any *coin derived from bitcoin. 

Ron
full member
Activity: 147
Merit: 100
I mean the wallet works and all but pops out a lot of errors when trying to close it.
Edit:
Works when compiled statically. Tested on both qt 4.8.5 and 5.2.
When I close Compiled altcoin-qt.exe,it crashes,
What can it be?
If you have been following this forum, the original static builds of bitcoin-qt.exe, built and run windows before bitcoin 0.8.5 and 0.8.6 all behaved erratically at exit. The cross compiled pre-built bitcoin-qt.exes that one got from source forge, generally behaved better at exit, though weren't perfect as I remember.

This means that if your *coin-qt.exe implementation is derived from a bitcoin qt sources pre 0.8.5, then you inherit all its capabilities and deficiencies.

The bitcoind.exes prebuilt from source forge may or may not have exited gracefully when commanded to "stop" remotely. I cannot say since I generally use a built on windows from sources bitcoind.exe. For me the bitcoind.exes built on windows exit more gracefully at 0.8.3 and above (0.8.5, 0.8.6) than previous versions.

So again, this means that if your *coind.exe implementation is derived from a bitcoind sources pre 0.8.3, then you inherit all its capabilities and deficiencies.

As an aside, if one has to abort, terminate or kill in some way a bitcoind.exe (and this goes for bitcoin-qt.exe too), there is no code to trap the 5 ways it can occur in Windows. The five ways are:
1. Ctl-C             (not in Qt)
2. Ctl-break       (not in Qt)
3. Close window (not in Qt)
4. Log-off user
5. Windows shutdown
The first two or three are under your control, the other two are not.
If you would like to trap those events, or some of them on Windows7, see message #176, on page 9 of this forum.

Hope this helps

Ron



I think I found a problem.
It's in makefile-mingw of Litecoin
Is it different from bitcoin's makefile.mingw file?

If yes,can you write what i have to change,because i sepnt 3 hours ,and didn;t found.
Thanx in advice
sr. member
Activity: 293
Merit: 250
So I got everything to compile, and I got the .dll 's that are needed. Now the qt.exe file does not launch and the altcoind.exe just opens a cmd window anythoughts?
Everything may be OK with your *coind.exe program! Since this is a linux/unix style daemon, the philosophy is the less output the better. Are you giving it any command line arguments to start? You should. A -datadir="your favorite place to store blockchains, etc." would be good! A -conf="where and what your configuration file is" would be really good too!

Can you close the command window of the *coind.exe? What happens? Do you have a debug log file in you data directory? What does it say? All of these will give you information to work with.

How can you tell that your *coin-qt.exe doesn't launch? Do you get a message? Do you get a splash screen? Again, with arguments as above but applied to the *coin-qt.exe program, are there any debug log files? This should help you get closer to the truth.

Ron


So I believe there is just an issue with files that I have because it does not make sense the coin-qt.exe will not load, I have tried different coins with the same outcome. fresh VB with win 7 ultimate on it 32 bit, built in 64 bit same thing. I have to be missing something vital, I hear that it is a memory error, but I do not have the error code, I have someone else working on it with me and I try to run it in VS 2010 but it does not throw any errors
full member
Activity: 131
Merit: 108
First post updated:
-new compiler version
-removed obsolete db.h patch
-static build instructions only
-latest master branch build instructions added
sr. member
Activity: 293
Merit: 250
So I got everything to compile, and I got the .dll 's that are needed. Now the qt.exe file does not launch and the altcoind.exe just opens a cmd window anythoughts?
Everything may be OK with your *coind.exe program! Since this is a linux/unix style daemon, the philosophy is the less output the better. Are you giving it any command line arguments to start? You should. A -datadir="your favorite place to store blockchains, etc." would be good! A -conf="where and what your configuration file is" would be really good too!

Can you close the command window of the *coind.exe? What happens? Do you have a debug log file in you data directory? What does it say? All of these will give you information to work with.

How can you tell that your *coin-qt.exe doesn't launch? Do you get a message? Do you get a splash screen? Again, with arguments as above but applied to the *coin-qt.exe program, are there any debug log files? This should help you get closer to the truth.

Ron

No I am not giving the command args, I will try that in a bit. I can close the *coind.exe it errors, like everyone else's lol. So I did not think to look for a log, thank you for the tips I will get back to you when I try what is suggested.
full member
Activity: 131
Merit: 108
I mean the wallet works and all but pops out a lot of errors when trying to close it.

Edit:
Works when compiled statically. Tested on both qt 4.8.5 and 5.2.

When I close Compiled altcoin-qt.exe,it crashes,

What can it be?

Did you compile a statically linked executable?
Build qt statically
eg
Code:
configure.bat -release -opensource -confirm-license -static -make libs -no-sql-sqlite -no-opengl -qt-zlib -qt-pcre -no-icu -no-gif -qt-libpng -qt-libjpeg -no-angle -no-vcproj -no-openssl -no-dbus -no-audio-backend -no-wmf-backend -no-qml-debug
then add static flags to your .pro file
Code:
--- C:/Users/devel/Desktop/bitcoin-qt.pro	Wed Jan 08 20:59:06 2014
+++ C:/litecoin-0.8.6.1/bitcoin-qt.pro Wed Jan 08 02:15:12 2014
@@ -8,6 +8,7 @@
 DEFINES += QT_GUI BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
 CONFIG += no_include_pwd
 CONFIG += thread
+CONFIG += static
 
 # for boost 1.37, add -mt to the boost libraries
 # use: qmake BOOST_LIB_SUFFIX=-mt
@@ -18,6 +19,15 @@
 # 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=-mgw48-mt-s-1_55
+BOOST_INCLUDE_PATH=C:/deps/boost_1_55_0
+BOOST_LIB_PATH=C:/deps/boost_1_55_0/stage/lib
+BDB_INCLUDE_PATH=C:/deps/db-4.8.30.NC/build_unix
+BDB_LIB_PATH=C:/deps/db-4.8.30.NC/build_unix
+OPENSSL_INCLUDE_PATH=C:/deps/openssl-1.0.1e/include
+OPENSSL_LIB_PATH=C:/deps/openssl-1.0.1e
+MINIUPNPC_INCLUDE_PATH=C:/deps/
+MINIUPNPC_LIB_PATH=C:/deps/miniupnpc
 
 OBJECTS_DIR = build
 MOC_DIR = build
@@ -50,7 +60,8 @@
 # on Windows: enable GCC large address aware linker flag
 win32:QMAKE_LFLAGS *= -Wl,--large-address-aware
 # i686-w64-mingw32
-win32:QMAKE_LFLAGS *= -static-libgcc -static-libstdc++
+#win32:QMAKE_LFLAGS *= -static-libgcc -static-libstdc++
+win32:QMAKE_LFLAGS *= -static
 
 # use: qmake "USE_QRCODE=1"
 # libqrencode (http://fukuchi.org/works/qrencode/index.en.html) must be installed for support
@@ -112,7 +123,7 @@
         QMAKE_RANLIB = $$replace(QMAKE_STRIP, strip, ranlib)
     }
     LIBS += -lshlwapi
-    genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
+    #genleveldb.commands = cd $$PWD/src/leveldb && CC=$$QMAKE_CC CXX=$$QMAKE_CXX TARGET_OS=OS_WINDOWS_CROSSCOMPILE $(MAKE) OPT=\"$$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_RELEASE\" libleveldb.a libmemenv.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libleveldb.a && $$QMAKE_RANLIB $$PWD/src/leveldb/libmemenv.a
 }
 genleveldb.target = $$PWD/src/leveldb/libleveldb.a
 genleveldb.depends = FORCE
full member
Activity: 147
Merit: 100
I mean the wallet works and all but pops out a lot of errors when trying to close it.
Edit:
Works when compiled statically. Tested on both qt 4.8.5 and 5.2.
When I close Compiled altcoin-qt.exe,it crashes,
What can it be?
If you have been following this forum, the original static builds of bitcoin-qt.exe, built and run windows before bitcoin 0.8.5 and 0.8.6 all behaved erratically at exit. The cross compiled pre-built bitcoin-qt.exes that one got from source forge, generally behaved better at exit, though weren't perfect as I remember.

This means that if your *coin-qt.exe implementation is derived from a bitcoin qt sources pre 0.8.5, then you inherit all its capabilities and deficiencies.

The bitcoind.exes prebuilt from source forge may or may not have exited gracefully when commanded to "stop" remotely. I cannot say since I generally use a built on windows from sources bitcoind.exe. For me the bitcoind.exes built on windows exit more gracefully at 0.8.3 and above (0.8.5, 0.8.6) than previous versions.

So again, this means that if your *coind.exe implementation is derived from a bitcoind sources pre 0.8.3, then you inherit all its capabilities and deficiencies.

As an aside, if one has to abort, terminate or kill in some way a bitcoind.exe (and this goes for bitcoin-qt.exe too), there is no code to trap the 5 ways it can occur in Windows. The five ways are:
1. Ctl-C             (not in Qt)
2. Ctl-break       (not in Qt)
3. Close window (not in Qt)
4. Log-off user
5. Windows shutdown
The first two or three are under your control, the other two are not.
If you would like to trap those events, or some of them on Windows7, see message #176, on page 9 of this forum.

Hope this helps

Ron


Thank you for such good answer.
I 'll try.
sr. member
Activity: 260
Merit: 251
So I got everything to compile, and I got the .dll 's that are needed. Now the qt.exe file does not launch and the altcoind.exe just opens a cmd window anythoughts?
Everything may be OK with your *coind.exe program! Since this is a linux/unix style daemon, the philosophy is the less output the better. Are you giving it any command line arguments to start? You should. A -datadir="your favorite place to store blockchains, etc." would be good! A -conf="where and what your configuration file is" would be really good too!

Can you close the command window of the *coind.exe? What happens? Do you have a debug log file in you data directory? What does it say? All of these will give you information to work with.

How can you tell that your *coin-qt.exe doesn't launch? Do you get a message? Do you get a splash screen? Again, with arguments as above but applied to the *coin-qt.exe program, are there any debug log files? This should help you get closer to the truth.

Ron
Pages:
Jump to: