static-libraries

iPhone SDK linking errors with static library

我的未来我决定 提交于 2019-12-01 03:34:04
I've built my own static library with components to be reused in my project, and recently had the need to update a bunch of classes. Specifically, some methods' signatures were changed due to the fact that some classes changed names. What happens now is that the library compiles fine on its own, but, when added to an app project, the project fails to link: Ld build/Sucursales.build/Debug-iphoneos/Sucursales.build/Objects-normal/armv6/Sucursales normal armv6 cd /Users/nameghino/src/Sucursales setenv IPHONEOS_DEPLOYMENT_TARGET 3.1 setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr

Can't use attachInterrupt in a library

橙三吉。 提交于 2019-12-01 03:15:17
问题 I'm writing a simple library for an ultrasonic distance sensor and thought i'd try using interrupts. However i can't set my functions in the attachCallback method properly. I want HCSR04Interrupt::echoHigh() and HCSR04Interrupt::echoLow() called when the pin goes high and low respectively. I've Googled this to no avail. The Ardiuno IDE says the following: ./Arduino/libraries/HCSR04/HCSR04Interrupt.cpp: In member function 'void HCSR04Interrupt::getDistance()': ./Arduino/libraries/HCSR04

undefined reference to `inflate'

让人想犯罪 __ 提交于 2019-12-01 03:04:00
Trying to link against a static assimp library which I built with MinGW. Here are the errors I'm getting: H:\ovgl\ovgl...\dependencies\Assimp\lib\libassimp.a(BlenderLoader.cpp.obj):BlenderLoader.cpp:(.text+0xd91): undefined reference to inflateInit2_' H:\ovgl\ovgl\.\..\dependencies\Assimp\lib\libassimp.a(BlenderLoader.cpp.obj):BlenderLoader.cpp:(.text+0xe06): undefined reference to inflate' H:\ovgl\ovgl...\dependencies\Assimp\lib\libassimp.a(BlenderLoader.cpp.obj):BlenderLoader.cpp:(.text+0xf72): undefined reference to inflateEnd' H:\ovgl\ovgl\.\..\dependencies\Assimp\lib\libassimp.a(XGLLoader

Link Visual C againts MinGW's static library

走远了吗. 提交于 2019-12-01 02:29:02
问题 How can one link Visual C++ (2010) console app with a STATIC library created by MinGW ( *.a format)? Is it compatible with Visual C++ 2010? Thank you. 回答1: It's not compatible. However, if you extract all the object files from the library (use ar ), the VC++ linker is able to deal with those (I tested it, although I used cygwin gcc rather than mingw gcc). Note that you may still have name mangling problems if you don't use extern "C" . You may of course use VC++'s LIB.EXE tool to make these

Creating both static and shared C++ libraries

℡╲_俬逩灬. 提交于 2019-12-01 01:51:57
问题 I'd like to build both static and shared libraries in a project. I know that shared libraries need to be be created from objects compiled with -fpic to get Position Independent Code while the static library doesn't need this. This is all fine and I can create either a shared or static library. I wouldn't want to compile my source twice to get the different object files, so how is this usually done? I read how to get a shared library based on a static one. However, the example shows the static

Distributing Windows C++ library: how to decide whether to create static or dynamic library?

心不动则不痛 提交于 2019-12-01 01:07:24
We have been converting our Java and .NET API library to C++, and are trying to figure out what is the best way to distribute a compiled version to other developers to use with their custom applications. Should it be a static library or dynamic library? We need to create for both Win32 and Win64 (and I suppose both a Debug and Release version of each target OS). Given all the frustration I've encountered trying to make sure all referenced libraries are matched (/MT versus /MD), I'm wondering if there is a decision to make here which will simplify it for other developers. When I run dumpbin

iPhone SDK linking errors with static library

三世轮回 提交于 2019-11-30 23:55:01
问题 I've built my own static library with components to be reused in my project, and recently had the need to update a bunch of classes. Specifically, some methods' signatures were changed due to the fact that some classes changed names. What happens now is that the library compiles fine on its own, but, when added to an app project, the project fails to link: Ld build/Sucursales.build/Debug-iphoneos/Sucursales.build/Objects-normal/armv6/Sucursales normal armv6 cd /Users/nameghino/src/Sucursales

ctypes for static libraries?

烂漫一生 提交于 2019-11-30 22:36:22
问题 I'm attempting to write a Python wrapper for poker-eval, a c static library. All the documentation I can find on ctypes indicates that it works on shared/dynamic libraries. Is there a ctypes for static libraries? I know about cython, but should I use that or recompile the poker-eval into a dynamic library so that I can use ctypes? Thanks, Mike 回答1: The choice is really up to you. If you have the ability to recompile the library as a shared object, I would suggest that, because it will

How to store a version number in a static library?

依然范特西╮ 提交于 2019-11-30 20:16:39
How can I store a version number in a static library (file.a) and later check for its version in Linux? P.S. I need possibility to check version of file any time without any special executable using only by shell utilities. Maybe you could create a string with the version like this: char* library_version = { "Version: 1.3.6" }; and to be able to check it from the shell just use: strings library.a | grep Version | cut -d " " -f 2 In addition to providing a static string as mentioned by Puppe, it is common practice to provide a macro to retrieve the version check for compatibility. For example,

Why is my static library so huge?

笑着哭i 提交于 2019-11-30 19:37:26
I have a C++ compiled static library of about 15 classes and their member functions and stuff, and compiled, it's almost 14 megabytes. It links to Google's dense hash table library and MPIR, which is like GMP for Windows, but I did that in a plain exe and it was a few kilobytes. Why is it so massive? What can I do to reduce its size? It seems like there's other programs which are far more complicated than mine that are far smaller. Compiled with Visual C++, command line is: /Zi /nologo /W3 /WX- /O2 /Oi /Oy- /GL /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm- /EHsc /GS /Gy