Category : static-libraries

I intend to ship a directory containing a CMake project building some C++ code that depends on a prebuilt static library shipped along with the CMake project. I would like CMake to build the project by first installing the prebuilt library to the default location (e.g. /usr/local/lib), and only then building the other targets, making ..

Read more

My present goal is compiling, say, the SQLite library (C-language), statically linked with dependencies on Windows with MSVC Build Tools. I want to get a single DLL file, which may only depend on the core Windows/VC components, such as kernel32 or VC runtime. SQLite library has several extensions with external dependencies, for example, Zipfile/zlib or ..

Read more

I just wanted to understand how shared libraries with statically linked libraries are expected to perform. I am writing a shared library (lshared.so) that is statically linked to another library (lstatic). Now, I have another executable helloworld which loads a dynamic version of library lstatic (lstatic.so) and lshared.so as well. Will the static version of ..

Read more

Ahh that infamous error… Here is most of my cmake > get_filename_component(THIRD_PARTY_ROOT ../ ABSOLUTE) set(THIRD_PARTY_ROOT ${THIRD_PARTY_ROOT}/thirdParty) set(TP_SOCKET ${THIRD_PARTY_ROOT}/socket/libOutput) set(TP_SOCKET_LIB ${TP_SOCKET}/lib/sockpp-static.lib) ADD_EXECUTABLE(SOCKET_TEST ${SRC}) set(outputLib ${THIRD_PARTY_ROOT}/libOutput) include_directories(${TP_SOCKET}/include) link_directories(${TP_SOCKET}/lib) target_link_libraries(SOCKET_TEST ${TP_SOCKET_LIB}) Error sockpp-static.lib(socket.obj) : error LNK2019: unresolved external symbol __imp_WSASocketA referenced in function "public: class sockpp::socket __cdecl sockpp::socket::clone(void)const " ([email protected]@[email protected]@[email protected]) What am I doing wrong here, I’m lost. ..

Read more

I’ve C++ based swift static library called: FooCppBasedSwiftLibrary It’s a Swift Static Library which uses some C++ sources mixed with Objective C using .mm files (Objective C++) ObjectiveC++ classes are exposed to Swift(within the same library) using module.private.modulemap file Library on its own builds successfully and generated libFooCppBasedSwiftLibrary.a binary and FooCppBasedSwiftLibrary.swiftmodule file BUILT FOR SIMULATOR ..

Read more

I was trying to build my application with the MySQL jdbc C++ Connector and I came across a very big problem that is making my life hell. I’m trying to build this application with the static libraries (.lib) so I don’t need runtime dependencies. Here’s my CMakeLists.txt file cmake_minimum_required(VERSION 3.17) project(main) set(CMAKE_CXX_STANDARD 20) include_directories(jdbc) link_directories(lib) ..

Read more

Yes, I am insanely stubborn for trying to do this, but here me out. Visual Studio is a slow and clunky mess. Visual Studio Code is an attempt to fix this, but as hard as Microsoft has tried, it’s still slow and clunky, just not as much. Makefiles are confusing and often massive. What have ..

Read more

I’m trying to program in C++ without ever touching Visual Studio, Visual Studio Code, or GNU Make, and I’m having trouble linking a static library. Instead I’ve been using 4coder to write code and RemedyBG to debug. So far, this has worked wonderfully, except the second I try to link a static library. The MSDN ..

Read more