Please help me about problems when i try build Skia by this guide
It said that:
/usr/bin/ld: cannot find -lfreetype
/usr/bin/ld: cannot find -lfontconfig
/usr/bin/ld: cannot find -lGL
/usr/bin/ld: cannot find -lGLU
/usr/bin/ld: cannot find -lX11
Thank's so much!
/usr/bin/ld is the linker: it links the program you are trying to compile with existing libraries. In your case, those libraries will be files named libfreetype.so, libfontconfig.so, and so on.
The problem in your case is probably those libraries don't exist on your system. So you must install them. The process for doing so varies depending on which version of Linux you are running.
On a Redhat, CentOS or Fedora based system, the process would be to do something like
yum -y install "*freetype*"
Look at the output of 'yum list' to find the exact name. If you're on another type of Linux, perhaps someone else can help.
Related
I am trying to compile a GTK application for 32bit linux from 64bit linux.
When I run this command:
gcc main.c -m32 -mms-bitfields -o output/main `pkg-config --cflags --libs gtk+-3.0` && ./output/main
I get these errors:
/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
Running Linux Mint 17.2 Rafaela.
I have all the required packages and I've even included the -m32 option but it still doesnt work.
There is also a similar question here which doesn't have an accepted answer.
Edit:
The accepted answer below suggested I install the 32bit version of libgtk-3-dev. I could not do this without removing important system packages. In the end I resorted to simply using a 32bit linux distro with the 32bit version of libgtk-3-dev installed.
You could run:
apt-get install libgtk-3-dev:i386
then rerun your compile command and it should work. If the above command returns an error saying it cannot find the package specified, you may need to run this, then try again:
dpkg --add-architecture i386
Warning: If the command above asks you to remove packages, read the list carefully, if the list includes important system packages or if you are unsure then do not proceed.
I am rather new to Linux (using Ubuntu 14.04 LTS 64bit), coming from Windows, and am attempting to port over an existing CUDA project of mine.
When linking via
/usr/local/cuda/bin/nvcc -arch=compute_30 -code=sm_30,compute_30 -o Main.o Display.o FileUtil.o Timer.o NeuralNetwork.o -L/usr/lib -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu -L/usr/local/cuda/lib64 -lGLEW -lglfw3 -lGL -lGLU -lcuda -lcudart
I encounter the following error:
/usr/bin/ld: /usr/local/lib/libglfw3.a(x11_clipboard.c.o): undefined reference to symbol 'XConvertSelection'
//usr/lib/x86_64-linux-gnu/libX11.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [CUDANN] Error 1
The answer seems closely related to the solutions in this post (Strange linking error: DSO missing from command line), though given my inexperience with Linux I was unable to adapt them to my own problem.
Any ideas on what the problem could be?
Here is the full output during compilation: https://gist.github.com/wbolden/857eddd11e4dcb915c02
And here is my attempt at a Makefile:
https://gist.github.com/wbolden/135033daae04ed0d8cf3
Hopefully this will be of help to those, like me, who are new to Linux and don't find anything related to Linux to be particularly obvious.
As noted by talonmies, I am not able to link indirectly and as such need to specify any additional libraries required by the libraries I am using. That is to say, if I link library A, which requires libraries B and C, I need to link all three libraries for the program to link correctly.
To find what other libraries were needed I used the pkg-config command, for which I found a guide here. Running pkg-config --print-requires --print-requires-private glfw3 gave the following output, which is the list of packages required by glfw3.
x11
xrandr
xi
xxf86vm
gl
I was then able to find what libraries I needed to include by running pkg-config --libs, followed by the name of the library. For example, pkg-config --libs x11 yielded -lX11.
Note: you can pass multiple items to pkg-config as input, so running
pkg-config --libs $(pkg-config --print-requires --print-requires-private glfw3)
will print out all the additional libraries you need to link (-lX11 -lXrandr -lXi -lXxf86vm -lGL).
My program now links successfully, I hope this helpful to anyone with a similar problem.
Your linker need X11 library,You need to specify -lX11 to linker
Try
/usr/local/cuda/bin/nvcc -arch=compute_30 -code=sm_30,compute_30 -o Main.o Display.o FileUtil.o Timer.o NeuralNetwork.o -L/usr/lib -L/usr/local/lib -L/usr/lib/x86_64-linux-gnu -L/usr/local/cuda/lib64 -lGLEW -lglfw3 -lGL -lGLU -lcuda -lcudart -lX11
Try to add -pthread at the end of the library list (command line) in the Makefile.
It worked for me.
Use the following commands to fix the issue:
FLAGS=-lX11 ./configure --prefix=/usr --disable-static
make
make install
I try to learn how to use realityGrid so I use cmake to build some samples. After finishing use ccmake command, I tried to use make command. But I'm keeping to get the errors:
/usr/bin/ld: cannot find -lvtkCommon
/usr/bin/ld: cannot find -lvtkFiltering
/usr/bin/ld: cannot find -lvtkGraphics
/usr/bin/ld: cannot find -lvtkImaging
/usr/bin/ld: cannot find -lvtkIO
/usr/bin/ld: cannot find -lvtkRendering
I found the libvtkCommon.a in /usr/lib/vtk-5.10. What should I do? Thanks ahead.
you should install the package containing the "vtk" libraries so ld can find them.
if you installed them manually you need to add the path at which those files are located to the library path configuration.
http://blog.andrewbeacock.com/2007/10/how-to-add-shared-libraries-to-linuxs.html
You need to tell CMake that you require the VTK module. I haven't used CMake much, but I believe the line you need is something like:
find_package(VTK REQUIRED NO_MODULE)
include(${VTK_USE_FILE})
If that doesn't work, you could probably fall back to something like this:
set(CMAKE_LIBRARY_PATH ${CMAKE_LIBRARY_PATH} /usr/lib/vtk-5.10)
The bad part about the last line is that it won't port well to other environments where the version is slightly different.
I read Setting Up An Application - NetBeans - Linux in Ogre tutorials. But this instructs to build the project separately on console using make && make install. It seems Netbeans is only used as a editor. Is there a way to I do everything using Netbeans?
I tried to setup Netbeans to use OGRE libraries, but it was not successful. I get some errors when I build the project. This is what I did so far.
Project properties > C++ Compiler : Include Directories
/usr/include/OGRE:/usr/include/OIS:/usr/include
In Linker : I added all the
libogre*.so files in /usr/lib as
Libraries.
I used apt-get to install OGRE
pkg-config --libs OGRE
-lOgreMain -lpthread
pkg-config --cflags OGRE
-pthread -I/usr/include/OGRE
This link only provides details for doing this on windows.
Could someone tell me how to setup Netbeans for OGRE correctly on Linux
UPDATE
The console output
g++ -o dist/Debug/GNU-Linux-x86/carrace build/Debug/GNU-Linux-x86/TutorialApplication.o build/Debug/GNU-Linux-x86/BaseApplication.o -L/usr/bin -lPlugin_BSPSceneManager -lPlugin_CgProgramManager -lPlugin_OctreeSceneManager -lPlugin_OctreeZone -lPlugin_ParticleFX -lPlugin_PCZSceneManager -lRenderSystem_GL -lOgreMain -lOgrePaging -lOgreProperty -lOgreRTShaderSystem -lOgreTerrain -lOIS-1.3.0 -lOIS -lboost_date_time-mt -lboost_date_time -lboost_serialization-mt -lboost_serialization -lboost_thread-mt -lboost_thread -lboost_wserialization-mt -lboost_wserialization
/usr/bin/ld: cannot find -lPlugin_BSPSceneManager
/usr/bin/ld: cannot find -lPlugin_CgProgramManager
/usr/bin/ld: cannot find -lPlugin_OctreeSceneManager
/usr/bin/ld: cannot find -lPlugin_OctreeZone
/usr/bin/ld: cannot find -lPlugin_ParticleFX
/usr/bin/ld: cannot find -lPlugin_PCZSceneManager
/usr/bin/ld: cannot find -lRenderSystem_GL
I tried adding these folders separately but it didn't work.
Thank you in advance.
For me it worked with
-lOgreMain -lOgreTerrain -lOIS -lpthread
as linker options
and the same includes as you have
You forgot pkg-config --ldflags OGRE
You can see my tutorial in here http://arief-rublog.blogspot.com/2011/09/cara-pengaturan-ogre-dengan-ide.html , but my tutorial in Bahasa Indonesia, may be you can use google translate to translate it. i hope my tutorial is useful for you.
I have downloaded the latest GLUI source code and now I am trying to compile it. When I do so, I get the following error:
g++ -O0 -Wall -pedantic -I./ -I./include -I/usr/X11R6/include -o bin/example1 example/example1.cpp -L./lib -lglui -L/usr/X11R6/lib/libXdmcp.a -lglut -lGLU -lGL -lXmu -lXext -lX11 -lXi -lm
/usr/bin/ld: cannot find -lXmu
collect2: ld returned 1 exit status
When I did a locate libXmu, I get the following output:
> %:~/src/GLUI/src$ locate libXmu
> /usr/lib/libXmu.so.6
> /usr/lib/libXmu.so.6.2.0
> /usr/lib/libXmuu.so.1
> /usr/lib/libXmuu.so.1.0.0
Do I get the error because I don't have a /usr/lib/libXmu.so? If this is the case, how can I make one? (I am not experienced with linking at all).
Thanks!
Linux distributions usually package the libraries needed for running programs separately from the files needed to build programs.
Look for packages named *-devel or *-dev.
I don't know which one you need in particular for this, but you can use apt-cache search to look for it.
The answer was actually one of the first ones here originally but the owner deleted it, it seems. I was able to solve the problem by creating a symbolic link to the latest version of the library (i.e. /usr/lib/libXmu.so.6) and compile the code successfully.
I had the same problem, if creating a symbolic link doesnt help,
try the following:
Print your $PATH ("echo $PATH"),
and check if the library file you need is in one of those directories.
Use "export PATH=/newly/added/path:$PATH" to add new directory to check.
Ive been including libevent, added "-levent" in the gcc command, and ld used file /usr/lib/libevent.so, so it looks like the "lib" prefix and extension are being added automatically by ld.
Keep it up.