Unable to locate library liboleaut32 in Linux Mint 15 - linux

I'm using Mint 15, I'm a total noob when it comes to compiling softwares, but I'm trying to compile the "infinite-qt" GUI from the Git repo.
I managed to get "infinitecoind"(daemon) compiled, using the 'Makefile.unix' file.
What I'm trying to do now is to get the "infinitecoin-qt GUI" working.
I think it kinda compiles alright to the point where I get this error message:
build/qrc_bitcoin.o -L/usr/lib/i386-linux-gnu -lrt -lssl -lcrypto -ldb_cxx -loleaut32 -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread -lQtGui - lQtCore -lpthread
/usr/bin/ld: cannot find -loleaut32
collect2: error: ld returned 1 exit status
make: ** [infinitecoin-qt] Error 1
Seems like it's some kind of lib missing somehow related to Windows, but I can't find it.
Thanks in advance for your help!

oleaut32 is a library used by Microsoft for OLE technologies - you won't be able to link against it on Linux...
see: http://msdn.microsoft.com/en-us/library/aa268922(v=vs.60).aspx

Related

Build C project on CentOS 7, the linker can't use -ldl , -lc

the issue
I started a C project on my local Ubuntu machine. After I completed the first version(the building is ok), I decided to upload the code to a server which runs a CentOS 7 to implement more features.
The code and the makefiles are the same on both sides.
But the code building on the remote shows the error as follows:
/usr/bin/ld: cannot find -ldl
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
building tools and environment
OS: centos7
toolchain : gcc
What I tried to fix this
yum install glibc-devel
But it did not work.
How should I fix this?
Edit , I got a workaround
I found the makefile I wrote a week ago is a little bit strange on LDFLAGS,
LDFLAGS += -L$(LIBPATH)
LDFLAGS += -static -lxxx -lyyy -ldl
xxx and yyy is the static library name I need to link.
I modified the makefile to
LDFLAGS += -L$(LIBPATH)
LDFLAGS += -l:libxxx.a -l:libyyy.a -ldl
Now it works fine.
-static requires the glibc-static package, not just glibc-devel. But static linking has many limitations (particularly in combination with dlopen), and you should avoid it if at all possible. (It is explicitly unsupported on Red Hat Enterprise Linux.)

Build a program with GLFW3 on Linux

I know this question has been asked many times before but I have been trying to get this working for days and none of the current answers solve my problem. I'd appreciate not being linked to this post: How to build & install GLFW 3 and use it in a Linux project Most of the answers I have seen redirect there but I have gone through it thoroughly and am still having problems.
I am running Linux Mint 17.1.
I have downloaded and built GLFW 3.1.1:
*Downloaded source; extracted; terminal to extract directory*
cmake .
make install
I have also downloaded the example program at http://www.glfw.org/docs/3.0/quick.html#quick_example
I am using the following build commands:
g++ -std=c++11 -c HelloGLFW.cpp
g++ HelloGLFW.o -o main.exec -lGL -lGLU -lglfw3 -lX11 -lXxf86vm -lXrandr -lpthread -lXi
The program compiles fine but when I try to link it I get these errors:
//usr/local/lib/libglfw3.a(x11_init.c.o): In function `initExtensions':
x11_init.c:(.text+0x1aeb): undefined reference to `XineramaQueryExtension'
x11_init.c:(.text+0x1b05): undefined reference to `XineramaIsActive'
//usr/local/lib/libglfw3.a(x11_init.c.o): In function `_glfwCreateCursor':
x11_init.c:(.text+0x21f9): undefined reference to `XcursorImageCreate'
x11_init.c:(.text+0x22d0): undefined reference to `XcursorImageLoadCursor'
x11_init.c:(.text+0x22e0): undefined reference to `XcursorImageDestroy'
//usr/local/lib/libglfw3.a(x11_monitor.c.o): In function `_glfwPlatformGetMonitors':
x11_monitor.c:(.text+0x6e9): undefined reference to `XineramaQueryScreens'
collect2: error: ld returned 1 exit status
I have also gone through the instructions on the GLFW website but they seem to be quite lacking for Linux. I have gotten it working on Linux before but that was a year ago and I can't replicate it.
Can someone please let me know all the steps required to build a program with GLFW3 on Linux (including all dependencies required)?
When glfw3 was installed using cmake a file glfw3.pc was created along with it. This is a pkg-config file and lists what libraries are required for linking.
For me this file was located in /usr/local/lib/pkgconfig
The command I used to successfully build the program with was:
g++ HelloGLFW.cpp -lglfw3 -lX11 -lXrandr -lXinerama -lXi -lXxf86vm -lXcursor -lGL -lpthread
The GLFW site does list details at http://www.glfw.org/docs/latest/build.html#build_link_pkgconfig but it's a bit unclear what to look for if you aren't that familiar with Linux systems.
Specificity the instructions list this command for compiling with the static glfw3 library:
cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --static --libs glfw3`
and with the dynamic glfw3 library:
cc `pkg-config --cflags glfw3` -o myprog myprog.c `pkg-config --libs glfw3`

Linking error: DSO missing from command line

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

Cross-compiling Snap7 for MIPS with OpenWrt as OS

Currently i'm working on a project to log data out of a Siemens PLC. To achieve this i'm using Snap7. Snap7 (http://snap7.sourceforge.net/) is a communication library.
I've managed to get it work on my linux desktop but when i try to cross-compile the snap7 library i get some errors
The error is generated when linking all of the object files.
g++ -shared -fPIC -o ../bin/mips-openwrt-linux-g++/libsnap7.so #"filelist.txt" -L. -lpthread -lrt -O3
/usr/bin/ld: ../temp/mips-openwrt-linux/sys_snap_msgsock.o: Relocations in generic ELF (EM: 8)
./temp/mips-openwrt-linux/sys_snap_msgsock.o: could not read symbols: File in wrong format
collect2: error: ld returned 1 exit status
make: *** [../bin/mips-openwrt-linux-g++/libsnap7.so] Error 1
If i'm correct i think it's using the wrong linker, it should use the linker of the toolchain located at: openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/bin/
I've also tried to compile the software with mips-openwrt-linux-g++.
Now another error is given:
mips-openwrt-linux-g++ -shared -fPIC -o ../bin/mips-openwrt-linux-g++/libsnap7.so #"filelist.txt" -L. -lpthread -lrt -O3
openwrt/staging_dir/toolchain-mips_34kc_gcc-4.8-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.8.3/../../../../mips-openwrt-linux-uclibc/bin/ld: ../temp/mips-openwrt-linux/sys_snap_msgsock.o: relocation R_MIPS_26 against `close' can not be used when making a shared object; recompile with -fPIC
../temp/mips-openwrt-linux/sys_snap_msgsock.o: could not read symbols: Bad value
collect2: error: ld returned 1 exit status
make: *** [../bin/mips-openwrt-linux-g++/libsnap7.so] Error 1
I hope someone is familiar with this error and can help me out.
Thanks in advance.
edit1:
There are some pre-compiled binaries. In the makefiles i changed the CC to my g++ directory. There is no LD flag so i cannot set my linker over there.
Can you cross compile and run a "hello world" program?
What is the output of file ../temp/mips-openwrt-linux/sys_snap_msgsock.o?

glui /usr/bin/ld: cannot find -lXmu

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.

Resources