shared-libraries

What is the deal with undefined symbols in a shared library or dylib?

非 Y 不嫁゛ 提交于 2019-12-01 14:59:43
I have a Makefile for linux that I am porting over to Darwin. The makefile takes a bunch of .o files and links them together into a .so shared object. Okay, so I figured (am I wrong about this?) that the best analog for this in Darwin is the dylib. So I changed the -shared flag to -dynamiclib. Now the code that I am linking together into the dylib depends on lots of external libraries. When I try to build the dylib, I get errors saying there are undefined references. But the Linux Makefile does not specify any of the -lwhatever or -L/path/whatever options in the build step that creates the .so

How to recompile source file every time while using cmake 2.8.2 in single build for c++11 and c++98 for shared library creation?

与世无争的帅哥 提交于 2019-12-01 14:39:51
I have a project directory structure of: Root Source Common MyFolder ++ My 3 source files and header When I am building my project it generates 3 to 4 shared libraries. Lib1 compiled using c++98 and others using c++11. Flags are added in CmakeList.txt which is at root. I need my 3 source files to be compiled for Lib1 and for other Libs as as well. but here what happens is compiler is first compiling my source file for lib using c++11 and then it is trying to use same .o file for Lib1 as well. So for .o file which is generated using c++11 is throwing exception when same is used for c++98

How to recompile source file every time while using cmake 2.8.2 in single build for c++11 and c++98 for shared library creation?

混江龙づ霸主 提交于 2019-12-01 12:28:16
问题 I have a project directory structure of: Root Source Common MyFolder ++ My 3 source files and header When I am building my project it generates 3 to 4 shared libraries. Lib1 compiled using c++98 and others using c++11. Flags are added in CmakeList.txt which is at root. I need my 3 source files to be compiled for Lib1 and for other Libs as as well. but here what happens is compiler is first compiling my source file for lib using c++11 and then it is trying to use same .o file for Lib1 as well.

How can I find a library name of .so file?

[亡魂溺海] 提交于 2019-12-01 11:18:44
For example, I have libprofiler.so file. How can I get name of this shared object like this: getname /usr/lib/libprofiler.so I want to do it because it is required for CMakeLists.txt in target_link_libraries(MyProject name_of_library) Th. Thielemann Do the following steps to link an existing lib to your target: Inform you which lib do you need: here profiler. Build the name of the lib. CMake does not really needs this but it is worth to know: Example on Unix/Linux lib + NAME + [.so|.a] [VERSION]. Here: libprofiler.so . In your CMakeLists.txt: find_library(LIB_PROFILER NAMES profiler

Launching CYGWIN-built executable from Java on Windows 7 fails with “error while loading shared libraries: ?: No such file or directory”

為{幸葍}努か 提交于 2019-12-01 10:43:34
The code in question has worked in more or less the exact same configuration on earlier releases of Windows, however, it is not known to have run on Windows 7 YET! That's what I need to solve now. Briefly, some C code performs some configuration and security checks before launching a java program, passing some data that would be neigh-into-impossible to do easily in Java. The Java in turn, at the appropriate time launches the same C code which then itself launches a different Java program. The second program launch needs to be completely independent, (think nohup) hence the second launch. What

LLVM JIT-compiled program cannot find external functions

北战南征 提交于 2019-12-01 09:21:41
My program which JIT compiles a LLVM IR module and calls a function foo defined therein fails at runtime if foo uses an externally-defined function: LLVM ERROR: Program used external function 'glutInit' which could not be resolved! My program: // foo1.cpp #include <GL/glut.h> extern "C" void foo() { glutInit(0,0); } // foo2.cpp #include <iostream> #include <fstream> #include <string> #include <llvm/Support/raw_ostream.h> #include <llvm/LLVMContext.h> #include <llvm/Support/TargetSelect.h> #include <llvm/Support/IRReader.h> #include <llvm/ExecutionEngine/ExecutionEngine.h> #include <llvm

In what library on Linux are the system calls and how is this library linked to the executable object file that contains the system calls?

纵然是瞬间 提交于 2019-12-01 08:54:07
I know that the system calls are not in the C standard Library. Is there any library (some sort of a system library) where the system calls are? If there is such a library how is this library linked to the executable program? A system call can work in a few different ways, depending on the target architecture, but in any case, it is not a library call. It is a way for a running user-space program to call some functionality in the kernel. In very old systems, this typically meant to jump directly to some address where this kernel function starts. Later, kernels introduced "jump tables" adding a

How can I find a library name of .so file?

为君一笑 提交于 2019-12-01 08:15:30
问题 For example, I have libprofiler.so file. How can I get name of this shared object like this: getname /usr/lib/libprofiler.so I want to do it because it is required for CMakeLists.txt in target_link_libraries(MyProject name_of_library) 回答1: Do the following steps to link an existing lib to your target: Inform you which lib do you need: here profiler. Build the name of the lib. CMake does not really needs this but it is worth to know: Example on Unix/Linux lib + NAME + [.so|.a] [VERSION]. Here:

ldconfig only links files starting with lib*?

♀尐吖头ヾ 提交于 2019-12-01 08:03:41
I'm struggling to make MVTec Halcon 11 work on Ubuntu. Everything is in the right place but the program doesn't see the dynamic libraries needed for image acquisition (the cameras alone work fine, the driver is installed) I added the path with the libraries to /etc/ld.so.conf and ran ldconfig -v but of the 28 files present in the directory (all "Shared Library" type and .so extension), only the "lib*.so" ones are linked. As a matter of fact, ALL the libraries in the output of ldconfig are called lib*something. Oddly, if I add "lib" in front of the name of the files, they get linked (of course

LLVM JIT-compiled program cannot find external functions

女生的网名这么多〃 提交于 2019-12-01 07:06:02
问题 My program which JIT compiles a LLVM IR module and calls a function foo defined therein fails at runtime if foo uses an externally-defined function: LLVM ERROR: Program used external function 'glutInit' which could not be resolved! My program: // foo1.cpp #include <GL/glut.h> extern "C" void foo() { glutInit(0,0); } // foo2.cpp #include <iostream> #include <fstream> #include <string> #include <llvm/Support/raw_ostream.h> #include <llvm/LLVMContext.h> #include <llvm/Support/TargetSelect.h>