linker-errors

undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5

时光怂恿深爱的人放手 提交于 2019-12-04 01:31:14
I'm trying to make a file in Ubuntu and when i make i keep getting this error: /usr/bin/ld: ../../gtest-1.7.0/libgtest.a(gtest-all.cc.o): undefined reference to symbol 'pthread_key_delete@@GLIBC_2.2.5' /lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line collect2: error: ld returned 1 exit status make[2]: *** [src/tests/run_tests] Error 1 make[1]: *** [src/tests/CMakeFiles/run_tests.dir/all] Error 2 make: *** [all] Error 2 I saw someone mentioning to go into Makefile and adding '-L /lib64 -l pthread' to the variable LDFLAGS but how do you do that? Totally

Mingw x64 Windows: plugin needed to handle lto object

北城以北 提交于 2019-12-04 01:28:23
When I'm trying to compile my project with 64-bit mingw (x86_64-5.1.0-posix-seh-rt_v4-rev0) I got messages: BFD: my/project/dir/filename.cpp.obj: plugin needed to handle lto object for each source file. Yet when I compile with 32-bit mingw(i686-5.1.0-posix-dwarf-rt_v4-rev0), everething is OK. My flags are: CXX_FLAGS "-fno-exceptions -fno-rtti -std=c++14 -O3 -fstrict-aliasing -flto -fomit-frame-pointer -march=native -ffast-math -funroll-loops" LINKER_FLAGS "-O1 -s" I tried to add -fuse-linker-plugin and -fno-use-linker-plugin, but it didn't help. My OS is 64-bit Windows 10. I use CLion and

Visual Studio 2012 link errors with static libraries

﹥>﹥吖頭↗ 提交于 2019-12-04 00:18:25
I recently upgrade to 2012 from 2005 (I'm pretty sure) and ran into link errors when building my solution. I ran out of ideas after hours of searching google and putsing around. I've set up dozens of projects, so I'm pretty certain I've done everything right, but to be fair, it's been a few years. So, as a test I set up a new project. I called it App, a Windows application (.exe). I created a second project called Core and flagged it as a static library (.lib) in it's Configuration Type. Both are a part of the solution. In Core I added Test.cpp and Test.h which contain a small class that has a

Is there a way to detect inline function ODR violations?

天大地大妈咪最大 提交于 2019-12-04 00:04:20
So I have this code in 2 separate translation units: // a.cpp #include <stdio.h> inline int func() { return 5; } int proxy(); int main() { printf("%d", func() + proxy()); } // b.cpp inline int func() { return 6; } int proxy() { return func(); } When compiled normally the result is 10 . When compiled with -O3 (inlining on) I get 11 . I have clearly done an ODR violation for func() . It showed up when I started merging sources of different dll's into fewer dll's. I have tried: GCC 5.1 -Wodr (which requires -flto ) gold linker with -detect-odr-violations setting ASAN_OPTIONS=detect_odr_violation

ld: undefined reference to symbol 'log2@@GLIBC_2.2.5'

徘徊边缘 提交于 2019-12-04 00:03:07
Whats wrong with for (level = 1; level <= log2((double)size); level++) ^ Seems like its from using log2() but whats wrong? I am using it with OpenMPI code actually, but commenting this line fixes things. Full Source ( http://pastie.org/7559178 ) see line 40 [jiewmeng@JM Assign3]$ mpicc -o cpi cpi.c && mpirun -np 16 cpi /usr/bin/ld: /tmp/cca9x4he.o: undefined reference to symbol 'log2@@GLIBC_2.2.5' /usr/bin/ld: note: 'log2@@GLIBC_2.2.5' is defined in DSO /usr/lib/libm.so.6 so try adding it to the linker command line /usr/lib/libm.so.6: could not read symbols: Invalid operation collect2: error:

Apple Mach -O Linker command failed

∥☆過路亽.° 提交于 2019-12-03 23:15:41
问题 After updating my POD install, Xcode sprouted a new issue: 回答1: Make sure you open the .xcworkspace file rather than the project file ( .xcodeproj ) when working with pods. That should solve the issue with linking. 回答2: Some times you need just clean build. It helped me. To clean build go Product -> Clean 回答3: There are several cases that cause this issue. At the moment, this question has no any accepted answer and also I found another solution for the same issue, I am posting my answer

undefined reference to `typeinfo for class' [duplicate]

余生长醉 提交于 2019-12-03 22:49:33
This question already has answers here : Closed 7 years ago . Possible Duplicate: g++ undefined reference to typeinfo Undefined symbols “vtable for …” and “typeinfo for…”? I can't use my class. class Accel { public: virtual void initialize(void); virtual void measure(void); virtual void calibrate(void); virtual const int getFlightData(byte); }; class Accel_ad : public Accel { public: Accel_ad() : Accel(){} void initialize(void) {/*code code code...*/} void measure(void) {/*measure code*/} const int getFlightData(byte axis){/*getting data*/} void calibrate(void) { int findZero[FINDZERO]; int

LNK2001 and LNK2019 errors - DirectX unresolved external symbols

元气小坏坏 提交于 2019-12-03 21:03:45
I am following along with the book "Introduction to 3D Game Programming with DirectX11" by Frank D. Luna. And I am getting these errors when I try and build my project. >BoxDemo.obj : error LNK2019: unresolved external symbol _D3DX11CompileFromFileW@44 referenced in function "private: void __thiscall BoxApp::BuildFX(void)" (?BuildFX@BoxApp@@AAEXXZ) >BoxDemo.obj : error LNK2019: unresolved external symbol _D3DX11CreateEffectFromMemory@20 referenced in function "private: void __thiscall BoxApp::BuildFX(void)" (?BuildFX@BoxApp@@AAEXXZ) >BoxDemo.obj : error LNK2019: unresolved external symbol

fftw in Visual Studio?

a 夏天 提交于 2019-12-03 19:39:01
I'm trying to link my project with fftw and so far, I've gotten it to compile, but not link. As the site said, I generated all the .lib files (even though I'm only using double precision), and copied them to C:\Program Files\Microsoft Visual Studio 9.0\VC\lib , the .h file to C:\Program Files\Microsoft Visual Studio 9.0\VC\include and the .dll to C:\windows\system32 . I've copied the tutorial program, and the exact error I am getting is: 1>hw10.obj : error LNK2019: unresolved external symbol __imp__fftw_free referenced in function "bool __cdecl test(void)" (?test@@YA_NXZ) 1>hw10.obj : error

Duplicate Symbol _OBJC_CLASS_$_LoginController

◇◆丶佛笑我妖孽 提交于 2019-12-03 17:37:08
问题 I know this Question has been asked many times before, but none has solved my problem uptill now. I know that this error occurs when you got multiple copies of your file in project. I tried to clean the build, delete any LoginController.m file in Compile Sources and then build. Fine - no errors. When I added my LoginController.m file in Complie resources, compiler again gave the same error. Next I what I tried is delete all .m files from Compile Sources, clean and rebuild successfully, and