static-libraries

Linker input file unused c++ g++ make file

巧了我就是萌 提交于 2019-12-07 11:17:55
问题 I am unable to figure out what is causing this error that I keep getting upon making my project: i686-apple-darwin11-llvm-g++-4.2: -lncurses: linker input file unused because linking not done And my make file looks like this: CC = g++ LIB_FLAGS = -l ncurses FLAGS = $(LIB_FLAGS) DEPENDENCIES = window.o element.o # FINAL OUTPUTS main: main.cpp $(DEPENDENCIES) $(CC) $(FLAGS) -o main.out main.cpp $(DEPENDENCIES) # MODULES window.o: main.h classes/window.cpp $(CC) $(FLAGS) -c classes/window.cpp

Referencing C functions in static library from C++

£可爱£侵袭症+ 提交于 2019-12-07 11:07:18
问题 I have a static library of functions written in C. Let's say the header file is called myHeader.h and looks like: #ifndef MYHEADER_H #define MYHEADER_H void function1(); void function2(); #endif function1 and function2 aren't anything too special. Let's say they exist in a file called impl1.c which looks like: #include "myHeader.h" void function1() { // code } void function2() { // more code } All of the code mentioned so far is compiled into some static library called libMyLib.a. I'd rather

pre-link static libraries for ios project

主宰稳场 提交于 2019-12-07 07:45:58
问题 I have a big iOS project that consists from several (about 20-30) static libraries that link together into final executable. Some of the components are platform-independent (pure C++) and some are iOS-specific (Obj-C/Obj-C++). C++ templates are used intensively, so each object file contains lots of symbols with vague linkage. The problem is that these symbols are merged only during linking of the final executable, but not when making static libraries. Each library contains tons of duplicated

Can I use a Visual Studio 6 compiled C++ static library in Visual Studio 2008?

落爺英雄遲暮 提交于 2019-12-07 07:05:17
问题 Is it possible to use a C++ static library (.lib) compiled using Visual Studio 6 in Visual Studio 2008? 回答1: I shouldn't think why not - as long as you keep the usual CRT memory boundaries (ie if you allocate memory inside a library function, always free it from inside the library - by calling a function in the lib to do the freeing). this approach works fine for dlls compiled with all kinds of compilers, statically linked libs should be ok too. 回答2: It really depends. Does the lib expose

Duplicate symbol in admob static library

♀尐吖头ヾ 提交于 2019-12-07 06:12:13
问题 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

How to disable Linker Warnings from static libraries on xcode?

半腔热情 提交于 2019-12-07 05:53:42
问题 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

Linking Libraries that contain circular references in GCC

狂风中的少年 提交于 2019-12-07 05:21:43
问题 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)

CMake generated Xcode project won't compile

别等时光非礼了梦想. 提交于 2019-12-07 03:02:25
I have a C++ project that I develop on Mac. I can build it via the command-line with ninja or gmake without problems but once I generate the Xcode project it fails. The project itself is a static library that is linked to a command line app that runs googletest. The error I get is that when it comes to build the final executable, Xcode says it can't find the static library. Here's my CMakeLists.txt: CMAKE_MINIMUM_REQUIRED(VERSION 2.8) PROJECT(MyProject) SET(CMAKE_VERBOSE_MAKEFILE 0) # set to 1 for verbose Makefile SET(MyProject_VERSION_MAJOR 1) SET(MyProject_VERSION_MINOR 0) SET(CMAKE_BUILD

How to fix “is a dynamic library, not added to the static library” warning?

心已入冬 提交于 2019-12-07 02:46:24
问题 I just upgraded to Xcode 5.1, and all of a sudden there is a new warning: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file: /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS7.1.sdk/usr/lib/libz.dylib is a dynamic library, not added to the static library The target which generates this warning is the cocos2d-iphone v2 static library (rather than use cocos2d templates, I create a static library). To

DLL linking to static libraries

a 夏天 提交于 2019-12-07 00:50:34
We have a project which is an executable, which loads DLL files at run time as plugins. We're trying to make a new plug in which has many library dependencies, and some of those dependencies are the same library but different versions that other plugins link to. Because the libraries are depended on by different plugins at different versions, I would like to statically link/build any dependencies into the new plugin - that way they can't conflict with the old plugin dependencies. As far as I know, nothing in the dependencies of the plugin need to be exported, they're just used by the plugin.