-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
make error - execinfo_testfunc1.c - implicit declaration of function random #83
Comments
Hi, Any solution for this build error? I can install rtpproxy from yum, but it seems to be a beta version:
I'd rather get a latest stable build from github. |
just delete option "implicit-function-declaration " in Makefile |
Thanks for the suggestion. However, and please excuse my ignorance, but I cannot find "implicit-function-declaration" in any of these files: Makefile |
I'm having the same issue. However after running make again I'm getting this fatal error :
|
Thank you k3nz0, I didn't realise that there was a Makefile in that location. I removed -Werror=implicit-function-declaration from this Makefile, but I still get the following warnings and fatal error (stdatomic.h: No such file or directory):
I then realised that my sessionhad reverted back to gcc version 4.8.5, so I changed to 4.9.2 (by using However, I still get the following error (#error "BYTE_ORDER needs to be defined"):
That is as far as I got, and can't figure out how to resolve this last error (assuming this the correct troubleshooting path to take!) |
@solarmon this looks like a really weird one. Are you sure the system you are building on is not impaired in any way? random() is an integral part of C/Posix, if your system cannot compile it there must be something wrong with it. I mean WRONG BIG WAY. 👎 Check this link, it mandates stdlib.h, and that's exactly what that file does. |
Oh, folks, also I did not realize but you cannot compile with gcc 4.9 anymore as of few months ago. We fell in love C++11 atomics. Seriously, it's 2019 for god's sake! Get a real compiler. :) |
On a more serious note, we'll add documentation and autoconf check for a compiler version (gcc 5+ is a must these days with master/2.2), thanks for a reminder! Frankly I resisted dropping old gcc compilers, but it's just too much pain for virtually zero gain. |
I also use this same machine to build opensips from git source, using gcc 4.9 - so I don't think there is anything majorly wrong/impaired with it, not from understanding anyways. |
@solarmon see my later comment. We've dropped gcc 4.9 support few months ago (with great reluctance, but it's pretty much final and not coming back), so please try upgrading your suite to 5+, retry and report. 4.9 actually almost made it, stdatomics were kinda supported at that point, but not really. |
I updated gcc to 7.3 - as per https://stackoverflow.com/questions/36327805/how-to-install-gcc-5-3-with-yum-on-centos-7-2:
I deleted and redownloaded the rtpproxy git repository. However,
How do I verify my environment is OK?
|
I have same problem with @solarmon here: upgraded gcc but still getting an error when running make. GCC version: gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 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. Error when running make, mostly same with @solarmon 's: make
Making all in libexecinfo
make[1]: Entering directory `/home/admin/rtp_workspace/rtpproxy/libexecinfo'
gcc -DHAVE_CONFIG_H -I. -I../src -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_testfunc1.o -MD -MP -MF .deps/execinfo_check-execinfo_testfunc1.Tpo -c -o execinfo_check-execinfo_testfunc1.o `test -f 'execinfo_testfunc1.c' || echo './'`execinfo_testfunc1.c
execinfo_testfunc1.c: In function ‘testfunc1’:
execinfo_testfunc1.c:38:9: error: implicit declaration of function ‘random’; did you mean ‘rand_r’? [-Werror=implicit-function-declaration]
rnd = random() % 1024;
^~~~~~
rand_r
cc1: some warnings being treated as errors
make[1]: *** [execinfo_check-execinfo_testfunc1.o] Error 1
make[1]: Leaving directory `/home/admin/rtp_workspace/rtpproxy/libexecinfo'
make: *** [all-recursive] Error 1 To check if it's due to lacking of #include<stdlib.h>
#include<stdio.h>
int main() {
printf("Random is: %i\n", random());
} Any ideas? |
Looks like the os distribution in question having issue defining random()
in a manner prescribed by a standard. I will pop it into a VM quickly later
today and see how to fix it. In general that file is part of unit tests,
not part of the build itself.
…-Max
On Wed, Jun 12, 2019, 5:36 AM YAN KE ***@***.***> wrote:
I have same problem with @solarmon <https://github.com/solarmon> here:
upgraded gcc but still getting an error when running make.
GCC version:
gcc --version
gcc (GCC) 7.3.1 20180303 (Red Hat 7.3.1-5)
Copyright (C) 2017 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.
Error when running make, mostly same with @solarmon
<https://github.com/solarmon> 's:
make
Making all in libexecinfo
make[1]: Entering directory `/home/admin/rtp_workspace/rtpproxy/libexecinfo'
gcc -DHAVE_CONFIG_H -I. -I../src -Werror=implicit-function-declaration -Wall -D_DEFAULT_SOURCE -D_ISOC99_SOURCE -DLINUX_XXX -g3 -O0 -fno-omit-frame-pointer -g -O2 -MT execinfo_check-execinfo_testfunc1.o -MD -MP -MF .deps/execinfo_check-execinfo_testfunc1.Tpo -c -o execinfo_check-execinfo_testfunc1.o `test -f 'execinfo_testfunc1.c' || echo './'`execinfo_testfunc1.c
execinfo_testfunc1.c: In function ‘testfunc1’:
execinfo_testfunc1.c:38:9: error: implicit declaration of function ‘random’; did you mean ‘rand_r’? [-Werror=implicit-function-declaration]
rnd = random() % 1024;
^~~~~~
rand_r
cc1: some warnings being treated as errors
make[1]: *** [execinfo_check-execinfo_testfunc1.o] Error 1
make[1]: Leaving directory `/home/admin/rtp_workspace/rtpproxy/libexecinfo'
make: *** [all-recursive] Error 1
To check if it's due to lacking of stdlib.h, I tried to write and compile
following code, which passed the gcc compilation and got to run properly.
#include<stdlib.h>
#include<stdio.h>
int main() {
printf("Random is: %i\n", random());
}
Any ideas?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#83?email_source=notifications&email_token=AABVMJV5VVESWECY3SEA4HLP2DUWDA5CNFSM4HD2GRW2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODXQIMNI#issuecomment-501253685>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABVMJTEOI6OHCT2SCSC4Q3P2DUWDANCNFSM4HD2GRWQ>
.
|
@sobomax Hi, did you have any luck with trying to figure out what the issue is? |
@solarmon found CentOS 7.2 in my collection of weird VMs. Trying to dust it off and figure out how the heck you managed to run gcc 5 on this thing. 8-) |
I updated gcc to 7.3 - using the guide at https://stackoverflow.com/questions/36327805/how-to-install-gcc-5-3-with-yum-on-centos-7-2 I do find that I need to use the following command to tell my setup to use the new gcc version, when I start a new session:
|
like we need those to make us compiling on ancient linuxes, such as Centos 7.x. Bug report: #83
@solarmon bunch of changes went in to fix build on old-ish linuxes. Please check latest master and update. |
I wouldn't say CentOS 7.6 is old... I downloading the latest rtpproxy github repository. However, with gcc 7.6 I'm now getting a "ucl.h: No such file or directory" error
I installed the 'ucl-devel' package via yum, and it put the files in /usr/include/ucl/ - which included ucl,h:
However, this still did not resolve the "ucl.h: No such file or directory" error. I'm not sure where it is trying to look for the ucl.h header file, but I also noticed that the included libucl directory with the rtpproxy source from github does not include a ucl.h and this is where the make is failing - when it enters "/usr/local/src/rtpproxy/libucl".
Any suggestions? |
Sorry to bump this, but do you have any other suggestions on how to resolve this build issue? |
@solarmon |
Thanks. I did actually have that already as part of my build steps. I tried again following the same build notes I had previously. I don't know if something has been updated/fixed in the master repository since my last attempt, but this time the make completed! |
I have built the code done on centOS 7.4 with gcc 7.3 Update the devtool: Then enable the gcc 7.3 for current seesion: |
Hi,
I'm trying to build rtpproxy on a CentOS 7.6.1810 machine.
The make step is failing with:
I have tried upgrading git from 1.8.3 to 1.9 and also gcc from 4.8.5 to 4.9.2 but that did not make any difference.
Any suggestions on how to resolve this?
The text was updated successfully, but these errors were encountered: