static-libraries

can static linking result in executing some init routines?

断了今生、忘了曾经 提交于 2020-01-06 14:58:14
问题 do not understand this thing: I got a program in c and I am linking some second party static libs to that (as far as I know lhis libs can be also some wrappers on dlls) - does it can bring my program to 'implicitely' (I mean without explicit call to that in my code) run some initialisation code from whithin those libs (that will execute before my main() routine ? - or it cannot ?) I am asking here about about c code (eventualy about c code without any c++ feature but compiled in c++ mode by c

Creating a static library Visual Studio

烂漫一生 提交于 2020-01-06 05:40:20
问题 I am trying to create a static library in Visual Studio that contains other sources which paths are in Additional Include Directories defined. I can build and create the library without problems, but when I try to use it in another project, it seems that it does not include the sources which are defined in Additional Include Directories, so It does not find the sources specified in that paths. Does the static library not include that sources when it is build? Is there another way to include

Creating a static library Visual Studio

拟墨画扇 提交于 2020-01-06 05:40:07
问题 I am trying to create a static library in Visual Studio that contains other sources which paths are in Additional Include Directories defined. I can build and create the library without problems, but when I try to use it in another project, it seems that it does not include the sources which are defined in Additional Include Directories, so It does not find the sources specified in that paths. Does the static library not include that sources when it is build? Is there another way to include

Cmake find module to distinguish shared or static library

♀尐吖头ヾ 提交于 2020-01-06 02:22:05
问题 I have a cmake c++ project that uses libCrypto++. I have FindCryptoPP.cmake module hosted here. Important parts are: find_library(CryptoPP_LIBRARY NAMES cryptopp DOC "CryptoPP library" NO_PACKAGE_ROOT_PATH PATHS "/usr/lib/x86_64-linux-gnu/" ) ... add_library(CryptoPP::CryptoPP UNKNOWN IMPORTED) set_target_properties(CryptoPP::CryptoPP PROPERTIES IMPORTED_LOCATION "${CryptoPP_LIBRARY}" INTERFACE_INCLUDE_DIRECTORIES "${CryptoPP_INCLUDE_DIR}") And this works fine, finds static library file (*.a)

What library would it link against - static or shared object

风流意气都作罢 提交于 2020-01-05 13:51:12
问题 I have a C++ based project(many source files) compiled using gnu make via a makefile. I have an application which links a library, say mylib. Now mylib is owned by some other developer. I see 2 files present in the path where the library binaries are generated namely libmylib.so (shared object) and libmylib.a (static library archive file) My application makefile has below linker option to link the library mylib LDFLAGS+=-l:mylib ... Question is what version of the library mylib would be

is there any change with ios static library run script with xcode 10?

不羁岁月 提交于 2020-01-05 07:15:33
问题 I have created a static ios library, and I have created Aggregate target to get an universal library as output for that i have included shell script in the build phase section: # define output folder environment variable UNIVERSAL_OUTPUTFOLDER=${BUILD_DIR}/${CONFIGURATION}-universal # Step 1. Build Device and Simulator versions xcodebuild -target OffsetCalLib-Universal ONLY_ACTIVE_ARCH=NO -configuration ${CONFIGURATION} -sdk iphoneos BUILD_DIR="${BUILD_DIR}" BUILD_ROOT="${BUILD_ROOT}"

Static libraries and JNI

那年仲夏 提交于 2020-01-05 06:53:14
问题 I have created a header file and a corresponding .c file full of functions I would like to use with a java program. I created a JNI header file using javah. I'm using gcc to compile my header file. How can I link my regular c object file with my JNI static library to get a static library that utilizes my C library? I'm using gcc to compile. Here's an example of what I'm asking: lib.h lib.c JNITest.h JNITest.c (uses lib.h functions) 回答1: You might try looking at this http://java.sun.com

MinGW32: Linking against ImageMagick with -static flag

蓝咒 提交于 2020-01-05 04:35:07
问题 I am currently trying to build a Windows-version of emacs that supports ImageMagick. For that purpose I have already compiled ImageMagick with MinGW32/MSys in order to get compatible library files. Basically linking also works, though I have to add explicitly -llibMagickCore-6.Q16 and -llibMagickWand-6.Q16 to the linking command through configure.bat 's --lib option. However, the binary distribution of emacs for windows is supposed to load, even when the dependencies are absent. This

Build FFTW lib with Visual Studio 2015 [added: steps for VS 2019]

浪子不回头ぞ 提交于 2020-01-04 06:29:11
问题 I'm trying to use Visual Studio 2015 to compile a project that uses FFTW. Unfortunately, the precompiled binaries from the FFTW website aren't compatible with VS 2015, due to this problem: unresolved external symbol __imp__fprintf and __imp____iob_func, SDL2. You get a link error when you try to compile. I'm looking for any advice on how I can compile a compatible version. The obvious answer would be to recompile FFTW with VS 2015, but I can't find any instructions on how to compile it with

Node-gyp/C++ import shared library (.so)

我的梦境 提交于 2020-01-03 16:56:59
问题 Importing a shared library (.so) doesn't seem to be an easy task. I tried to follow the instructions in this post, but I really can't get it to work. Building without the library RF24 is working. Followed their build instructions which produced the following filesets in the /usr/local/lib folder librf24-bcm.so librf24.so librf24.so.1 librf24.so.1.3 librf24.so.1.3.1 node_modules python2.7 python3.5 In my .cpp file I include the library like this #include <RF24.h> // also tested "" instead of <