linker

How to compile and link google tests in C++ project in Visual Studio 2013 but with Gtest installed by NuGet Package Manager?

我与影子孤独终老i 提交于 2019-12-22 06:42:17
问题 I have Microsoft Visual Studio 2013 Community Edition on Windows 7. I want to install gtest and gmock for C++ in newer way than downloading headers and binaries or compiling by myself. I found Tools > Nuget Package Manager > Manage Nugets Packages For Solution I chosen Online, then typed gtest. From search results I've found Google Test, so I've installed its for my current project. After the installation the code below compiles: #include <iostream> #include <gtest\gtest.h> using namespace

twisted logic: a global variable in one file refers to an extern variable but is also referred by that extern variable

浪尽此生 提交于 2019-12-22 05:27:13
问题 fileA.cpp: #include <iostream> extern int iA; extern int iB= iA; int main() { std::cout<<iA<<','<<iB; } fileB.cpp extern int iB; extern int iA = 2*iB; Compiled and linked and ran, out come in the debug and release mode is 0,0 My question is how it works, why there is no issue in linking stage? I'm using VC++2003. 回答1: The initialiser overrides the extern keyword, so there's nothing "magical" about this: you're just declaring and defining two completely unrelated variables in different

GNU ld cannot find library which is there

与世无争的帅哥 提交于 2019-12-22 04:24:07
问题 The packages I'm toying with here are rather unknown, but nevertheless the problem is rather generic. Basically, I'm trying to compile Python module (called rql) with C++ extension. The extension uses external framework called gecode, which contains several libraries. I compiled gecode and installed locally. Now, let the output speak for itself: red@devel:~/build/rql-0.23.3$ echo $LD_LIBRARY_PATH /home/red/usr/lib red@devel:~/build/rql-0.23.3$ ls $LD_LIBRARY_PATH | grep libgecodeint

ncurses api with the D Programming Language

≯℡__Kan透↙ 提交于 2019-12-22 03:55:46
问题 I am trying to teach myself AI using neural networks. Long story short, I wanted to create a simple graphic that would display what is happening in my program using ncurses. The tutorial that I am using is found here. I was under the impression that D was compatible with C and I could theoretically call C functions relatively easily. I find that not to be the case. I am a relatively novice programmer, so even the simplistic explanations are a little above my head. I found this here. D is

Compiling GLFW with Visual Studio 2012

天大地大妈咪最大 提交于 2019-12-21 23:29:28
问题 The Issue As apparently many people (including here on Stackoverflow), I have run into some trouble compiling, and specifically linking, my C++ OpenGL code with the GLFW library on Visual Studio (I am using v11.0 AKA 2012 Ultimate). Here is the error list: Error 1 error LNK2019: unresolved external symbol __imp__glfwInit referenced in function _main C:\Users\Dennis\MyOpenGL\OpenGL1\OpenGL1\Main.obj OpenGL1 Error 2 error LNK2019: unresolved external symbol __imp__glfwTerminate referenced in

Linking with libbluetooth.so

会有一股神秘感。 提交于 2019-12-21 20:36:06
问题 On Ubuntu 14.04, I'm trying to do a small example of bluetooth device listing but I'm facing a simple issue about linking with the bluetooth shared library when compiling this minimalistic demo http://people.csail.mit.edu/albert/bluez-intro/c404.html: $ sudo apt-get install libbluetooth-dev $ gcc -lbluetooth simplescan.c -o simplescan /tmp/ccuwRsB5.o: In function `main': simplescan.c:(.text+0x79): undefined reference to `hci_get_route' simplescan.c:(.text+0x8c): undefined reference to `hci

Linking with static library not equivalent to linking with its objects

孤人 提交于 2019-12-21 20:36:05
问题 Problem: The firmware image generated when linking with a static library is different to the firmware image generated when linking with the objects directly extracted from the static library. Both firmware images link without error and load successfully onto the microcontroller. The latter binary (linked with objects) executes successfully and as expected, while the former (linked to the static library) does not. The only warnings during compilation are unused-but-set-variable in the

'inline' for __global__ functions to avoid multiple definition error

旧巷老猫 提交于 2019-12-21 16:58:01
问题 I have a CUDA template library, in which one function is actually not a template, but is defined within a .cuh header. ( vector_add_kernel in kernel.cuh below.) If multiple .cu files include kernel.cuh and call vector_add[_kernel] , it will result in multiple definition errors at link-time. In C++, one can use the inline qualifier to avoid such errors. However, inline __global__ ... - while preventing the multiple definition errors on my system - results in a warning that the inline qualifier

unresolved external symbol due to name mangling

荒凉一梦 提交于 2019-12-21 16:57:14
问题 I am facing linker error for a XERCES function while upgrading it from 2.6 to 2.8 unresolved external symbol (?resolveEntity@HandlerBase@xercesc_2_8@@UAEPAVInputSource@2@QBG0@Z) I checked the xerces-c_2.8.lib and found that name lib is bit different that the one in my .obj file It is as shown ?resolveEntity@HandlerBase@xercesc_2_8@@UAEPAVInputSource@2@QB_W0@Z So I understand that linker wont find the match and throw error. But I am unable to understand why my .obj file contains different

unable to link to fftw3 library

有些话、适合烂在心里 提交于 2019-12-21 13:03:06
问题 I am compiling a test program to test the fftw3 (ver3.3.4). Since it is not installed with root previlidge the command I used is: gcc -lm -L/home/my_name/opt/fftw-3.3.4/lib/ -I/home/my_name/opt/fftw-3.3.4/include/ fftwtest.c where the library is installed in /home/my_name/opt/fftw-3.3.4/ My code is the 1st tutorial on fftw3's website: #include <stdio.h> #include <fftw3.h> int main(){ int n = 10; fftw_complex *in, *out; fftw_plan p; in = (fftw_complex*) fftw_malloc(n*sizeof(fftw_complex)); out