static-linking

Loading symbol file while linking

a 夏天 提交于 2019-12-25 04:09:44
问题 I am trying to load a symbol file at the time of linking. I am providing the symbol.txt file along with other libraries that I link. These are the two things I tried. 1st, I provided the symbol file exactly as what was the output of arm-none-eabi-nm, but this returned with a syntax error on line 1 itself. 2nd, I changed the format a bit. I added #< SYMDEFS ># at the beginning of the file and made the changes to follow ARM's symdef file format. This gave me the error file not recognized: File

Static Libraries and the statically-linked MSVC++ runtime

*爱你&永不变心* 提交于 2019-12-25 03:23:47
问题 For building a static library , is the static C runtime statically linked at compile time (of the library) or at final EXE compile time? 回答1: According to Hans, the CRT (C Runtime) is not linked while compiling a static LIB using MSVC. It is linked at final EXE compile time. However, even though this is true. You still cannot mix C runtimes in static libraries. They all must use the same exact runtime (or the system runtime MSVCRT.dll) 来源: https://stackoverflow.com/questions/9578388/static

Static library of libcurl on windows [duplicate]

喜夏-厌秋 提交于 2019-12-25 02:33:09
问题 This question already has answers here : using libcurl without dll (2 answers) Closed 5 years ago . How to link this library libcurl statically to the exe? i have tried --disable-share --enable-static that does not help. I am using MingW32 Is there an easy way to statically link this library so i can have no more .dlls with my app? 回答1: If using codeblocks, right click your project and press properties then on the defines tab, add: CURL_STATICLIB if using command line then: -static -static

Compile C++ with static lib

a 夏天 提交于 2019-12-25 02:11:55
问题 this will probably a dumb question for you guy's but I have no experience in C++ what so ever. I'm using an open source project osrm (which is awesome). Still to request a route, you have make an http request. To reduce the running time, I would like to build a wrapper around the code and call it using the command line. So I googled a bit and found that osrm already creates a static lib (.a file) when compiling the project. I also found a piece of code that points me in the right directions

Static linking of OpenSSL Crypto in CMake

为君一笑 提交于 2019-12-24 18:49:33
问题 I need to make a cross-compiled OpenSSL for a MIPS device. I've tried following the documentation. Set OPENSSL_USE_STATIC_LIBS to true and set target_link_libraries to the library files you need. CMakeLists.txt: compileAsC99() if(NOT ${use_http}) message(FATAL_ERROR "program being generated without HTTP support") endif() set(program_c_files ... ) set(program_h_files ... ) include_directories(...) add_executable(program ${program_c_files} ${program_h_files}) set(OPENSSL_USE_STATIC_LIBS TRUE)

OSX Golang static compile, and installing gccgo

不羁岁月 提交于 2019-12-24 12:09:01
问题 To outline my end goal. I want to compile a go application, statically linking to QT5. I have statically compiled QT5. Now I need to compile my Go program. As I understand it to do this, I have to use gccgo rather than the gc compiler. Fine. So first I have to install the gccgo compiler, which is gcc with the go language enabled in config. I have followed this: https://golang.org/doc/install/gccgo and this seperately: https://solarianprogrammer.com/2016/05/10/compiling-gcc-6-mac-os-x/ to see

Linking boost_1_55_0 asio

倖福魔咒の 提交于 2019-12-24 12:05:52
问题 I'm using this in my makefile to build my program: all: server.cpp g++ -o server server.cpp -I ~/boost/include -L~/boost/lib -Wl,-rpath,~/boost/lib -lboost_system -lboost_thread -DBOOST_ALL_NO_LIB=1 When I compile I get these warnings: /usr/bin/ld: warning: libboost_system.so.1.53.0, needed by /usr/local/lib/libboost_thread.so, may conflict with libboost_system.so.5 When I run my program I receive the warning : ./server: error while loading shared libraries: libboost_thread.so.1.53.0: cannot

How to use shell32.dll from C++ console application

做~自己de王妃 提交于 2019-12-24 10:47:49
问题 What I need to do is to get ApplicationData path , I've found in Google that there is function called HRESULT SHGetFolderPath( __in HWND hwndOwner, __in int nFolder, __in HANDLE hToken, __in DWORD dwFlags, __out LPTSTR pszPath ); But it exists in shell32.dll In C# I'd do something like [DllImport] static extern HRESULT SHGetFolderPath() and so on. What do I need to do in C++ Console application, to be able to call this API? Maybe, I can use LoadLibrary() ? But what is the right way to do this

Unresolved external symbol when linking my library

血红的双手。 提交于 2019-12-24 09:59:57
问题 I've compiled my own library file(.lib) with VS2010, but when I try to reference it like #pragma comment(lib,"path/to/lib.lib") I keep getting unresolved external symbols...What am I doing wrong? the #pragma comment(lib, "*.lib") worked for any library so far, and I also tried linking it under settings, no succes. 回答1: 1) Open a VS command console (Tools/Visual Studio Command Prompt). 2) Use cd command to change to the directory containing the library in question. 3) Enter: dumpbin /all my

Unable to link against BFD [duplicate]

假装没事ソ 提交于 2019-12-24 07:26:32
问题 This question already has answers here : Trying to include a library, but keep getting 'undefined reference to' messages (3 answers) Closed 5 years ago . I am trying to include this file in my project: http://cairo.sourcearchive.com/documentation/1.9.4/backtrace-symbols_8c-source.html But it requires linking against BFD. I have both binutils and binutils-devel installed. I have tried linking with -lbfd as well as directly to /usr/lib64/libbfd.so and /usr/lib64/libbfd.a (which both do exist).