shared-libraries

How to load files from resources folder in Shared library without knowing their names (or number)?

左心房为你撑大大i 提交于 2019-12-13 16:17:06
问题 As you know, in Shared libraries in Jenkins, it is possible to load a resource (located in resources folder) by doing: libraryResource("script.sh") Now my use case is that I want to load number of files inside a folder under resources : + resources + teamA + script1.sh + script2.sh And I want to load all those files before doing anything : I did a method in the shared library: new File(scriptsFolder).eachFile() { file-> writeFile([file:"${env.workspace}/${file.getName()}",text:libraryResource

How to resolve shared library linking during compilation( GCC )?

老子叫甜甜 提交于 2019-12-13 16:05:36
问题 I have built libshared.so with is dependent on libshared_dependent.so Now, I am compiling app.bin which is using libshared.so , Now at compile time gcc wants me to specify -lshared_dependent other wise it gives error that some symbols not found. Is there any way by which, At compile time I don't need to specify -lshared_dependent , I want that just specifying -lshared works? 回答1: You just need to link libshared.so to libshared_dependent.so when you are producing libshared.so. gcc -shared -o

Include static lib in dynamic lib

最后都变了- 提交于 2019-12-13 15:02:50
问题 I have the following problem : several object files a1.o, a2.o, a3.o, ... an archive libxxxx.a. The archive libxxxx.a only contains object files : b1.o, b2.o etc... I would like to create a shared library (.so) from all the object files. Problem : If I use : g++ -shared libxxxx.a a1.o a2.o ... -o libnew.so g++ does understand that I want to link with the static library libxxxx.a and does not include all the symbols of the archive. A simple workaround is to first expand the archive using ar -x

waf cannot find an existing library

守給你的承諾、 提交于 2019-12-13 14:34:29
问题 I'm trying to program a C++ module for node.js. Node is using waf as builder. I want to check on configure, if the library "sigar" exists. What I'm trying to do so: def configure(conf): conf.check_cxx(lib='sigar') When I run "node-waf configure", I get the following message: Checking for library sigar : not found But libsigar.so exists: # whereis libsigar libsigar: /lib64/libsigar.so I also ran ldconfig after installing the "libsigar" library. The node module compiles, links and works without

How to write C .so library to subsitute existing C++ .so library?

会有一股神秘感。 提交于 2019-12-13 13:09:45
问题 Let me explain the scenario. We have a legacy C++ compiled .so library. The functions in this library are declared with extern "c" {} , so the library can be used by both C and C++ program, plus, for some reason it was created with --static-libgcc option. This old library is very old and hard to maintain. Now we haved managed to write a subsitution of it, but in C language. Let's say the old library is called libfoo.so(old), and new one is libfoo.so(new). For a given bar.o, it can be linked

C program compiling with glibc and not the default libraries: Permission denied on execution

∥☆過路亽.° 提交于 2019-12-13 13:08:50
问题 it's my first question on stackoverflow, so I will try to do it well. Context: I would like to deliver a program who could run on every Linux distribution (for example, a program who will use C++11, running on a system who don't have the C++11 library). For that I would like to copy all the libraries who are used by my program and put them in a folder with the executable, so it can use these libraries instead of the system's one. I got 2 environments to test: - Opensuse, with (GNU libc) 2.19

CTRL+C doesn't interrupt call to shared-library using CTYPES in Python

雨燕双飞 提交于 2019-12-13 13:02:33
问题 When calling a loop being performed in a C shared-library (dynamic library), Python will not receive a KeyboardInterrupt, and nothing will respond (or handle) CTRL+C. What do I do? 回答1: Unless you use PyDLL or PYFUNCTYPE ; the GIL is released during the ctypes calls. Therefore the Python interpreter should handle SIGINT by raising KeyboardInterrupt in the main thread if the C code doesn't install its own signal handler. To allow the Python code to run in the main thread; you could put the

OpenMP library specification

折月煮酒 提交于 2019-12-13 12:09:48
问题 i am new to open mp and i tried an sample program from the official site #include <omp.h> #include <stdio.h> int main() { #pragma omp parallel printf("Hello from thread %d, nthreads %d\n", omp_get_thread_num(), omp_get_num_threads()); } and i have set the library in the eclipse as libgomp in project Properties->GCC c++ linker- but the program say /usr/bin/ld: cannot find -llibgomp can i know where i am wrong 回答1: Try linking with gomp instead of libgomp : library names must be passed to the

Extend a dynamic linked shared library?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 11:50:25
问题 I'm new at C, so sorry for my lack of knowledge (my C-book here is really massive :) I would like to extend a shared library (libcustomer.so) with closed source, but public known api. Is something like this possible? rename libcustomer.so to liboldcustomer.so create an extended shared library libcustomer.so (so others implicitly use the extended one) link liboldcustomer.so into my extended libcustomer.so via -loldcustomer forward any not extra-implemented methods directly to the old

symbol lookup error: ./executableName: undefined symbol: _ZN18QXmlDefaultHandlerC2Ev

余生长醉 提交于 2019-12-13 11:40:39
问题 I am trying to run an executable on Linux Mint 16 x64 that was compiled for Ubuntu 12 x64. The executable uses Qt 5.1.1 dynamically during runtime. I get the error: loaded the dummy plugin loaded the Linux plugin updating server status ./executableName: symbol lookup error: ./executableName: undefined symbol: _ZN18QXmlDefaultHandlerC2Ev When I run ldd executableName | grep "not found" searching for missing dependencies I get no result; all dynamic dependencies seem to be found, but the