> cd "/home/administrator
The first thing I would suggest you do is stop doing your software development in your admin account.
Are you busy surfing the web in a browser run from the admin account as well?
This is your linker command line (I think), it was horribly formatted.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
/usr/bin/c++ -g -O2
-fdebug-prefix-map=/home/administrator/ZM/zoneminder_1.35.16~20201211203052.orig=.
-fstack-protector-strong
-Wformat
-Werror=format-security
-Wdate-time
-D_FORTIFY_SOURCE=2
-std=c++11
-Wall
-D__STDC_CONSTANT_MACROS
-O2
-Wl,-Bsymbolic-functions
-Wl,-z,relro
-Wl,-z,now
-Wl,--as-needed
-rdynamic
CMakeFiles/zmc.dir/zmc.cpp.o
-o zmc
-L"/home/administrator/ZM/zoneminder_1.35.16~20201211203052.orig/src/libbcrypt"
-Wl,-rpath,"/home/administrator/ZM/zoneminder_1.35.16~20201211203052.orig/src/libbcrypt:"
libzm.a
-lrt
-lz
-ljpeg
-lssl
-lcrypto
-lpthread
-lpcre
-lgcrypt
-lmysqlclient
-lx264
-lmp4v2
/usr/local/lib/libavformat.a
/usr/local/lib/libavcodec.a
/usr/local/lib/libavdevice.a
/usr/local/lib/libavutil.a
/usr/local/lib/libswscale.a
/usr/local/lib/libswresample.a
-ldl
|
All those absolute paths to libav... are wrong.
You're saying you want the whole lib, lock stock and barrel.
Change them all to be of the form
-lavformat
so the linker can do what it's supposed to, which is search the library for the symbols it need.
> But for 'undefined reference's I cannot find a way to get rid of them.
> Cpp for '/usr/local/lib/libavcodec.a' have in first line #include <nvmpi.h> which contain these definitions.
> Do I have to specify somewhere in cmake location to nvmpi library (shouldn't 'libavcodec.a' know its position?)
The header files just tell the compiler what to expect.
You also have to tell the linker (via
-lfoo) the name of the library associated with that header file so it can actually reference the implementation you told the compiler (via the .h file) would exist.
> For error 'multiple definition of `av_rescale_delta' I just commented out definition inside 'zm_ffmpeg.cpp'
Yeah, you shouldn't need to do that either, if the libraries are properly specified.