static-libraries

How to list dependencies of c/c++ static library?

时光毁灭记忆、已成空白 提交于 2019-12-05 20:20:18
问题 For a static library (.a file), how to list the module-level dependencies of it? I know for a shared library (.so), we can use objdump or readelf to do this: objdump -p test.so or readelf -d test.so I can get something like NEEDED libOne.so NEEDED libc.so.6 But for a static library, I can only get the dependencies in symbol-level, for example, by running objdump -T test.a I will get some thing like: 00000000 DF UND 00000000 QByteArray::mid(int, int) const 00000000 DF UND 00000000 QUrl:

Create a fully static Libcurl library

只谈情不闲聊 提交于 2019-12-05 19:50:30
First I'll explain the big picture : I am creating an application where I separated most of the features in different libraries. One of them contains some classes that use curl. I actually use Ubuntu 64 bit to develop and test it, but my production environment is a NAS with an ARM processor. I intend to, later, also make it for windows. Where I am now : My application is running on linux and the ARM-based NAS. However, I don't link with curl, I use curl from command-line internally to do what I need. This has some drawbacks : As a programmer, I consider it an ugly practice. I should link to

How do i write a static ansi-c library using visual studio 2010

心已入冬 提交于 2019-12-05 19:39:22
When I write and compile a lib file in VS2010 I am missing something. I somehow do not mark them correctly for export. The console command dumpbin.exe -headers mylib.lib > stackoverflow.txt generates the following output. (I removed empty lines) Microsoft (R) COFF/PE Dumper Version 10.00.30319.01 Copyright (C) Microsoft Corporation. All rights reserved. Dump of file mylib.lib File Type: LIBRARY ANON OBJECT HEADER VALUES 1 version 14C machine (x86) 515AC7B8 time date stamp Tue Apr 02 13:57:44 2013 ClassID: {0CB3FE38-D9A5-4DAB-AC9B-D6B6222653C2} 171A size 0 flags I create a new empty project.

How I do compile a application against a static library compiled with libc++ in xcode/clang/macos?

给你一囗甜甜゛ 提交于 2019-12-05 19:29:30
When I try to compile a test console application to test some functionality on a static library on the same workspace, i run into problems in the linking stage of the binary, it only happen when I choose to use libc++ standard library. The missing symbols error is the follow : Undefined symbols for architecture x86_64: "std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >::empty() const", referenced from: libtorrent::torrent::replace_trackers(std::__1::vector<libtorrent::announce_entry, std::__1::allocator<libtorrent::announce_entry> > const&) in

Compiling Python to a static lib and using pythoncore.lib

旧巷老猫 提交于 2019-12-05 19:02:29
问题 I'm trying to build Python 2.7 as a static single .lib file. I've already made the following changes to the Python source code: Change to "Release" mode. Change all DLL projects to Static library (.lib) and set runtime library to /MT Add preprocessor definition Py_NO_ENABLE_SHARED to python and pythoncore I've managed to compile the pythoncore project to pythoncore.lib (about 11mb size), but when trying to compile the python project I get the following linking errors: error LNK2019:

pre-link static libraries for ios project

余生长醉 提交于 2019-12-05 18:05:17
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 symbols (6-60 clones). So final linking of the app takes several minutes. This becomes extremely

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

梦想的初衷 提交于 2019-12-05 16:51:37
Is it possible to use a C++ static library (.lib) compiled using Visual Studio 6 in Visual Studio 2008? 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. It really depends. Does the lib expose only 'extern "C"' functions where memory is either managed by straight Win32 methods (CoTaskMemAlloc, etc) or the

Referencing C functions in static library from C++

别说谁变了你拦得住时间么 提交于 2019-12-05 14:49:34
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 not modify any of the code used to build this library. I also have a C++ header (cppHeader.h) that

Visual Studio 2012 link errors with static libraries

拟墨画扇 提交于 2019-12-05 13:45:09
问题 I recently upgrade to 2012 from 2005 (I'm pretty sure) and ran into link errors when building my solution. I ran out of ideas after hours of searching google and putsing around. I've set up dozens of projects, so I'm pretty certain I've done everything right, but to be fair, it's been a few years. So, as a test I set up a new project. I called it App, a Windows application (.exe). I created a second project called Core and flagged it as a static library (.lib) in it's Configuration Type. Both

Why do some DLL files need an additional .lib file for linking?

守給你的承諾、 提交于 2019-12-05 11:39:28
问题 I have a question about library linking and .lib files... this is the context: OS = Windows IDE = QT I have created a DLL: MyLib.dll. To use that library in my QT project, I only have to include an include path, a link to the library and use the header files: LIBS += "C:\myPath\MyLib.dll" INCLUDEPATH += "C:\myPath" HEADERS += \ ../myPath/MyLib_global.h \ ../myPath/mylib.h I am using a third party dll in my project: third.dll If I do the same as in the above example, it does not work: LIBS +=