Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init.cpp #2

Closed
ddnut opened this issue Oct 8, 2017 · 11 comments
Closed

init.cpp #2

ddnut opened this issue Oct 8, 2017 · 11 comments

Comments

@ddnut
Copy link

ddnut commented Oct 8, 2017

Please remove lines 613 to 615 in init.cpp as it tosses errors and stops build on stock Ubuntu 16.04LTS

#ifdef USE_UPNP
printf("Using miniUPnP Client v%s API v%d\n", MINIUPNPC_VERSION, MINIUPNPC_API_VERSION);
#endif

when removed I get no errors and build goes great. Thanks
TeG5nkcRmdJBYVke6eMyRb31qtAzCVQUwh

@ghostlander
Copy link
Collaborator

Don't build with USE_UPNP if you have no libminiupnpc with its headers installed. MINIUPNPC_VERSION and MINIUPNPC_API_VERSION are defined in miniupnpc/miniupnpc.h

@ddnut
Copy link
Author

ddnut commented Oct 8, 2017

I did try with and without the USE_UPNP flag. I as well have libminiupnpc files installed. I did have the same issue on my pool with Orbit but no other coins on my neoscrypt machine.

@ghostlander
Copy link
Collaborator

What error do you get with it?

@ddnut
Copy link
Author

ddnut commented Oct 9, 2017

g++ -c -O2 -fomit-frame-pointer -fno-stack-protector -pthread -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -DBOOST_SPIRIT_THREADSAFE -I/root/TrezarCoin/src -I/root/TrezarCoin/src/obj -DUSE_UPNP=1 -DUSE_IPV6=1 -I/root/TrezarCoin/src/leveldb/include -I/root/TrezarCoin/src/leveldb/helpers -DHAVE_BUILD_INFO -MMD -MF obj/init.d -o obj/init.o init.cpp init.cpp: In function ‘bool AppInit2()’: init.cpp:614:51: error: ‘MINIUPNPC_VERSION’ was not declared in this scope printf("Using miniUPnP Client v%s API v%d\n", MINIUPNPC_VERSION, MINIUPNPC_API_VERSION); ^ init.cpp:614:70: error: ‘MINIUPNPC_API_VERSION’ was not declared in this scope printf("Using miniUPnP Client v%s API v%d\n", MINIUPNPC_VERSION, MINIUPNPC_API_VERSION); ^ make: *** [obj/init.o] Error 1

From fresh repo download same error

@ddnut
Copy link
Author

ddnut commented Oct 9, 2017

g++ -c -O2 -fomit-frame-pointer -fno-stack-protector -pthread -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -DBOOST_SPIRIT_THREADSAFE -I/root/TrezarCoin/src -I/root/TrezarCoin/src/obj -DUSE_UPNP=0 -DUSE_IPV6=1 -I/root/TrezarCoin/src/leveldb/include -I/root/TrezarCoin/src/leveldb/helpers -DHAVE_BUILD_INFO -MMD -MF obj/init.d -o obj/init.o init.cpp init.cpp: In function ‘bool AppInit2()’: init.cpp:614:51: error: ‘MINIUPNPC_VERSION’ was not declared in this scope printf("Using miniUPnP Client v%s API v%d\n", MINIUPNPC_VERSION, MINIUPNPC_API_VERSION); ^ init.cpp:614:70: error: ‘MINIUPNPC_API_VERSION’ was not declared in this scope printf("Using miniUPnP Client v%s API v%d\n", MINIUPNPC_VERSION, MINIUPNPC_API_VERSION); ^ make: *** [obj/init.o] Error 1
0 flag on miniUPnP above is 1 flag

so you can`t enable or disable with command. if you leave no flag on miniUPnP it builds without it looks to be

@ghostlander
Copy link
Collaborator

init.cpp lines 20 to 22:
#ifdef USE_UPNP
#include <miniupnpc/miniupnpc.h>
#endif

You haven't included it apparently. Set USE_UPNP=- to exclude all uPnP code.

@ddnut
Copy link
Author

ddnut commented Oct 9, 2017

and to include?

@ghostlander
Copy link
Collaborator

ghostlander commented Oct 9, 2017

trezarcoin-qt.pro lines 80 to 82:

# use: qmake "USE_UPNP=1" ( enabled by default; default)

# or: qmake "USE_UPNP=0" (disabled by default)

# or: qmake "USE_UPNP=-" (not supported)

First two options compile the UPnP support in, the last one doesn't.

If you have libminiupnpc installed in /usr/local/lib and its headers in /usr/local/include, add -I/usr/local/include to make sure the compiler doesn't miss them.

@ddnut
Copy link
Author

ddnut commented Oct 9, 2017

make -f makefile.unix USE_UPNP=1
g++ -c -O2 -fomit-frame-pointer -fno-stack-protector -pthread -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -DBOOST_SPIRIT_THREADSAFE -I/root/TrezarCoin/src -I/root/TrezarCoin/src/obj -DUSE_UPNP=1 -DUSE_IPV6=1 -I/root/TrezarCoin/src/leveldb/include -I/root/TrezarCoin/src/leveldb/helpers -DHAVE_BUILD_INFO -MMD -MF obj/init.d -o obj/init.o init.cpp init.cpp: In function ‘bool AppInit2()’: init.cpp:614:51: error: ‘MINIUPNPC_VERSION’ was not declared in this scope printf("Using miniUPnP Client v%s API v%d\n", MINIUPNPC_VERSION, MINIUPNPC_API_VERSION); ^ init.cpp:614:70: error: ‘MINIUPNPC_API_VERSION’ was not declared in this scope printf("Using miniUPnP Client v%s API v%d\n", MINIUPNPC_VERSION, MINIUPNPC_API_VERSION); ^ make: *** [obj/init.o] Error 1

make -f makefile.unix USE_UPNP=0
g++ -c -O2 -fomit-frame-pointer -fno-stack-protector -pthread -Wall -Wextra -Wno-ignored-qualifiers -Wformat -Wformat-security -Wno-unused-parameter -DBOOST_SPIRIT_THREADSAFE -I/root/TrezarCoin/src -I/root/TrezarCoin/src/obj -DUSE_UPNP=0 -DUSE_IPV6=1 -I/root/TrezarCoin/src/leveldb/include -I/root/TrezarCoin/src/leveldb/helpers -DHAVE_BUILD_INFO -MMD -MF obj/init.d -o obj/init.o init.cpp init.cpp: In function ‘bool AppInit2()’: init.cpp:614:51: error: ‘MINIUPNPC_VERSION’ was not declared in this scope printf("Using miniUPnP Client v%s API v%d\n", MINIUPNPC_VERSION, MINIUPNPC_API_VERSION); ^ init.cpp:614:70: error: ‘MINIUPNPC_API_VERSION’ was not declared in this scope printf("Using miniUPnP Client v%s API v%d\n", MINIUPNPC_VERSION, MINIUPNPC_API_VERSION); ^ make: *** [obj/init.o] Error 1

make -f makefile.unix USE_UPNP= built just fine (notice no -)
Strange issue maybe something to do with the LXC Xenial Xerus image but other coins build fine except Orbit. Any thoughts?

@ghostlander
Copy link
Collaborator

The same thing. Add -I/usr/local/include or where it is.

@ddnut
Copy link
Author

ddnut commented Oct 9, 2017

Oh I`ve never had it not take it from the environment variables. I will remember this one as searching came up with almost nothing. Thanks maybe this will help the next person that runs in to it and are baffled

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants