linker

Installing OpenCV in Visual Studio 2012

牧云@^-^@ 提交于 2020-02-03 10:38:09
问题 Im trying to install OpenCV to work with Visual Studio. I'm using the 2012Pro version but I think it should be the same as vs10. I was following this tutorial: http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to I have A Solution with only one Project And with only one file. For testing purposes I used the same code as in the tutorial. // Video Image PSNR and SSIM #include <iostream> // for standard I/O

How mavericks/xcode5.0.1 changed the compiler and linker?

老子叫甜甜 提交于 2020-02-02 13:38:50
问题 I upgraded a system from 10.8 to 10.9 and correspondingly for xcode from 5.0 to 5.0.1. I'm rewarded when I try to run a part of my build that combines multiple .a files into a single, larger, shared lib: Undefined symbols for architecture x86_64: "__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm", referenced from: __ZN2bt3fst12FstLookupSet14loadFromStringERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_ in libbtfst.a(bt_fst_factory.o)

How mavericks/xcode5.0.1 changed the compiler and linker?

▼魔方 西西 提交于 2020-02-02 13:38:47
问题 I upgraded a system from 10.8 to 10.9 and correspondingly for xcode from 5.0 to 5.0.1. I'm rewarded when I try to run a part of my build that combines multiple .a files into a single, larger, shared lib: Undefined symbols for architecture x86_64: "__ZNKSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE13find_first_ofEPKcmm", referenced from: __ZN2bt3fst12FstLookupSet14loadFromStringERKNSt3__112basic_stringIcNS2_11char_traitsIcEENS2_9allocatorIcEEEESA_ in libbtfst.a(bt_fst_factory.o)

How to share a global variable between a main process and a dynamic library via a static library (macOS)?

牧云@^-^@ 提交于 2020-02-02 10:14:02
问题 My question seems to be similar to this question however in my case the shared variable is in a static library and also the advice from this question didn't help me: Sharing global data between a shared library and main. Along the way I saw the issues from this question but no final solution either: OS X linker unable to find symbols from a C file which only contains variables. I am trying to make my main process and a dynamic library that it dlopen 's to share the global variable SHARED

How to share a global variable between a main process and a dynamic library via a static library (macOS)?

心已入冬 提交于 2020-02-02 10:13:30
问题 My question seems to be similar to this question however in my case the shared variable is in a static library and also the advice from this question didn't help me: Sharing global data between a shared library and main. Along the way I saw the issues from this question but no final solution either: OS X linker unable to find symbols from a C file which only contains variables. I am trying to make my main process and a dynamic library that it dlopen 's to share the global variable SHARED

How to I find the filename of a library via the library name?

╄→尐↘猪︶ㄣ 提交于 2020-01-31 04:44:04
问题 How to I find the filename of a library via the library name? In otherwords, when I use "-lc", I know it is /lib/libc.so.6 (or something similar.) I want to be able to type some command where "-lc" is the input and "/lib/libc.so.6" is the output. To extend this idea futher, I wanted to specify my own search path so I can use this library resolver for different toolchains... Any help would be awesome, Thanks Chenz 回答1: If you want to find out where a given GCC will find libc.a or libc.so, do

netdb.h not linking properly

微笑、不失礼 提交于 2020-01-31 03:27:17
问题 I'm trying to compile this program, as referenced in Beej's Guide to Network Programming on page 19. #include <stdio.h> #include <netdb.h> #include <sys/types.h> #include <sys/socket.h> int main() { int status; struct addrinfo hints; struct addrinfo *servinfo; /* Will point to the results */ memset(&hints, 0, sizeof hints); /* Make sure the struct is empty */ hints.ai_family = AF_UNSPEC; /* Don't care IPv4 or IPv6 */ hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_PASSIVE; if ((status =

Weak symbol aliases on OS X similar to those on Linux, or a closest equivalent?

纵然是瞬间 提交于 2020-01-31 00:54:26
问题 What I do When writing shared libraries for Linux, I tend to pay attention to relocations, symbol visibility, GOT/PLT etc. When applicable, I am trying to avoid calling PLT stubs when functions from the same library call each other. For example, let's say a shared object provides two public functions - foo() and bar() (either of those can be called by user). The bar() function, however, also calls foo() . So what I do in this case is this: Define _foo() and _bar() functions that have private

MinGW, build GUI application with console

戏子无情 提交于 2020-01-30 19:28:01
问题 I'm using MinGW to build my application on Windows. When compiling and linking, the option "-mwindows" is put in command line to have Win32 API functions. To be more specific: when calling GCC of MinGW without "-mwindows" like this: c:\>g++ -c main.cpp c:\>g++ -o main.exe main.o The 'main.exe' after the 2 command lines above will run with a console, and Win32 API functions won't be usable. When calling GCC of MinGW with "-mwindows" like this: c:\>g++ -c main.cpp c:\>g++ -o main.exe main.o

howto add a static library (.a) into a C++ program?

大憨熊 提交于 2020-01-30 04:12:17
问题 i want to know how i can use a static library in C++ which i created, first the lib: // header: foo.h int foo(int a); . // code: foo.cpp #include foo.h int foo(int a) { return a+1; } then i compile the library first: g++ foo.cpp ar rc libfoo.a foo.o now i want to use these library in some file like: // prog.cpp #include "foo.h" int main() { int i = foo(2); return i; } how must i compile these now? i made: g++ -L. -lfoo prog.cpp but get an error because the function foo would not be found 回答1: