FAQ Database Discussion Community


Can we hide unimportant declarations in Header files?

c++,static-libraries
I recently decided to export some of my functions to a static library (.lib). I also decided not to give the complete header files to the Users. I kept private and protected variables and methods out of it, as the end-users should not use them and should not have to...

Trying to create Library in C++. Test project can't find implementation of declared constructor?

c++,constructor,static-libraries,header-files
I'm learning C++, but hit a plateau trying to create a library. Using Visual Studio 2013, I get this error: Error 1 error LNK2019: unresolved external symbol "public: __thiscall Polynomial::Polynomial(void)" ([email protected]@[email protected]) referenced in function _main A:\Medier\Desktop\PolyLib\Test\Test.obj Test The testproject is currently cut down to this: #include "A:\Medier\Desktop\PolyLib\PolyLib\PolyLib.h" using namespace std;...

Unit testing MVC Controller making calls to a static library calling external API

c#,asp.net,asp.net-mvc,unit-testing,static-libraries
Good day, I am confused about unit testing the following: 1. MVC Controller: [HttpGet] public async Task<PartialViewResult> DoExternalCallsAsync() { var model = new MyModel(); await MyStaticLibrary.DoExternalWorkAsync(Server.MapPath("~\\") + "WorkSource.txt", model); return PartialView("_MyResults", model); } 2. Static library: public static async Task DoExternalWorkAsync(string sourcePath, MyModel model) { var externalCalls = System.IO.File.ReadAllLines(sourcePath) .Where(line...

How to change architectures in static libraries?

ios,xcode,architecture,static-libraries,arm64
I have several framework statics libraries (.a files). When i call lip -info filename.a upon those files the terminal tells me that the architecture arm64 is not there. However to comply with the new Apple regulation stating that the apps must work with arm64 i need to add that architecture...

avcodec_open only works with uncompressed format

ffmpeg,static-libraries,codec,avcodec
Context: I have a file called libffmpeg.so, that I took from the APK of an Android application that is using FFMPEG to encode and decode files between several Codecs. Thus, I take for grant that this is compiled with encoding options enable and that this .so file is containing all...

Can I attach a storyboard to a Static Library

objective-c,iphone,xcode,storyboard,static-libraries
I have a very simple single view application that I need to convert into a library. I believe I am off to the correct start of going to my project settings and then adding a Cocoa Touch Static Library. After doing that I moved my ViewController.h, ViewController.m and Main.storyboard files...

Undefined symbols when depending on a statically compiled library from VS2010

c++,visual-studio-2010,gcc,static-libraries
I have a project in Visual Stuio 2012 Express and I would like to include a static library, compiled with gcc from MinGW. I included the library i nthe project options of the project. Not working. Next I tried with a mockup minimal library. test.c int foo(){return 5;} cmd: gcc...

‘Cloud/CLAPIEngine.h’ file not found

ios,objective-c,xcode,static-libraries
My application has been running fine with the Cloud-iOS.a library for the past few days. However, today, when I used the “Product > Clear Build Folder” command and tried to run the app again, it would give me this error: ‘Cloud/CLAPIEngine.h’ file not found The Cloud library builds successfully, but...

C Program (in OS X) - file was built for archive which is not the architecture being linked (x86_64)

c,osx,static-libraries,osx-yosemite
I have an assignment in which I have to use a given source code with an included library, namely, libdb_factory.a and libdb_factory32.a (they gave us both x86_64 and ie386 versions). The first hint of something going wrong is that, when executing lipo -info on any of them, I get this:...

Static library link issue with Mac OS X: symbol(s) not found for architecture x86_64

c,osx,clang,static-libraries,ar
I'm trying to generate a static library and link it with an execution binary. This is a library function: #include <stdio.h> int hello() { return 10; } With these commands, I could get a static library. gcc -c io.c ar -crv libio.a io.o With lip -info, I checked it is...

Including header files into static library

c,gcc,static-libraries,header-files,static-linking
Since every time when we link against a static library we also need to include the header files, I am wondering if it is possible to archive into the static library, when creating it, those heads? Say I have two object files foo1.o and foo2.o generated by gcc foo1.c -I...

Same class name in library and project

ios,objective-c,static-libraries
If I have a class named ClassA in my main project, and I have a sub project built for a static library, in this sub project a class also named ClassA. I'm wonder that I can build and run successfully, how the compiler distinguish the two class?

Runtime Mismatch in Visual Studio 2012

c++,visual-studio-2012,msbuild,static-libraries,linker-error
This is the first time I'm asking a question here, so pardon me if I miss some of the etiquette. I have a solution that was originally a VS2008 one, I have migrated it to VS2012 and that didn't create a problem. My solution uses DCMTK static libraries so I...

Compiling static library for Unity 4.6.3 (64-bit & IL2CPP)

ios,unity3d,64bit,static-libraries,arm64
I have a static library that I've been integrating into my Unity-iOS projects for several months now. Everything has been working fine for Unity 4.3.x. With the recent release of Unity 4.6.3, which provides building for 64-bit devices using the IL2CPP scripting backend and Universal architecture, my static library no...

Compile Curl Visual Studio - unresolved external symbol

c++,curl,static-libraries,unresolved-external
I need to use a static library of libcurl and I found this github rep that generate the libraries. Now, I'm trying to compile a simple piece of code that use curl using the static library, libcurl_a.lib, but without success. At first, I miss the -DCURL_STATICLIB flag and I got...

Static linking against non-binary libs

c++,qt,static-libraries,qt-creator,static-linking
I want to make use of two libraries QCustomPlot and Eigen with Qt Creator on OS X. Both do not need to be installed and work fine if I just put them into my project folder and add them to the project. They do not have to be installed, "you...

Undefined symbols upon bringing a static library into project

ios,objective-c,xcode,static-libraries,linker-error
I have a static library that I've created. It's a universal library so it should be working on the iphone and the simulator. Just by bringing the library into the project it won't compile, I get about 21 linker errors. They're all like this: "_OBJC_CLASS_$_NumberPad", referenced from: objc-class-ref in libClipPOSLibrary.a(PCCIDEntryView.o)...

Static linkage to IPP inflates lib size to more than 100MB?

static-libraries,static-linking,ipp
I have a static library that is linked to IPP 7.1 for 4 calls to ippi_Mul. The project is built in Visual Studio. This was previously a dynamic link, but it turns out that in IPP 7.1 dynamic libraries are internally multi-threaded, which is disallowed for me, so I changed...

Do you only need to build the googletest library once?

c++,cmake,make,static-libraries,googletest
So firstly I'm new to testing frameworks and relatively new to C++ but am trying to wrap my head around GoogleTest. I'm working on a Windows machine, running "Git for Windows" (MSYS) and MinGW whilst using Sublime Text as my code editor. I am using make as my build tool,...

What is the main differance between .so file and .jar android

android,static-libraries,android-library
What is the main difference between .so file and .jar file in android? Is it possible to change using of .so with using of .jar file?

Undefined reference while linking static C library

c,linker,static-libraries,protocol-buffers,static-linking
In my latest project I am encountering a strange issue regarding an undefined reference to a method of a shared library. I searched on SO but all I could find was either C++ related (extern "C") or not really helping. The library in question is my fork of libosm which...

Exporting a visual studio c++ project for use in another project, without revealing the .cpp and .h source files

c++,visual-studio,static-libraries,precompiled-headers
I have a visual studio project called "TopSecretProject" that I want to share with an anonymous developer user, without revealing any of my code, including the header files (Since my .h files include the structure of my project ant the user cannot know about it). The user should receive: A...

Dynamically linking from a static libarary?

linux,static-libraries,ld
I'm currently attempting to rebuild FlightGear on my Ubuntu 14.04 machine. Everything went smoothly until I decided to build fgrun which requires Qt. I decided to compile Qt as a static library since I didn't want self-built libraries overrunning any on the system. I statically built Qt on the system...

Multiple function calls when linking to a static library

c++,linker,static-libraries
In my c++ project I make several calls to a function in a static library, so I wonder if the linker copies that function just once, or everytime it's called in the source code .

How to include freetype library to Keil uVision 4?

embedded,static-libraries,true-type-fonts,freetype,keil
I have to add freetype library to keil uvision 4 for dealing ttf font files. I followed the steps in http://www.freetype.org/freetype2/docs/tutorial/step1.html . I am trying to compile this code. example1.c I tried the tutorial in Ubuntu terminal with the help of C compiler error: Undefined reference to 'FT_Init_FreeType' . It...

VS2012 Identifer not found when part of static lib

c,visual-studio-2012,linker,static-libraries
Using VS2012 C/C++: I created and linked a static lib called "libtools" to my project. Calls to functions in the libtools lib worked as expected. I created and linked a second static lib called "shunt" to my project. But when I incorporate a call to a function in shunt, I...

iOS Static library private methods and properties

ios,objective-c,static-libraries
I want to create a static library. I have a class for example Class_A. It's a public class. So I add Class_A.h to Public Headers section. But Class_A has some internal methods and properties that I use inside library and I want hide them for public using. Is it possible...

Inter-dependencies between static libraries

eclipse,gcc,linker,dependencies,static-libraries
I am trying to link two libraries libA.a and libB.a along with a main.c file. libB has dependencies on libA, and main has dependencies on both. I am able to compile the libraries independently, but when I try to link them together to create the final executable, I get the...

How does this Xcode project on Github link its static files?

ios,xcode,static-libraries
I found this project live555-on-ios which appear to be using precompiled .a files (libliveMedia.a, libBasicUsageEnvironment.a, etc). But I could not figure out how it gets linked. I would expect they are included in Target -> Build Phases -> Link Binary with Libraries in Xcode. But they aren't there. Maybe I...

Determine .lib / .dll with header file

c++,dll,header,static-libraries
I have 3rd party library in my program. For example : #INCLUDE <3rdPartyHeaderA.h> #INCLUDE <3rdPartyHeaderB.h> int main(int argc, char** argv) { // some stuff } How do i know 3rdPartyHeaderA.h is using which particular .lib or .dll. I looked over 3rdPartyHeaderA.h but there is no information. I'm asking this question...

Including STL in static libraries

c++,c++11,stl,static-libraries
I have created a static library with the files alien.h and alien.cpp below. That library is linked by the file user.cpp. If one removes the line with the comment, then the code compiles, links, and runs as expected. As it is, the library and the program compile, the program however...

Can I place and access a static library (.a) in the Documents or Library directory for an iOS app?

ios,static-libraries,nsdocumentdirectory,nslibrarydirectory
I would like to make my iOS app easy to update a library without updating the app to the App Store. So I think I may place and access a static library (.a) in the Documents or Library directory of the app. Would this be possible? If so, how this...

CMAKE, SDL2 and OPENGL: Program binary is too big

c++,cmake,shared-libraries,static-libraries,sdl-2
I use CMAKE to link a program to SDL2, OpenGL and I compile tinyxml2 as a shared library. The resulting program binary is 1.4 mb but there's barely 1k lines of code in the program. I suspect some library is statically linked. I'd prefer they are linked as shared libraries....

Working with lib files in VS2013

c++,visual-studio-2013,static-libraries
I created a lib file called StackExample.lib. There are functions and objects described in Stack.hpp and Example.hpp. I want to have an easy time importing my library so I wrote another file called StackExample.hpp. This file contains: #pragma once #pragma comment(lib, "StackExample.lib") #include "Stack.hpp" #include "Example.hpp" Unfortunately I can no...

Change include path of static library

c++,cmake,static-libraries,include-path
I want to make a static library from a project of mine such that I can use it like this in other projects: #include <MonoEngine/engine.hpp> However right now I have a src folder in between: #include <MonoEngine/src/engine.hpp> How can I build the static library with CMake such that I can...

Call non-exported method from static library

objective-c,c,static-libraries,reverse-engineering
I am using a static library built by someone else in my Objective-C project. There is a C method in the library that I want to call, but it is not exported. How can a call this method from Objective-C code?

How to make “common headers” for a library work when it's installed in /usr/include?

c,static-libraries,header-files
I'm working on packaging a library which has a bunch of header files, and a .a static library. The C headers for the library are all in the root folder of the library, but the headers use some external typedefs held in a common/ directory. I tried copying all the...

CLLocationManagerDelegate delegate not called iOS in 8.1

ios,objective-c,location,static-libraries,cllocationmanager
I'm working with CLLocationManagerDelegate in my static library when i run on iOS 7 device everything works perfectly but when i test it on another device with iOS 8.1.3 the delegate methods aren't getting called. i made a strong property @property (nonatomic, strong) CLLocationManager locationManager i've also added the appropriate...

XCode linking static library (GLEW) attempts dylib load

xcode,osx,static-libraries,glew
I am trying to link the GLEW library to an Xcode project, but I have been running into an issue. Whenever I set up my build to link with libGLEW.a, I will immediately get a crash on startup, with an error output reading: yld: Library not loaded: /usr/lib/libGLEW.1.12.0.dylib Referenced from:...

link a library within another, still have to link it in the final project

c++,visual-studio,static,linker,static-libraries
So my projects look like this: Game (exe) Core (lib) Assimp (lib) I linked Assimp inside of Core. There I created a class that includes the assimp headers. Game links Core. Now if I create an object in Game of the class that uses the assimp header, it says that...

What is the right way to include sub bundles into main bundle iOS

ios,frameworks,static-libraries,bundles
I have the following situation, I am trying to make a framework that consist of sub projects, each sub project is a static library and a bundle. I am including those static libraries into the main project which is the framework, and also I need to include bundles to the...

dumpbin reporting wrong target architecture for a static library

c,static-libraries,cpu-architecture,gmp,dumpbin
I don't understand why dumpbin is returning x64 when executing the following on the Visual Studio command line: dumpbin libgmp.lib /HEADERS |more This is the GMP library compiled under Cygwin 32bit version, with the following build configuration: ./configure --host=i386 ABI=32 The build system compiled and built all the files successfully...

Get the RestKit version number in code (from CocoaPods or static lib)

static-libraries,restkit,cocoapods
Im planning to add a text within an app stating what RestKit version the app is currently using. So I wonder if there is an easy way to get the current version number of the RestKit installed via CocoaPods. ...Or, is there a way to check the version of the...

__isr_vectors variable not found when placed inside a static library

gcc,linker,arm,static-libraries,linker-scripts
As a spin-off of a previous question (sbrk function not found when placed in a static library): I'm creating a bare-metal application for the stm32f407 microcontroller, which has an ARM Cortex M4 core. I'm trying to create a static library containing basic stuff like cmsis, the HAL functions, and the...