Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 22020

undefined reference to va_start during the linking phase

$
0
0

Hi I'm trying to create an executable by linking multiple .so files in linux.

During the linker phase i'm getting undefined reference to `va_end' error in one of th e.so file i'm linking.

I tried to grep the symbol on whole /usr/lib folder to search if it is present in any of the lib and it points to lstdc++. And I have added this library to the linker options but it didn't work out as expected.

I'm using gcc-10 on ubuntu 20.04. Could you help how to resolve this linking error.

Linker command:

usr/bin/gcc -B,asm,/usr/bin -L,ld,/usr/bin -DINCLUDE_HEADER -isystem/usr/include/c++/10 -isystem/usr/include/x86_64-linux-gnu/c++/10 -isystem/usr/include/c++/10/backward -isystem/usr/lib/gcc/x86_64-linux-gnu/10/include -isystem/usr/lib/gcc/x86_64-linux-gnu/10 -isystem/usr/include -isystem/usr/inlcude/x86_64-linux-gnu/ -isystem/usr/local/include -std=c++11 -fPIC  -I/vobs/opensrc/x86_64/boost1580/include -isystem/usr/include/c++/10 -isystem/usr/include/x86_64-linux-gnu/c++/10 -isystem/usr/include/c++/10/backward -isystem/usr/lib/gcc/x86_64-linux-gnu/10/include -isystem/usr/lib/gcc/x86_64-linux-gnu/10 -isystem/usr/include -isystem/usr/inlcude/x86_64-linux-gnu/ -isystem/usr/local/include -std=c++11 -fPIC  -Wl,-rpath-link,/lib/x86_64-linux-gnu -Wl,-rpath-link,/usr/lib/x86_64-linux-gnu/ -L/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu  -o /home/project/netexec -L/runtime/net /home/project/netexec/bin/cfgfile2.o /home/project/netexec/bin/maincfg2.o /home/project/netexec/bin/snmpcfg.o /home/project/netexec/bin/dynlib.o /home/project/netexec/bin/runtimesupport.o /vobs/magnolia/network/bin/netbase_linux2.o /vobs/magnolia/network/bin/misc_linux2.o /vobs/magnolia/network/bin/notemgr.o /home/project/netexec/bin/cfgfiledefs_linux.o-Wl,-no-as-needed -ldl -lpthread -lsupc++  -lpq -lpqxx -lbootp -L/home/project/folder2/bin -lInterface -L/vobs/linuxlib/usr/lib64 -lcrypto -lcrypto++  /home/project/netexec/bin/netexec.a
error:/usr/bin/ld: /home/project/folder2/bin/libInterface.so: undefined reference to `va_end'

I have two questions:

  1. If the symbol is missing, it should have errored out during the creation of Interface.so file. But it didn't complain then. But now it give error
  2. How to proceed to fix this error

Viewing all articles
Browse latest Browse all 22020

Trending Articles