static-linking

Why linker link static libraries with errors? iOS

孤者浪人 提交于 2020-01-18 05:35:07
问题 I have a problem with linking my mixed language framework to a project. 1) I create framework with Swift and Objective-C classes. 2) Main logic was stored in Swift file. For example the class with method that calls NSLog("Swift log was called"). 3) Objective-C file has class that has method in which I create an instance of Swift class and call Swift-log method. 4) I link this framework with my Objective-C project, I can call all what I need in this project, but when I want to build this

Can a dynamically linked library override a static one?

♀尐吖头ヾ 提交于 2020-01-15 10:14:55
问题 nokogori gem comes with its own version of libxml2 . Moreover it warns about libxml2.so of a different version being loaded before it was required: if compiled_parser_version != loaded_parser_version ["Nokogiri was built against LibXML version #{compiled_parser_version}, but has dynamically loaded #{loaded_parser_version}"] It basically compares LIBXML_DOTTED_VERSION macro and xmlParserVersion global variable: rb_const_set( mNokogiri, rb_intern("LIBXML_VERSION"), NOKOGIRI_STR_NEW2(LIBXML

Want to make standalone program with cmake

久未见 提交于 2020-01-14 12:21:44
问题 My program uses giblib and Imlib2 library and it is built with cmake. It works perfectly in my computer but not in other's. I guess the reason is I installed every library what my program needs but other's doesn't. My goal is making standalone program. (don't need to install any other library addtionally) What should I add in cmake file? projectDef.cmake source code file (GLOB PLATFORM RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} X11/[^.]*.cpp X11/[^.]*.h X11/[^.]*.cmake ) SOURCE_GROUP(X11 FILES $

Want to make standalone program with cmake

杀马特。学长 韩版系。学妹 提交于 2020-01-14 12:17:31
问题 My program uses giblib and Imlib2 library and it is built with cmake. It works perfectly in my computer but not in other's. I guess the reason is I installed every library what my program needs but other's doesn't. My goal is making standalone program. (don't need to install any other library addtionally) What should I add in cmake file? projectDef.cmake source code file (GLOB PLATFORM RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} X11/[^.]*.cpp X11/[^.]*.h X11/[^.]*.cmake ) SOURCE_GROUP(X11 FILES $

statically linked shared object? Or a corrupt file?

爱⌒轻易说出口 提交于 2020-01-13 09:54:14
问题 I have a library that I got from a proprietary source and I'm trying to link against it but I'm getting the following error libxxx.so: file not recognized: File format not recognized collect2: ld returned 1 exit status and indeed $ ldd ./libxxx.so statically linked what does that exactly mean? Never saw a statically linked .so in my life. It might be worth noting that the last version of the same software included the same .so for which ldd shows the "normal" output and that works fine. $

Boost not statically linking in to boost::python shared object

荒凉一梦 提交于 2020-01-13 05:27:26
问题 I've created a wrapper for my application using boost::python. This has worked so far by: (number of static libraries/source code) -> python_mapping.so In this way my shared object is comprised of many static libs, including boost itself (notably boost_thread). I would assume that this so would contain ALL my application information, as I've statically linked everything in. This compiles just fine. ldd python_mapping.so librt.so.1 => /lib64/librt.so.1 (0x00002b7cbad37000) libstdc++.so.6 =>

Why is my static library so huge?

孤人 提交于 2020-01-11 02:15:29
问题 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

C++ global variable not initialized when linked through static libraries, but OK when compiled with source

被刻印的时光 ゝ 提交于 2020-01-09 12:52:11
问题 I have created a system that automatically registers function objects (functors) into a map based on the constructor of an global instance. In each cpp file that defines the functor, there's a global instance of the registrar class instance to register the functor to a singleton std::map<int, std::function<...> > object. This is the definition of registrar class: template < typename map_type, typename handler_type > struct registrar { registrar ( map_type& map_object, boost::uint16_t cmd_code

Create a Portable Static Library from a Project Based on OpenCV Static Libraries

时光怂恿深爱的人放手 提交于 2020-01-07 07:59:04
问题 I compiled OpenCV 3.x with the Static Libraries options ( -DBUILD_SHARED_LIBS=OFF ). No I have a project built with few functions which uses OpenCV. I want to build my project as a portable static library. By portable I mean I can share it with others to use my functions in their code without the need to install OpenCV. How can I do that on Windows, macOS and Linux? I would like the process to be done using a Compiler in order to extract only the needed objects (Functions) from all OpenCV

How to set CMAKE static linking ( undefined reference to `dlopen' )?

岁酱吖の 提交于 2020-01-07 05:10:29
问题 I need to set static linking for my project. Current state is : target_link_libraries(armd ${SQLITE3_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} rt) if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_CXX_FLAGS "-O0 -Wall -fmessage-length=0") doesn't work on device, I need to link statically (add -static for device) but when I do set(CMAKE_CXX_FLAGS "-O0 -Wall -fmessage-length=0 -static") I'm getting: /arm-buildroot-linux-uclibcgnueabi/sysroot/usr/lib/libsqlite3.a(sqlite3.o): In function `unixDlOpen': sqlite3.c:(