static-libraries

Linking Libraries that contain circular references in GCC

时光毁灭记忆、已成空白 提交于 2019-12-05 11:29:44
I am trying to link an application with multiple static libraries in GCC. There are two libraries that cause problems. Libsupport provides a terminal for the application. It relies on libcpu to provide a serial link, timing and syncronisation. Libcpu relies on libsupport to provide queueing for serial data and more. If I specify libsupport first when linking libcpu cannot be linked with the queue functions. Is I specify libcpu first lib support can not link the serial link (and more) functions. It looks like GCC parses a library only once and discard any unused objects. Can I ask gcc to parse

When is a header file required for using a static library?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 10:17:11
If I create a static library in C++ in Linux such that a ".a" file is produced, how do I (or anyone else) use the library? For example, my library defines a class. I assume that it is not sufficient merely to provide the ".a" file, but also to provide a header file. How do I know what header files must be provided with the ".a" file? For example, do I need to provide all header files that were included anywhere in the code for my library? Emilio Garavaglia The technical reason for header files is to let the compiler know about names and sizes while compiling user code, so that it can arrange

How can i build project in visual studio 2012 on both way(dll and lib) together

人盡茶涼 提交于 2019-12-05 09:35:24
I managed to set up build project in dll mode and in library mode but not together: for build in dll: project->properties->Configuration Type: Dynamic Library (.dll) project->properties->Target Extension: .dll for build in library: project->properties->Configuration Type: Static library (.lib) project->properties->Target Extension: .lib it is possible to build both of them together? Yes, you can have single project that can be used for .dll and .lib. Steps to be followed: Visual Studio will provide you Debug and Release solution configurations. Create custom configurations for lib and dll (i.e

Xcode 11 not recognizing static library's architecture: MacCatalyst (aka UIKitForMac)

隐身守侯 提交于 2019-12-05 09:25:38
After getting excited about 2019's WWDC announcements, I tried compiling my existing iOS app against the MacOS using Xcode 11.0 beta. Unfortunately, it didn't go as expected. Xcode says my static library is built for < unknown > architecture: Building for UIKit for Mac, but the linked library 'libssl.a' was built for < unknown >. You may need to restrict the platforms for which this library should be linked in the target editor. But when I check my static libs, I can see they do contain the desired architecture x86_64 : I believe this issue may be related to an Xcode Beta bug. Does anyone have

Linking FFTW into an Android NDK application

不想你离开。 提交于 2019-12-05 09:07:24
I am currently writing a genre classification application as my final year project in Computer Engineering. I initially wrote the feature extraction code (implementing FFTW) in C and now I need to implement it on Android via the NDK. This is my first NDK project so I'm still getting the hang of things but I have compiled the FFTW3 library for Android according to this guide . I didn't do the very last step because I didn't think it was right for what I need. My question is how do I, after the compile step, use the library in the main NDK application that calls on it? Do I everything normally

How to disable Linker Warnings from static libraries on xcode?

可紊 提交于 2019-12-05 08:40:32
In my current Swift project, I have a 3rd party static library, added through the Build Phases > "Link Binary With Libraries" section. After updating to xcode 8.3, this library started throwing some linker warnings (e.g.: pointer not aligned at address 0x00000 from libraryFile.a) As pointed out by other answers ( https://stackoverflow.com/a/8580123/2754958 and https://stackoverflow.com/a/6921972/2754958 ), the compiler warnings could be ignored by adding a flag to the library code. However, in my case, the libraries are static, and the warning are from the linker. Is there a way to disable

Duplicate symbol in admob static library

僤鯓⒐⒋嵵緔 提交于 2019-12-05 08:25:25
In my application i am using libGoogleAdMobAds.a and libGDataTouchStaticLib.a for ads and video sharing on YouTube but it shows the duplicate symbols for architecture i386 for libGDataTouchStaticLib.a(SBJSON.o) How can i avoid this error in my app? 来源: https://stackoverflow.com/questions/18486349/duplicate-symbol-in-admob-static-library

Creating static library and linking to it with premake

ぃ、小莉子 提交于 2019-12-05 07:32:28
I am currently trying to learn how to use premake 4 in order to apply it to the OpenGL sdk . I am currently trying to make a Visual Studio 2010 solution that constructs 2 projects, one being a static library, the other contains a single main source file, with the main method. This project is extremely simple, and is solely for the purpose of learning premake. In the static library project, named Test, I have 2 files, Test.h and Test.cpp. Test.h contains the prototype for the method print(). print() simply prints a line to the console. Using premake, I linked the static library to the Main

Static library (.lib) to Python project

六月ゝ 毕业季﹏ 提交于 2019-12-05 05:37:58
is it possible to import modules from .lib library to Python program (as simple as .dll)? In theory, yes; in practice, probably not -- and certainly not as simply as a DLL. Static libraries are essentially just collections of object files, and need a full linker to correctly resolve all relocation references they may contain. It might be possible to take your static library and simply link its contents to form a shared library, but that would require that the static library had been built as position independent code (PIC), which is not guaranteed. In theory there's no reason the work a full

Two library of different versions in an application

青春壹個敷衍的年華 提交于 2019-12-05 05:08:57
问题 Consider a scenario where there are two shared library of different version.Consider A.1.so linked to B.so and A.2.so linked to C.so. Now both B.so and C.so are linked to d.exe . When B.so wants to invoke function in A.1.so, it ends up calling function in A.2.so .Because of this , it gives us undefined behaviour. Now I want my B.so invoke only A.1.so.I can only modify A.1.so and B.so , nothing else. Using dlopen() is one of the option, but for using dlopen() , I have to make heavy changes in