I'm having an issue compiling an alt qt. From what I can tell, this is an issue with building a static/shared dependency miniupnpc. For the life of me I can't get past this error though no matter what I try.
Things I've tried;
- Compile shared and static miniupnpc with mingw32-make makefile.mingw upnpc-shared/static
- Tried disabling miniupnpc by qmake use_upnp=-
- Tried grabbing an old version of miniupnpc and using that
- Successfully built Bitcoind and Bitcoin-QT to make sure all deps were good
Here is the error.
./build\net.o:net.cpp:(.text+0x8673): undefined reference to `_imp__upnpDiscover
'
./build\net.o:net.cpp:(.text+0x86aa): undefined reference to `_imp__UPNP_GetVali
dIGD'
./build\net.o:net.cpp:(.text+0x86eb): undefined reference to `_imp__UPNP_GetExte
rnalIPAddress'
./build\net.o:net.cpp:(.text+0x8767): undefined reference to `_imp__freeUPNPDevl
ist'
./build\net.o:net.cpp:(.text+0x877a): undefined reference to `_imp__FreeUPNPUrls
'
./build\net.o:net.cpp:(.text+0x8867): undefined reference to `_imp__strupnperror
'
./build\net.o:net.cpp:(.text+0x88f3): undefined reference to `_imp__UPNP_AddPort
Mapping'
./build\net.o:net.cpp:(.text+0x897b): undefined reference to `_imp__UPNP_DeleteP
ortMapping'
./build\net.o:net.cpp:(.text+0x899a): undefined reference to `_imp__freeUPNPDevl
ist'
./build\net.o:net.cpp:(.text+0x89a9): undefined reference to `_imp__FreeUPNPUrls
'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bi
n/ld.exe: ./build\net.o: bad reloc address 0x20 in section `.data'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.2/../../../../i686-w64-mingw32/bi
n/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Makefile.Release:311: recipe for target 'release\coin-qt.exe' failed
mingw32-make: *** [release\coin-qt.exe] Error 1
Any suggestions or guidance would be much appreciated.
Well my apologies. 5 minutes after posting this I figured it out. Based on
this, I figured out that I needed to add this line to my Makefile.Release generated by qmake.
DEFINES = -DMINIUPNP_STATICLIB
I am getting same error.
Tried adding line below to Make.Release file still same error.
DEFINES = -DMINIUPNP_STATICLIB
Here's the error code.
./build\net.o:net.cpp:(.text+0x88f3): undefined reference to `_imp__upnpDiscover
'
./build\net.o:net.cpp:(.text+0x892a): undefined reference to `_imp__UPNP_GetVali
dIGD'
./build\net.o:net.cpp:(.text+0x896b): undefined reference to `_imp__UPNP_GetExte
rnalIPAddress'
./build\net.o:net.cpp:(.text+0x89e7): undefined reference to `_imp__freeUPNPDevl
ist'
./build\net.o:net.cpp:(.text+0x89fa): undefined reference to `_imp__FreeUPNPUrls
'
./build\net.o:net.cpp:(.text+0x8ae7): undefined reference to `_imp__strupnperror
'
./build\net.o:net.cpp:(.text+0x8b73): undefined reference to `_imp__UPNP_AddPort
Mapping'
./build\net.o:net.cpp:(.text+0x8bfb): undefined reference to `_imp__UPNP_DeleteP
ortMapping'
./build\net.o:net.cpp:(.text+0x8c1a): undefined reference to `_imp__freeUPNPDevl
ist'
./build\net.o:net.cpp:(.text+0x8c29): undefined reference to `_imp__FreeUPNPUrls
'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
n/ld.exe: ./build\net.o: bad reloc address 0x960 in section `.data'
C:/mingw32/bin/../lib/gcc/i686-w64-mingw32/4.9.1/../../../../i686-w64-mingw32/bi
n/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
Makefile.Release:291: recipe for target 'release\mycoin-qt.exe' failed
mingw32-make: *** [release\mycoin-qt.exe] Error 1
C:\mycoin>
anything to fix in net.cpp?
Thanks in advance.
Update.
Solved....
Managed to compiled qt without UPNP.
Now the problem is I can not connect 2 wallet peering because UPNP is disabled and have not set up nodes yet on my vps.
Error 'connections timeout' continuously.
Tried adding private IPs of both client machines in both clients .conf files.
Any trick to connect 2 clients peering without UPNP.
Or trick to enable UPNP without re-compiling.
Thanks in advance.
Update..
Managed to connect wallets and it's working fine.
Now the issue is i configured Max_Money 10Million and nsubsidy 1billion it means 100 percent premined at first block and 1 transaction for coinbase maturity.
But everytime i enter setgenerate true -1 in client consol new block is mined with another 10Million coins and all coins are immature.
Any help, how to set max money supply and 100 percent premined in src code i have done as following.
main.h
/** The maximum allowed size for a serialized block, in bytes (network rule) */
static const unsigned int MAX_BLOCK_SIZE = 1000000; // 1000KB block hard limit
/** Obsolete: maximum size for mined blocks */
static const unsigned int MAX_BLOCK_SIZE_GEN = MAX_BLOCK_SIZE/4; // 250KB block soft limit
/** Default for -blockmaxsize, maximum size for mined blocks **/
static const unsigned int DEFAULT_BLOCK_MAX_SIZE = 250000;
/** Default for -blockprioritysize, maximum space for zero/low-fee transactions **/
static const unsigned int DEFAULT_BLOCK_PRIORITY_SIZE = 17000;
/** The maximum size for transactions we're willing to relay/mine */
static const unsigned int MAX_STANDARD_TX_SIZE = 100000;
/** The maximum allowed number of signature check operations in a block (network rule) */
static const unsigned int MAX_BLOCK_SIGOPS = MAX_BLOCK_SIZE/50;
/** Default for -maxorphantx, maximum number of orphan transactions kept in memory */
static const unsigned int DEFAULT_MAX_ORPHAN_TRANSACTIONS = 25;
/** The maximum size of a blk?
?.dat file (since 0.
*/
static const unsigned int MAX_BLOCKFILE_SIZE = 0x8000000; // 128 MiB
/** The pre-allocation chunk size for blk?
?.dat files (since 0.
*/
static const unsigned int BLOCKFILE_CHUNK_SIZE = 0x1000000; // 16 MiB
/** The pre-allocation chunk size for rev?
?.dat files (since 0.
*/
static const unsigned int UNDOFILE_CHUNK_SIZE = 0x100000; // 1 MiB
/** Fake height value used in CCoins to signify they are only in the memory pool (since 0.
*/
static const unsigned int MEMPOOL_HEIGHT = 0x7FFFFFFF;
/** Dust Soft Limit, allowed with additional fee per output */
static const int64 DUST_SOFT_LIMIT = 100000; // 0.001 MYCOIN
/** Dust Hard Limit, ignored as wallet inputs (mininput default) */
static const int64 DUST_HARD_LIMIT = 1000; // 0.00001 MYCOIN mininput
/** No amount larger than this (in satoshi) is valid */
static const int64 MAX_MONEY = 10000000 * COIN;
inline bool MoneyRange(int64 nValue) { return (nValue >= 0 && nValue <= MAX_MONEY); }
/** Coinbase transaction outputs can only be spent after this number of new blocks (network rule) */
static const int COINBASE_MATURITY = 1;
/** Threshold for nLockTime: below this value it is interpreted as block number, otherwise as UNIX timestamp. */
static const unsigned int LOCKTIME_THRESHOLD = 500000000; // Tue Nov 5 00:53:20 1985 UTC
/** Maximum number of script-checking threads allowed */
static const int MAX_SCRIPTCHECK_THREADS = 16;
#ifdef USE_UPNP
static const int fHaveUPnP = true;
#else
static const int fHaveUPnP = false;
#endif
main.cpp
int64 nSubsidy = 10000000 * COIN;
static const int64 nTargetTimespan = 10 * 30; // MYCOIN: 5 minutes
static const int64 nTargetSpacing = 1 * 30; // MYCOIN: 30 seconds
I want to make 10million coin maximum, 100 percent premined and no more than 10million coins can generate.
Your help will be appriciated.
Thanks in advance.