I'm trying to build fsthost on 64-bit Debian Stable and the last (linking) step fails:
m#debian:~/Downloads/fsthost-1.5.4$ make
winegcc -m32 -o fsthost32 amc_32.o jackamc_32.o fst_32.o gtk_32.o jackvst_32.o \
jfst_32.o fxb_32.o fps_32.o vstwin_32.o cpuusage_32.o info_32.o \
midifilter_32.o list_32.o -m32 -mwindows -L/usr/lib/i386-linux-gnu/wine \
-lpthread -lX11 -ljack -lxml2 -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 \
-lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo \
-lgobject-2.0 -lglib-2.0
/usr/bin/ld: cannot find -lX11
/usr/bin/ld: cannot find -ljack
/usr/bin/ld: cannot find -lxml2
/usr/bin/ld: cannot find -lgtk-3
/usr/bin/ld: cannot find -lgdk-3
/usr/bin/ld: cannot find -latk-1.0
/usr/bin/ld: cannot find -lgio-2.0
/usr/bin/ld: cannot find -lpangocairo-1.0
/usr/bin/ld: cannot find -lgdk_pixbuf-2.0
/usr/bin/ld: cannot find -lcairo-gobject
/usr/bin/ld: cannot find -lpango-1.0
/usr/bin/ld: cannot find -lcairo
/usr/bin/ld: cannot find -lgobject-2.0
/usr/bin/ld: cannot find -lglib-2.0
collect2: error: ld returned 1 exit status
winegcc: gcc failed
make: *** [fsthost32] Error 2
m#debian:~/Downloads/fsthost-1.5.4$
Notice, that winegcc is being used here, not gcc.
So, ld claims there's no libX11.so, let's check it:
m#debian:~$ locate libX11.so
/usr/lib/i386-linux-gnu/libX11.so.6
/usr/lib/i386-linux-gnu/libX11.so.6.3.0
/usr/lib/x86_64-linux-gnu/libX11.so
/usr/lib/x86_64-linux-gnu/libX11.so.6
/usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
m#debian:~$
Bingo! There's no /usr/lib/***i386***-linux-gnu/libX11.***so***! When I manually add a symlink from /usr/lib/i386-linux-gnu/libX11.so to /usr/lib/i386-linux-gnu/libX11.so.6, the line:
/usr/bin/ld: cannot find -lX11
obviously disappears from ld's output.
Why are there no *.so symlinks in i386-linux-gnu directory and how should I proceed from here?
If you have the shared libraries but are missing the *.so symlinks that seems to indicate that you have installed the runtime library package but not the dev library package. What was the name of the package that you installed to create the i386-linux-gnu directory? I'd search for related packages that have 'dev' or similar in the name and try installing them.
Just a guess here, but the package you may be missing is ia32-libs-dev
Related
I am using a header file named OlcPixelGameEngine, and one more header file, but when I run the compile command, I get a big error.
This is the command to compile the cpp program.
g++ main.cpp -o main -luser32 -lgdi32 -lopengl32 -lgdiplus -lShlwapi -lstdc++fs -static -std=c++17 -lxinput9_1_0 -lole32 -loleaut32 -ldinput8 -ldxguid -ldwmapi
and this is the error:-
/usr/bin/ld: cannot find -luser32
/usr/bin/ld: cannot find -lgdi32
/usr/bin/ld: cannot find -lopengl32
/usr/bin/ld: cannot find -lgdiplus
/usr/bin/ld: cannot find -lShlwapi
/usr/bin/ld: cannot find -lxinput9_1_0
/usr/bin/ld: cannot find -lole32
/usr/bin/ld: cannot find -loleaut32
/usr/bin/ld: cannot find -ldinput8
/usr/bin/ld: cannot find -ldxguid
/usr/bin/ld: cannot find -ldwmapi
collect2: error: ld returned 1 exit status
I am using Linux, Ubuntu 20.04.
I tried to build a source file with following command:
g++ main.cpp `wx-config --cxxflags --libs std`
/usr/bin/ld: cannot find -lgthread-2.0
/usr/bin/ld: cannot find -lX11
/usr/bin/ld: cannot find -lXxf86vm
/usr/bin/ld: cannot find -lSM
/usr/bin/ld: cannot find -lgtk-3
/usr/bin/ld: cannot find -lgdk-3
/usr/bin/ld: cannot find -latk-1.0
/usr/bin/ld: cannot find -lgio-2.0
/usr/bin/ld: cannot find -lpangocairo-1.0
/usr/bin/ld: cannot find -lgdk_pixbuf-2.0
/usr/bin/ld: cannot find -lcairo-gobject
/usr/bin/ld: cannot find -lpango-1.0
/usr/bin/ld: cannot find -lcairo
/usr/bin/ld: cannot find -lgobject-2.0
/usr/bin/ld: cannot find -lglib-2.0
/usr/bin/ld: cannot find -lpng
/usr/bin/ld: cannot find -lexpat
/usr/bin/ld: cannot find -lz
collect2: error: ld returned 1 exit status
I guess I didn't install wxWidgets correctly (I installed libwxgtk3.0-dev as described in multiple install tutorials)
EDIT
wx-config --libs std
-L/usr/local/lib -pthread /usr/local/lib/libwx_gtk3u_xrc-3.1.a /usr/local/lib/libwx_gtk3u_qa-3.1.a /usr/local/lib/libwx_baseu_net-3.1.a /usr/local/lib/libwx_gtk3u_html-3.1.a /usr/local/lib/libwx_gtk3u_adv-3.1.a /usr/local/lib/libwx_gtk3u_core-3.1.a /usr/local/lib/libwx_baseu_xml-3.1.a /usr/local/lib/libwx_baseu-3.1.a -pthread -lgthread-2.0 -lX11 -lXxf86vm -lSM -lgtk-3 -lgdk-3 -latk-1.0 -lgio-2.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo-gobject -lpango-1.0 -lcairo -lgobject-2.0 -lglib-2.0 -lpng -lexpat -lwxregexu-3.1 -lwxtiff-3.1 -lwxjpeg-3.1 -lz -ldl -lm
If you use Ubuntu, you really shouldn't have any problems if you just installed the distribution package.
It looks like you had tried to install wxWidgets from sources before and your wx-config comes from /usr/local/bin and is not the one installed by the package. You can check it using which wx-config and/or using full path to /usr/bin/wx-config when compiling. Just get rid of this one, and all the other traces of wxWidgets under /usr/local, if you're using the system packages.
this is maybe a noob question but I've been stuck for a while and I appreciate any help...
I have been able to install opencv and run a sample application using the terminal without any problems however I want to use eclipse to manage my project easily...
I have followed the instructions given by the opencv tutorial in this [link]
http://docs.opencv.org/doc/tutorials/introduction/linux_eclipse/linux_eclipse.html
I followed everything and i still get the following errors
/usr/bin/ld: cannot find -llibopencv_calib3d
/usr/bin/ld: cannot find -llibopencv_contrib
/usr/bin/ld: cannot find -llibopencv_core
/usr/bin/ld: cannot find -llibopencv_features2d
/usr/bin/ld: cannot find -llibopencv_flann
/usr/bin/ld: cannot find -llibopencv_gpu
/usr/bin/ld: cannot find -llibopencv_highgui
/usr/bin/ld: cannot find -llibopencv_imgproc
/usr/bin/ld: cannot find -llibopencv_legacy
/usr/bin/ld: cannot find -llibopencv_ml
/usr/bin/ld: cannot find -llibopencv_nonfree
/usr/bin/ld: cannot find -llibopencv_objdetect
/usr/bin/ld: cannot find -llibopencv_photo
/usr/bin/ld: cannot find -llibopencv_stitching
/usr/bin/ld: cannot find -llibopencv_superres
/usr/bin/ld: cannot find -llibopencv_ts
/usr/bin/ld: cannot find -llibopencv_video
/usr/bin/ld: cannot find -llibopencv_videostab
collect2: error: ld returned 1 exit status
make: *** [Test_OpenCV01] Error 1
the only differences I was able to find between my steps and the tutorial is:
when i run the command :
pkg-config --libs opencv
this is my output
/usr/local/lib/libopencv_calib3d.so /usr/local/lib/libopencv_contrib.so /usr/local/lib/libopencv_core.so /usr/local/lib/libopencv_features2d.so /usr/local/lib/libopencv_flann.so /usr/local/lib/libopencv_gpu.so /usr/local/lib/libopencv_highgui.so /usr/local/lib/libopencv_imgproc.so /usr/local/lib/libopencv_legacy.so /usr/local/lib/libopencv_ml.so /usr/local/lib/libopencv_nonfree.so /usr/local/lib/libopencv_objdetect.so /usr/local/lib/libopencv_photo.so /usr/local/lib/libopencv_stitching.so /usr/local/lib/libopencv_superres.so /usr/local/lib/libopencv_ts.so /usr/local/lib/libopencv_video.so /usr/local/lib/libopencv_videostab.so
so the library names are a bit different so I use the names that I have.
the command line that was executed automaticly from eclipse is
g++ -L/usr/local/lib/ -o "Test_OpenCV01" ./src/main.o -llibopencv_calib3d -llibopencv_contrib -llibopencv_core -llibopencv_features2d -llibopencv_flann -llibopencv_gpu -llibopencv_highgui -llibopencv_imgproc -llibopencv_legacy -llibopencv_ml -llibopencv_nonfree -llibopencv_objdetect -llibopencv_photo -llibopencv_stitching -llibopencv_superres -llibopencv_ts -llibopencv_video -llibopencv_videostab
it clearly specifies that the library path is /usr/local/lib/ which is where the shared libraries are at however in the error it says that it can't find the lib files in /usr/bin/ld
p.s.
I have tried both
1)Configuring OpenCV for using shared libraries:
sudo gedit /etc/ld.so.conf.d/opencv.conf
and adding the following line at the end of the file
/usr/local/lib the running sudo ldconfig after saving.
2)run the command
export LD_LIBRARY_PATH=/usr/local/lib
I also added
PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/usr/local/lib/pkgconfig
export PKG_CONFIG_PATH
to the end of the /etc/bash.bashrc file.
Thanks for your help in advanced.
Your linking step is specifying the libraries incorrectly. If the library is libfoo.so, then you need to say -lfoo.
Replace
g++ -L/usr/local/lib/ -o "Test_OpenCV01" ./src/main.o -llibopencv_calib3d -llibopencv_contrib -llibopencv_core -llibopencv_features2d -llibopencv_flann -llibopencv_gpu -llibopencv_highgui -llibopencv_imgproc -llibopencv_legacy -llibopencv_ml -llibopencv_nonfree -llibopencv_objdetect -llibopencv_photo -llibopencv_stitching -llibopencv_superres -llibopencv_ts -llibopencv_video -llibopencv_videostab
with
g++ -L/usr/local/lib/ -o "Test_OpenCV01" ./src/main.o -lopencv_calib3d -lopencv_contrib -lopencv_core -lopencv_features2d -lopencv_flann -lopencv_gpu -lopencv_highgui -lopencv_imgproc -lopencv_legacy -lopencv_ml -lopencv_nonfree -lopencv_objdetect -lopencv_photo -lopencv_stitching -lopencv_superres -lopencv_ts -lopencv_video -lopencv_videostab
You can read more about linking options here.
Even though the file names are like liblibopencv_core.so under /usr/local/lib folder, in GCC C++ linker libraries just mention opencv_core. Do the same for other files you are adding in library.
I try to build a very simple application for Windows x86 on Fedora x64 Eclipse with MinGW.
Application compiles good, however, it can not link. My link command follows:
i686-w64-mingw32-g++ `mingw32-pkg-config --libs gtk+-2.0` -o "GtkTest" ./main.o
When I run mingw32-pkg-config --libs gtk+-2.0, the output follows:
-Wl,-luuid -L/usr/i686-w64-mingw32/sys-root/mingw/lib -lgtk-win32-2.0 -lgdk-win32-2.0 -limm32 -lshell32 -lole32 -latk-1.0 -lpangocairo-1.0 -lgio-2.0 -lgdk_pixbuf-2.0 -lpangoft2-1.0 -lpangowin32-1.0 -lgdi32 -lfreetype -lfontconfig -lpango-1.0 -lm -lcairo -lgobject-2.0 -lglib-2.0 -lintl
In no doubts folder and library files exist. However, I receive following errors:
./main.o:main.cpp:(.text.startup+0x3e): undefined reference to `gtk_init_abi_check'
./main.o:main.cpp:(.text.startup+0x43): undefined reference to `gtk_builder_new'
./main.o:main.cpp:(.text.startup+0x3d): undefined reference to `gtk_builder_add_from_file'
./main.o:main.cpp:(.text.startup+0x46): undefined reference to `gtk_widget_get_type'
./main.o:main.cpp:(.text.startup+0x58): undefined reference to `gtk_builder_get_object'
./main.o:main.cpp:(.text.startup+0x64): undefined reference to `g_type_check_instance_cast'
./main.o:main.cpp:(.text.startup+0x76): undefined reference to `gtk_builder_connect_signals'
./main.o:main.cpp:(.text.startup+0x86): undefined reference to `g_type_check_instance_cast'
./main.o:main.cpp:(.text.startup+0x8e): undefined reference to `g_object_unref'
./main.o:main.cpp:(.text.startup+0x96): undefined reference to `gtk_widget_show'
./main.o:main.cpp:(.text.startup+0x9b): undefined reference to `gtk_main'
./main.o:main.cpp:(.text.startup+0xcb): undefined reference to `g_log'
./main.o:main.cpp:(.text.startup+0xd7): undefined reference to `g_free'
So, it looks like linker doesn't see libraries at all, even they exist and I reference them in command line.
What may be the reason?
You are missing the --cflags but, above all, The order is wrong. Check out Tor Lillqvist's suggestion for proper flags ordering.
I just installed QT Creator 2.7.0 [Based on Qt 5.0.1 (64 bit)] on my Ubuntu 13.04 end. I tried creating a sample HTML5 Application and when I try to run it, some issues are encountered. Here's the output of the build process.
23:16:22: Starting: "/usr/bin/qmake" /home/res/Git/test/first/first.pro -r -spec linux-g++-64 CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
23:16:22: The process "/usr/bin/qmake" exited normally.
23:16:22: Starting: "/usr/bin/make"
make: Circular all <- first dependency dropped.
Copying application data...
g++ -m64 -o first main.o html5applicationviewer.o moc_html5applicationviewer.o -L/usr/X11R6/lib64 -lQt5WebKitWidgets -lX11 -lxslt -lrt -lgio-2.0 -lgstapp-0.10 -lgstinterfaces-0.10 -lgstpbutils-0.10 -pthread -lgstvideo-0.10 -lgstbase-0.10 -lgstreamer-0.10 -lgobject-2.0 -lgmodule-2.0 -lgthread-2.0 -lxml2 -lglib-2.0 -lsqlite3 -L/build/buildd/qtdeclarative-opensource-src-5.0.1/lib -L/usr/lib/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/x86_64-linux-gnu -L/usr/lib/x86_64-linux-gnu/x86_64-linux-gnu/x86_64-linux-gnu -L/build/buildd/qtwebkit-opensource-src-5.0.1/lib -lQt5Sql -lQt5Quick -lQt5OpenGL -lQt5PrintSupport -lQt5WebKit -lQt5Qml -lQt5Location -lQt5Widgets -lQt5Network -lQt5Sensors -lQt5Gui -lQt5Core -lGL -lpthread
/usr/bin/ld: cannot find -lxslt
/usr/bin/ld: cannot find -lgio-2.0
/usr/bin/ld: cannot find -lgstapp-0.10
/usr/bin/ld: cannot find -lgstinterfaces-0.10
/usr/bin/ld: cannot find -lgstpbutils-0.10
/usr/bin/ld: cannot find -lgstvideo-0.10
/usr/bin/ld: cannot find -lgstbase-0.10
/usr/bin/ld: cannot find -lgstreamer-0.10
/usr/bin/ld: cannot find -lgobject-2.0
/usr/bin/ld: cannot find -lgmodule-2.0
/usr/bin/ld: cannot find -lgthread-2.0
/usr/bin/ld: cannot find -lxml2
/usr/bin/ld: cannot find -lglib-2.0
/usr/bin/ld: cannot find -lsqlite3
collect2: error: ld returned 1 exit status
make: *** [first] Error 1
23:16:22: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project first (kit: Desktop)
When executing step 'Make'
23:16:22: Elapsed time: 00:00.
This is the first time I'm trying this HTML5 application in QT Creator.
How can this issue be solved?
For each library, check if you've installed appropriate *-dev package. E.g for message /usr/bin/ld: cannot find -lxslt check package libxslt1-dev