Compiling a program for a class

New to Debian (Or Linux in general)? Ask your questions here!

Compiling a program for a class

Postby Telepxth » 2018-03-16 20:02

This possibly could need to be in a different section but I'm brand new to debian/linux just moved from Mac, so didn't know if this is my error or if it's actually a bug. I'm creating a client-server style application for a class for school, my group members are running centOS and I'm on debian, it compiles on their computer and not on mine. We are using tinyproxy as well. We are using an automake and when I try to make tinyproxy I get this error(below). I've searched around and the error looked like it pertained to a bug previously mentioned, https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831101 or https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=831195 but the first link says it need imms and I can't find imms in the debian 9 packages.

Error:



make[1]: Entering directory '/home/<user>/cisFiles/cis433/final_code/client'
Making all in src
make[2]: Entering directory '/home/<user>/cisFiles/cis433/final_code/client/src'
CC buffer.o
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/string:40,
from myRSA.h:3,
from RSAMethods.h:3,
from buffer.c:34:
/usr/include/c++/6/bits/stl_algobase.h:243:56: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
/usr/include/c++/6/bits/stl_algobase.h:265:56: error: macro "max" passed 3 arguments, but takes just 2
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^
In file included from /usr/include/c++/6/bits/stl_algo.h:60:0,
from /usr/include/c++/6/algorithm:62,
from /usr/local/include/cryptopp/stdcpp.h:18,
from /usr/local/include/cryptopp/cryptlib.h:103,
from /usr/local/include/cryptopp/rsa.h:11,
from myRSA.h:4,
from RSAMethods.h:3,
from buffer.c:34:
/usr/include/c++/6/bits/algorithmfwd.h:362:41: error: macro "max" passed 3 arguments, but takes just 2
max(const _Tp&, const _Tp&, _Compare);
^
/usr/include/c++/6/bits/algorithmfwd.h:375:41: error: macro "min" passed 3 arguments, but takes just 2
min(const _Tp&, const _Tp&, _Compare);
^
In file included from /usr/local/include/cryptopp/stdcpp.h:22:0,
from /usr/local/include/cryptopp/cryptlib.h:103,
from /usr/local/include/cryptopp/rsa.h:11,
from myRSA.h:4,
from RSAMethods.h:3,
from buffer.c:34:
/usr/include/c++/6/limits:320:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:324:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return _Tp(); }
^
/usr/include/c++/6/limits:387:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return false; }
^
/usr/include/c++/6/limits:390:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return true; }
^
/usr/include/c++/6/limits:456:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min(char); }
^
/usr/include/c++/6/limits:459:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max(char); }
^
/usr/include/c++/6/limits:523:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return -__SCHAR_MAX__ - 1; }
^
/usr/include/c++/6/limits:526:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__; }
^
/usr/include/c++/6/limits:593:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return 0; }
^
/usr/include/c++/6/limits:596:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __SCHAR_MAX__ * 2U + 1; }
^
/usr/include/c++/6/limits:666:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_min (wchar_t); }
^
/usr/include/c++/6/limits:669:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __glibcxx_max (wchar_t); }
^
/usr/include/c++/6/limits:858:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return -__SHRT_MAX__ - 1; }
^
/usr/include/c++/6/limits:861:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__; }
^
/usr/include/c++/6/limits:925:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return 0; }
^
/usr/include/c++/6/limits:928:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __SHRT_MAX__ * 2U + 1; }
^
/usr/include/c++/6/limits:998:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return -__INT_MAX__ - 1; }
^
/usr/include/c++/6/limits:1001:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__; }
^
/usr/include/c++/6/limits:1065:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return 0; }
^
/usr/include/c++/6/limits:1068:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __INT_MAX__ * 2U + 1; }
^
/usr/include/c++/6/limits:1137:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_MAX__ - 1; }
^
/usr/include/c++/6/limits:1140:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__; }
^
/usr/include/c++/6/limits:1204:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return 0; }
^
/usr/include/c++/6/limits:1207:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __LONG_MAX__ * 2UL + 1; }
^
/usr/include/c++/6/limits:1277:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return -__LONG_LONG_MAX__ - 1; }
^
/usr/include/c++/6/limits:1280:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__; }
^
/usr/include/c++/6/limits:1347:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return 0; }
^
/usr/include/c++/6/limits:1350:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __LONG_LONG_MAX__ * 2ULL + 1; }
^
/usr/include/c++/6/limits:1598:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return __FLT_MIN__; }
^
/usr/include/c++/6/limits:1601:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __FLT_MAX__; }
^
/usr/include/c++/6/limits:1673:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return __DBL_MIN__; }
^
/usr/include/c++/6/limits:1676:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __DBL_MAX__; }
^
/usr/include/c++/6/limits:1748:11: error: macro "min" requires 2 arguments, but only 1 given
min() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MIN__; }
^
/usr/include/c++/6/limits:1751:11: error: macro "max" requires 2 arguments, but only 1 given
max() _GLIBCXX_USE_NOEXCEPT { return __LDBL_MAX__; }
^
In file included from main.h:25:0,
from buffer.c:28:
/usr/include/c++/6/bits/stl_algobase.h:195:5: error: expected unqualified-id before ‘const’
min(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/6/bits/stl_algobase.h:195:5: error: expected ‘)’ before ‘const’
/usr/include/c++/6/bits/stl_algobase.h:195:5: error: expected ‘)’ before ‘const’
/usr/include/c++/6/bits/stl_algobase.h:195:5: error: expected initializer before ‘const’
/usr/include/c++/6/bits/stl_algobase.h:219:5: error: expected unqualified-id before ‘const’
max(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/6/bits/stl_algobase.h:219:5: error: expected ‘)’ before ‘const’
/usr/include/c++/6/bits/stl_algobase.h:219:5: error: expected ‘)’ before ‘const’
/usr/include/c++/6/bits/stl_algobase.h:219:5: error: expected initializer before ‘const’
In file included from /usr/include/c++/6/bits/char_traits.h:39:0,
from /usr/include/c++/6/string:40,
from myRSA.h:3,
from RSAMethods.h:3,
from buffer.c:34:
/usr/include/c++/6/bits/stl_algobase.h:243:5: error: ‘std::min’ declared as an ‘inline’ variable
min(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:246:7: error: expected primary-expression before ‘if’
if (__comp(__b, __a))
^~
/usr/include/c++/6/bits/stl_algobase.h:246:7: error: expected ‘}’ before ‘if’
/usr/include/c++/6/bits/stl_algobase.h:246:7: error: expected ‘;’ before ‘if’
/usr/include/c++/6/bits/stl_algobase.h:248:7: error: expected unqualified-id before ‘return’
return __a;
^~~~~~
/usr/include/c++/6/bits/stl_algobase.h:265:5: error: ‘max’ declared as an ‘inline’ variable
max(const _Tp& __a, const _Tp& __b, _Compare __comp)
^~~
/usr/include/c++/6/bits/stl_algobase.h:268:7: error: expected primary-expression before ‘if’
if (__comp(__a, __b))
^~
/usr/include/c++/6/bits/stl_algobase.h:268:7: error: expected ‘}’ before ‘if’
/usr/include/c++/6/bits/stl_algobase.h:268:7: error: expected ‘;’ before ‘if’
/usr/include/c++/6/bits/stl_algobase.h:270:7: error: expected unqualified-id before ‘return’
return __a;
^~~~~~
/usr/include/c++/6/bits/stl_algobase.h:271:5: error: expected declaration before ‘}’ token
}
^
Makefile:472: recipe for target 'buffer.o' failed
make[2]: *** [buffer.o] Error 1
make[2]: Leaving directory '/home/<user>/cisFiles/cis433/final_code/client/src'
Makefile:397: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/<user>/cisFiles/cis433/final_code/client'
Makefile:338: recipe for target 'all' failed
Telepxth
 
Posts: 7
Joined: 2018-03-16 19:48
Location: Oregon

Re: Compiling a program for a class

Postby stevepusser » 2018-03-16 20:43

What version of the gcc compiler are your group mates using on Centos?
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.2, Pale Moon 27.9.3, wine-staging 3.11, QuiteRSS 0.18.11, Linux kernel 4.17, Krita 4.1.0
User avatar
stevepusser
 
Posts: 9718
Joined: 2009-10-06 05:53

Re: Compiling a program for a class

Postby Telepxth » 2018-03-16 21:20

Gcc 4.8.5
Telepxth
 
Posts: 7
Joined: 2018-03-16 19:48
Location: Oregon

Re: Compiling a program for a class

Postby stevepusser » 2018-03-16 21:50

A lot of errors like you show could be because of the difference between the gxx-6 in Stretch and the gcc-4.x. You could try using Debian 8 (jessie) and use its gcc-4.9.2, or I have a gcc-4.9.4 in my Pale Moon Stretch repo, because it also needs that compiler.

https://build.opensuse.org/project/show ... evenpusser
https://forum.palemoon.org/viewtopic.php?f=37&t=11466


Then you have to set the compiler version in the environment to 4.9 before starting your build. Or perhaps you can find some patches to fix the build on gcc-6; that's something the Debian maintainers have to do for a lot of packages. That would be an even better solution, since gcc-4.X is no longer developed.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.2, Pale Moon 27.9.3, wine-staging 3.11, QuiteRSS 0.18.11, Linux kernel 4.17, Krita 4.1.0
User avatar
stevepusser
 
Posts: 9718
Joined: 2009-10-06 05:53

Re: Compiling a program for a class

Postby Telepxth » 2018-03-17 04:05

Thanks! I was at work all day so I haven't had time to try it, but I'll look into that, I appreciate the quick responses!
Telepxth
 
Posts: 7
Joined: 2018-03-16 19:48
Location: Oregon

Re: Compiling a program for a class

Postby stevepusser » 2018-03-18 18:59

I see tinyproxy 1.8.4 in the standard Debian 9 repository: https://packages.debian.org/stretch/tinyproxy so the Debian version probably has patches to build with gcc-6. Since it's already in the repo, the best way to get it is just to "apt install tinyproxy" as sysadmin.

If you have to build it from source for the class, you should inform your teacher that the best software for Debian is in proper deb package format, and then rebuild the packages from the debianized source with a couple of simple apt-get commands.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.2, Pale Moon 27.9.3, wine-staging 3.11, QuiteRSS 0.18.11, Linux kernel 4.17, Krita 4.1.0
User avatar
stevepusser
 
Posts: 9718
Joined: 2009-10-06 05:53

Re: Compiling a program for a class

Postby Telepxth » 2018-03-19 01:10

We are building on top of the tiny proxy code, which is why we compile it with the project. The project isn't a set project given by the professor we proposed an idea and then designed it. We needed a proxy for our project but instead of designing a proxy from scratch we built on top of tiny proxy.
Telepxth
 
Posts: 7
Joined: 2018-03-16 19:48
Location: Oregon

Re: Compiling a program for a class

Postby stevepusser » 2018-03-19 19:01

OK...the Debian way is just to install tinyproxy, but I was able to download the tinyproxy_1.8.4.orig. tarball from my Debian link, extract it, and try and compile it manually. The "./configure" step failed at first because I didn't have asciidoc installed, but after I installed it, both the configure and make steps were successful--none of the errors you are getting.

There aren't any patches at all for the Debian package to help with the gcc problem, so I have to wonder if you have an older version that you're trying to build that is not gcc-6 compatible. The Debian package also installs some extra stuff that the vanilla source does not, such as a systemd service to start it at boot with systemd.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.2, Pale Moon 27.9.3, wine-staging 3.11, QuiteRSS 0.18.11, Linux kernel 4.17, Krita 4.1.0
User avatar
stevepusser
 
Posts: 9718
Joined: 2009-10-06 05:53

Re: Compiling a program for a class

Postby Telepxth » 2018-03-20 04:12

Your previous reply is most likely correct about it being for gcc4, the project was started on centOS so the tinyproxy version was probably for gcc4 since thats what my groupmate's compiler version is. I'm sure I could move all our changes to the gcc6 version but since I wasn't the only one working on it, I don't know all the changes well enough that I want to go through and move it all to gcc6 compatible version, unless I have to. The project is pretty much done but it's something that I may want to work on in the future, if so, I would like to be able to test it on my home computer which is why I asked what the errors were. I will most likely download gcc4 and set the compiler version locally to gcc4 as you said before.I appreciate your help tho it is nice to see that the debian community is more than willing to help when people have problems.
Telepxth
 
Posts: 7
Joined: 2018-03-16 19:48
Location: Oregon

Re: Compiling a program for a class

Postby stevepusser » 2018-03-20 17:00

This is what I have the build system for Pale Moon export to the environment when it detects that it's on a release where the default gcc is not 4.X, which is the case in Stretch:
Code: Select all
export CC=gcc-4.9
export CXX=g++-4.9
export CPP=cpp-4.9
export LD=gcc-4.9


So you will need to install gcc-4.9, g++-4.9, and cpp-4.9 from my palemoon OBS repo.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.2, Pale Moon 27.9.3, wine-staging 3.11, QuiteRSS 0.18.11, Linux kernel 4.17, Krita 4.1.0
User avatar
stevepusser
 
Posts: 9718
Joined: 2009-10-06 05:53

Re: Compiling a program for a class

Postby Telepxth » 2018-03-22 20:45

I'm still getting the same error when I try to make. I installed gcc-4.9, g++-4.9, and cpp-4.9.
I exported the environment variables that you listed as well and echoed to make sure they were there.

<user>@Debian:~$ cpp-4.9 --version
cpp-4.9 (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

<user>@Debian:~$ g++-4.9 --version
g++-4.9 (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

<user>@Debian:~$ gcc-4.9 --version
gcc-4.9 (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Telepxth
 
Posts: 7
Joined: 2018-03-16 19:48
Location: Oregon

Re: Compiling a program for a class

Postby stevepusser » 2018-03-22 22:51

Can you point me to a source for the version of tinyproxy that you are using in the project? I'd like to see what it does for me, and if it compiles in Debian 8.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: GIMP 2.10.2, Pale Moon 27.9.3, wine-staging 3.11, QuiteRSS 0.18.11, Linux kernel 4.17, Krita 4.1.0
User avatar
stevepusser
 
Posts: 9718
Joined: 2009-10-06 05:53

Re: Compiling a program for a class

Postby Telepxth » 2018-03-23 04:10

I'll PM you tomorrow, it might be easier to find the problem if I just give you observer access to the repo. It's a private repo rn just because I want it to be working before I post it for my portfolio.
Telepxth
 
Posts: 7
Joined: 2018-03-16 19:48
Location: Oregon


Return to Beginners Questions

Who is online

Users browsing this forum: No registered users and 5 guests

fashionable