Compilation of net-snmp source code (net-snmp-5.7.2-49.el7_9.2 version) fails on RHEL 7 - snmp

I have taken the latest net-snmp-5.7.2-49.el7_9.2 version available in RHEL7.
When I try to compile this version of net-snmp source code I am getting the below error:
net-snmp-5.7.2/agent/snmpd.c:457: undefined reference to `netsnmp_sd_listen_fds'
The make command fails.
Any idea what does this undefined reference error point to ?
Thanks,

Related

How can I fix this build error when building Qt 5.7 statically with MinGW?

When I tried to compile Qt 5.7 statically in order to get a standalone application for windows deployment with all dependencies as mentionned here i got the following errors:
C:\Qt\Qt5.7.0\5.7\Src\qtbase/qmake/library/qmakebuiltins.cpp: In member function 'QByteArray QMakeEvaluator::getCommandOutput(const QString&) const'
C:\Qt\Qt5.7.0\5.7\Src\qtbase/qmake/library/qmakebuiltins.cpp:419:94: error: '_popen' was not declared in this scope
+ QLatin1String(" && ") + args).toLocal8Bit().constData(), "r")) {
C:\Qt\Qt5.7.0\5.7\Src\qtbase/qmake/library/qmakebuiltins.cpp:427:23: error: '_pclose' was not declared in this scope
QT_PCLOSE(proc);
Makefile:204: recipe for target 'qmakebuiltins.o' failed
mingw32-make: *** [qmakebuiltins.o] Error 1
Building qmake failed, return code 2
My aim is to make the final release standalone and size optimized (only ncessary symbols that being used from the libs), also in the link i provided i don't see MinGw mentionned, I don't have nmake (and don't want to get it).
It's open source. All of our recipes and patches are released. MSYS2 has a track record of not being abandonware, but if you find places we can do better then please help out. MSYS2 is highly compatible .. with the rest of MSYS2. We can't promise more than that.

Installing Golang Oracle but getting "error: undefined reference to 'golang.org_x_tools_container_intsets.popcount'"

I tried installing Oracle on my Ubuntu machine using the following cmd:
go get golang.org/x/tools/cmd/oracle
but I am getting the following error:
#golang.org/x/tools/cmd/oracle
/home/rr/Proj/go/src/golang.org/x/tools/container/intsets/sparse.go:140: error: undefined reference to 'golang.org_x_tools_container_intsets.popcount'
/home/rr/Proj/go/src/golang.org/x/tools/container/intsets/util.go:51: error: undefined reference to 'golang.org_x_tools_container_intsets.popcount'
collect2: error: ld returned 1 exit status
My Go version is
go version xgcc (Ubuntu 4.9.1-0ubuntu1) 4.9.1 linux/amd64
Anyone else facing the same issue?
Seems like we need to remove gcc-go(installed using apt-get) and install Go from the website https://golang.org/ . This fixes the issue.

Can't compile and link library

I try to use a library compiled with gcc called matlisp based on fortran code. After specifyng the f77 compiler, I could performed the autoreconf, configure and make command to obtain the file libmatlisp.so.
But when I try to use it i get a:
Error opening shared object ".../libmatlisp.so":
/usr/lib/libf2c.so.2: undefined symbol: MAIN__.
And when i perform the command ld libmatlisp.so i get:
...
libmatlisp.so: undefined reference to `idamax_'
libmatlisp.so: undefined reference to `dger_'
/usr/lib/libf2c.so.2: undefined reference to `MAIN__'
libmatlisp.so: undefined reference to `zscal_'
libmatlisp.so: undefined reference to `dscal_'
....
Is there a way to improve the situation?
I already try this solution but it does not work.
I also try to change the compiler to gfortran but i get some some run time error messages mentionning missing libraries that are part of libf2c.
Ok. I move to a more recent source of matlisp 2012 instead of 2003, and it run properly in my environment now.

Compilation error: Undefined reference to

I'm working on a C program for getting events from Udev. The program has been compiled and tested on a host running Debian (With GCC 4.7.2-5).
Recently, switched to Ubuntu 12.04 LTS (With GCC 4.6.3). The same program fails to compile and halts during the linking phase.
automounter_main.c:(.text+0xd4e): undefined reference to `udev_new'
automounter_main.c:(.text+0xe02): undefined reference to `udev_device_new_from_devnum'
automounter_main.c:(.text+0xeb0): undefined reference to `udev_device_new_from_syspath'
automounter_main.c:(.text+0xf63): undefined reference to `udev_device_get_sysattr_list_entry'
automounter_main.c:(.text+0xf77): undefined reference to `udev_list_entry_get_name'
automounter_main.c:(.text+0xf85): undefined reference to `udev_device_get_sysattr_value'
automounter_main.c:(.text+0x100a): undefined reference to `udev_device_get_sysattr_value'
automounter_main.c:(.text+0x1055): undefined reference to `udev_device_get_sysattr_value'
automounter_main.c:(.text+0x1078): undefined reference to `udev_list_entry_get_next'
automounter_main.c:(.text+0x108c): undefined reference to `udev_device_get_parent'
automounter_main.c:(.text+0x1118): undefined reference to `udev_device_unref'
automounter_main.c:(.text+0x1122): undefined reference to `udev_unref'
The following steps were taken, but nothing seems to work.
Install all packages related to udev (udev, libudev-dev, libudev0). All the packages are reported to be the latest.
Create a Symlink in /usr/lib pointing the correct udev library.
Upgraded libc package
Symlink was verified using:
$ ls -l libudev*
lrwxrwxrwx 1 root root 39 Nov 27 15:57 libudev.so -> /lib/x86_64-linux-gnu/libudev.so.0.13.0)
Kindly help me find a way to resolve this error.
Thanks in advance.
My guess would be that you need to move -ludev to the end of the linking command line.

Cross-compiling with OpenSSL for Windows

I'm trying to compile the oauth-utils
http://mir.dnsalias.com/oss/oauth/start
for Windows from Ubuntu. I have compiled it on Windows before
(a few months back), but wanted to try cross-compiling.
I got openssl build using mingw32 ok, and put
libssl.a and libcrypto.a in the right place. The linker is now
finding the libraries (yay!) but I get the following error:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaac): undefined reference to `_CreateDCA#16'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xab9): undefined reference to `_CreateCompatibleDC#4'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xacc): undefined reference to `_GetDeviceCaps#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xadc): undefined reference to `_GetDeviceCaps#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xaf4): undefined reference to `_CreateCompatibleBitmap#12'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb04): undefined reference to `_SelectObject#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb18): undefined reference to `_GetObjectA#12'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb81): undefined reference to `_BitBlt#36'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xb8c): undefined reference to `_GetBitmapBits#12'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbe5): undefined reference to `_SelectObject#8'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbec): undefined reference to `_DeleteObject#4'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xbf6): undefined reference to `_DeleteDC#4'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libcrypto.a(rand_win.o):rand_win.c:(.text+0xc00): undefined reference to `_DeleteDC#4'
Any ideas what could be causing this?
Thanks.
Link with Gdi32.lib
Which version of OpenSSL are you trying to compile?
In general, I have found version 1.0 and newer with MinGW-w64 to work great.
See for example the OpenSSL cross-compilation for Windows tutorial.
It seems that if one remove everything between
static void readscreen(void)
{
#if !defined(OPENSSL_SYS_WINCE) && !defined(OPENSSL_SYS_WIN32_CYGWIN)
and
#endif /* !OPENSSL_SYS_WINCE */
}
in rand_win.c, that building works. I'm not 100% sure how safe removing this is.
Are you adding -mwindows to your link command?

Resources