I am trying to compile following code webrtc2sip but getting following error.
root#dev1:/usr/local/src/webrtc2sip# g++ -g -O2 -o webrtc2sip webrtc2sip-mp_c2c.o webrtc2sip-mp_engine.o webrtc2sip-mp_mail.o webrtc2sip-mp_mediaproxy.o webrtc2sip-mp_mutex.o webrtc2sip-mp_net_transport.o webrtc2sip-mp_object.o webrtc2sip-mp_peer.o webrtc2sip-mp_proxyplugin.o webrtc2sip-mp_proxyplugin_consumer_audio.o webrtc2sip-mp_proxyplugin_consumer_video.o webrtc2sip-mp_proxyplugin_mgr.o webrtc2sip-mp_proxyplugin_producer_audio.o webrtc2sip-mp_proxyplugin_producer_video.o webrtc2sip-mp_session.o webrtc2sip-mp_session_av.o webrtc2sip-mp_wrap.o webrtc2sip-mp_db_sqlite.o webrtc2sip-sqlite3.o webrtc2sip-mp_db.o webrtc2sip-mp_db_model.o webrtc2sip-jsoncpp.o webrtc2sip-ActionConfig.o webrtc2sip-AudioResampler.o webrtc2sip-DDebug.o webrtc2sip-MediaContent.o webrtc2sip-MediaSessionMgr.o webrtc2sip-Msrp.o webrtc2sip-ProxyConsumer.o webrtc2sip-ProxyPluginMgr.o webrtc2sip-ProxyProducer.o webrtc2sip-SafeObject.o webrtc2sip-SipCallback.o webrtc2sip-SipEvent.o webrtc2sip-SipMessage.o webrtc2sip-SipSession.o webrtc2sip-SipStack.o webrtc2sip-SipUri.o webrtc2sip-SMSEncoder.o webrtc2sip-Xcap.o -L/usr/lib -L/usr/lib -L/usr/local/lib -ltinySAK -L/usr/local/lib -ltinyNET -L/usr/local/lib -ltinyHTTP -L/usr/local/lib -ltinySIP -L/usr/local/lib -ltinyDAV -L/usr/local/lib -ltinySDP -L/usr/local/lib -ltinyBFCP -L/usr/local/lib -ltinySIGCOMP -L/usr/local/lib -ltinyMEDIA -L/usr/local/lib -ltinyXCAP -L/usr/local/lib -ltinySMS -L/usr/local/lib -ltinyMSRP -L/usr/local/lib -ltinyRTP -L/usr/local/lib -ltinyIPSec -lxml2 -lpthread
/usr/bin/ld: webrtc2sip-sqlite3.o: undefined reference to symbol 'dlclose##GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
Edit:
I have tried following option in Makefile but no luck :(
LDFLAGS= -ldl
Solution:
Finally find it, used following option and it works!
./configure --prefix=$PREFIX CFLAGS='-lpthread' LDFLAGS='-ldl' LIBS='-ldl'
Related
I run it on Linux with x86/64 and ubuntu 2204, gcc version 11.2.0, GNU ld version 2.38.
When I run env LIBLEVELDB=/usr/local make in simpleleveldb dir and get this error:
cc -I. -I../simplehttp/.. -I/usr/local/include -I/usr/local/include -Wall -g -O2 -MM -MT simpleleveldb -MF simpleleveldb.deps simpleleveldb.c str_list_set.c
cc -I. -I../simplehttp/.. -I/usr/local/include -I/usr/local/include -Wall -g -O2 -o simpleleveldb simpleleveldb.c str_list_set.c -L. -L../simplehttp -L/usr/local/lib -L/usr/local/lib -L/usr/local/lib -levent -ljson-c -lsimplehttp -lleveldb -lm -lstdc++ -lsnappy -lpthread
/usr/bin/ld: /usr/local/lib/libsimplehttp.a(request.o):/home/zhdi/simplehttp/simplehttp/request.h:12: multiple definition of `simplehttp_reqs'; /usr/local/lib/libsimplehttp.a(simplehttp.o):/home/zhdi/simplehttp/simplehttp/request.h:12: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:26: simpleleveldb] Error 1
before do it I just build simplehttp follow this repo https://github.com/bitly/simplehttp.
Anyone has some idea? thanks!
this shit doesn't work. why?
gcc -c -Wall src/*.c -g -m64 && gcc -Iinclude *.o -o bin/debug/main -Lusr/local/lib -l libglfw && ./bin/debug/main
i get this linking error when trying to build the glfw window example
/usr/bin/ld: cannot find -l libglfw
collect2: error: ld returned 1 exit status
How do i import/link glfw and what is going wrong? I tried dynamically linking from usr/lib/x86_64-linux-gnu/libglfw.so but it didn't help. I'm pretty new to gcc and linux so i could just be stupid.
EDIT:
the comments pointed out a few mistakes i made so here's the new command, which is wrong too for some reason:
gcc -c -Wall src/*.c -g -m64 && gcc -Iinclude *.o -o bin/debug/main -L/usr/local/lib -lglfw && ./bin/debug/main
the new error:
/usr/bin/ld: main.o: in function `main':
/home/basti/dev/OpenGL/src/main.c:26: undefined reference to `glClear'
collect2: error: ld returned 1 exit status
I figured it out. Thanks to comments i managed to fix linking and didn't realize i had to import other opengl stuff.
In case somone is searching for an answer to the same problem here's my debug build command for sublime text 3:
gcc -c -Wall src/*.c -g -m64 && gcc -Iinclude *.o -o bin/debug/main -lglfw -lGLU -lGL && ./bin/debug/main
I'm on a linux system (arch linux specifically) and I'm trying to compile the introduction project from the official glfw page but I cannot seem to get gcc to compile it. If anyone doesn't know what I'm talking about it's this.
Also this is how I'm trying to compile it:
gcc -Iinclude test.c -o test -lglfw3 -lm -lGL -lGLU
and it gives me the following errors:
/usr/bin/ld: cannot find -lglfw3
collect2: error: ld returned 1 exit status
I completely forgot about this question until I got a notification for it. For me the solution was to not use -lglfw3 but rather use -lglfw
If you've installed pkg-config, and glfw3.pc is in the search path, try:
gcc -Iinclude test.c -o test `pkg-config --libs glfw3` -lm -lGL -lGLU
If you only have the static build, use: pkg-config --static --libs glfw3, which will add the dependencies that libglfw3.a requires.
Find libglfw3.a or libglfw3.so on your system
Mention that path to gcc using -L
gcc -Iinclude test.c -o test -L/dir/where/glfw3/resides -lglfw3 -lm -lGL -lGLU
I'm trying to build a software that uses gstreamer-1.0 and its plugins. I get this error when I try to make using the following g++ command:
g++ vis.cpp -o vis -O3 -D__STDC_CONSTANT_MACROS -std=c++11 -lopencv_highgui -lopencv_imgproc -lopencv_core -lpng -lv4l1 -lv4l2 -ldc1394 -lswscale -lavdevice -lavformat -lavcodec -lswresample -lavutil -lpthread -lbz2 -lz -lc -lrt -llzma -lva -Idependencies/include -Ldependencies/lib `pkg-config --cflags --libs gstreamer-1.0 gstreamer-base-1.0 gstreamer-app-1.0 gstreamer-pbutils-1.0 gtk+-2.0`
cap_gstreamer.cpp:(.text._ZN23CvVideoWriter_GStreamer4openEPKcid6CvSizeb+0x434): undefined reference to `gst_riff_create_video_caps'
collect2: error: ld returned 1 exit status
make: *** [vis] Error 1
Isn't gst_riff_create_video_caps already in the base plug-in? Or do I have to link another plugin for it?
I solved my problem. Obviously, I had to add -lgstriff-1.0 to the library flags as pointed out here:
http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gst-plugins-base-libs/html/gstreamer-riff.html
I have a C project with three C files and a .h file. I work in NetBeans. When I try to make an import I get this error:
gcc -o dist/Debug/GNU-Linux-x86/progetto build/Debug/GNU-Linux-x86/initialization.o build/Debug/GNU-Linux-x86/utility.o build/Debug/GNU-Linux-x86/model_parameters.o build/Debug/GNU-Linux-x86/condensation.o -L/usr/local/lib -lm I have to-lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_objdetect -lopencv_video -lXm -lXt -lXext -lX11 -lz -lpthread -lcurses -ldl
build/Debug/GNU-Linux-x86/model_parameters.o: file not recognized: File format not recognized
collect2: ld returned 1 exit status
I have tried to remove this import but the error doesn't disappear. I don't understand where the problem is.