static-linking

Runtime Opencv HighGui Error- “HIGHGUI ERROR: V4L/V4L2: VIDIOC_S_CROP”. Opencv cross compiled. Host=64bit Ubuntu 12.04. Target=ARM-Cortex-A9

耗尽温柔 提交于 2019-11-29 08:01:34
问题 I am a beginner at OpenCV and trying my best to get a simple application running on an embedded platform. I cross-compiled OpenCV 2.4.4 and built it WITH_GTK=ON, WITH_UNICAP=ON, WITH_V4L=ON as needed for camera and GUI support. The following sample code cross-compiles on host: #include <opencv/cv.h> #include <opencv/highgui.h> using namespace cv; int main(int, char**) { VideoCapture cap(0); // open the default camera if (!cap.isOpened()) // check if we succeeded return -1; Mat edges;

How to static link Linux software that uses ./configure?

≡放荡痞女 提交于 2019-11-29 06:14:54
问题 I would like to compile NRPE static, so I can copy the compiled binary to an OmniOS server, where I don't want gcc to be installed on. I would prefer to install NRPE with SSl support from a repository, but such doesn't seam to exist, so I would like to compile it myself. However the ./configure script doesn't contain a static option it seams ~/nrpe-2.15# ./configure --help | grep static ~/nrpe-2.15# ./configure --help | grep share --datadir=DIR read-only architecture-independent data [PREFIX

In C, is it possible to change exported function name to different one?

做~自己de王妃 提交于 2019-11-29 06:04:00
all. I want to link a library which calls malloc() function. However, my target environment is different one and malloc() is supplied as inline-function. How can I make the library's call to malloc() direct to my target environment's malloc() routine? Is it any way to change the exported function name? If so I can code my_malloc() first and export it as malloc() and link the library to that one: #include <my_environment.h> // malloc() is inline function declared there void my_malloc (void) { malloc (void); } More specifically, the library is one from linux distro so it depends on libc. But my

Do I need static libraries to statically link?

拥有回忆 提交于 2019-11-29 04:12:21
On 'C', Linux, Do I need static libraries to statically link, or the shared ones I have suffice? If not, why not? (Don't they contain the same data?) Yes, you need static libraries to build a statically linked executable. Static libraries are bundles of compiled objects. When you statically link with to library, it is effectively the same as taking the compilation results of that library, unpacking them in your current project, and using them as if they were your own objects. Dynamic libraries are already linked. This means that some information like relocations have already been fixed up and

Static library loaded twice

一个人想着一个人 提交于 2019-11-28 21:59:59
I have shared object A.so which statically links to libssl.a & another shared object B.so which also statically links libssl.a . A.so & B.so has symbols from libssl.a in GLOBAL scope. I checked this by readelf -s A.so I have an executable a.out which loads A.so and B.so. When a.out terminated I get a double free error in one of the symbols from libssl.a in A.so. Even though libssl.a is statically linked to each shared object, since they are exposed globally is it possible that the same symbol is shared instead of picking it's local copy. What is the workaround this ? How to make the symbols

Proper way to link a static library using GCC

江枫思渺然 提交于 2019-11-28 21:11:08
问题 Why is it that some static libraries (lib*.a) can be linked in the same way that shared libraries (lib*.so) are linked (ld -l switch), but some can not? I had always been taught that all libraries, static or not, can be linked with -l..., however I've run into one library so far (GLFW), which does nothing but spew "undefined reference" link errors if I attempt to link it this way. According to the response on this question, the "proper" way to link static libraries is to include them directly

Why create a .a file from .o for static linking?

末鹿安然 提交于 2019-11-28 20:19:06
问题 Consider this code: one.c: #include <stdio.h> int one() { printf("one!\n"); return 1; } two.c: #include <stdio.h> int two() { printf("two!\n"); return 2; } prog.c #include <stdio.h> int one(); int two(); int main(int argc, char *argv[]) { one(); two(); return 0; } I want to link these programs together. So I do this: gcc -c -o one.o one.c gcc -c -o two.o two.c gcc -o a.out prog.c one.o two.o This works just fine. Or I could create a static library: ar rcs libone.a one.o ar rcs libtwo.a two.o

How to link host code with a static CUDA library after separable compilation?

允我心安 提交于 2019-11-28 19:00:28
Alright, I have a really troubling CUDA 5.0 question about how to link things properly. I'd be really grateful for any assistance! Using the separable compilation features of CUDA 5.0, I generated a static library (*.a). This nicely links with other *.cu files when run through nvcc, I have done this many times. I'd now like to take a *.cpp file and link it against the host code in this static library using g++ or whatever, but not nvcc. If I attempt this, I get compiler errors like undefined reference to __cudaRegisterLinkedBinary I'm using both -lcuda and -lcudart and, to my knowledge, have

Static-linking of SDL2 libraries

故事扮演 提交于 2019-11-28 18:26:59
I am using Windows 7, Code::Blocks and MinGW. I have little to no experience when it comes to compiling/building anything, especially when Code::Blocks doesn't use makefiles. I downloaded SDL2-devel-2.0.0-mingw.tar.gz (SDL Development Libraries) from http://www.libsdl.org/tmp/download-2.0.php , and I'd like to create a standalone executable using SDL2 libraries, but so far I've always had to bundle the SDL2.dll file with the executable to make it work. I've heard that I can not static-link dynamic libraries, so my only option seems to be doing something with the source files using the file

C++ global variable not initialized when linked through static libraries, but OK when compiled with source

旧城冷巷雨未停 提交于 2019-11-28 18:21:32
I have created a system that automatically registers function objects (functors) into a map based on the constructor of an global instance. In each cpp file that defines the functor, there's a global instance of the registrar class instance to register the functor to a singleton std::map<int, std::function<...> > object. This is the definition of registrar class: template < typename map_type, typename handler_type > struct registrar { registrar ( map_type& map_object, boost::uint16_t cmd_code, const handler_type& handler ) { map_object.insert(std::pair<boost::uint16_t, handler_type>(cmd_code,