linker-errors

c++ linker error: undefined references only on optimized build

廉价感情. 提交于 2019-12-01 09:21:50
I'm getting an undefined references linker error only when linking optimized objects files, not when linking unoptimized object files. I don't understand what the problem is or could be. Here is my unoptimized build: Building file: ../COMPASS.cpp Invoking: GCC C++ Compiler g++ -O0 -g3 -pg -Wall -c -fmessage-length=0 -Wno-sign-compare -fopenmp -MMD -MP -MF"COMPASS.d" -MT"COMPASS.d" -o"COMPASS.o" "../COMPASS.cpp" Finished building: ../COMPASS.cpp Building file: ../PSA.cpp Invoking: GCC C++ Compiler g++ -O0 -g3 -pg -Wall -c -fmessage-length=0 -Wno-sign-compare -fopenmp -MMD -MP -MF"PSA.d" -MT"PSA

Linking of CUDA library in CMake

浪尽此生 提交于 2019-12-01 08:19:04
I am using CMake 3.10 and have a problem linking a compiled library to a test executable in CMake. I searched a lot and found that in earlier versions there was a problem where you could not link intermediate libraries in the result executable. I was not able to tell if this was resolved or still an issue. My CMake files look like this: Algo: cmake_minimum_required (VERSION 3.9) project(${MODULE_NAME}_core LANGUAGES CXX CUDA) add_subdirectory("${core_impl_dir}" implementation) set(cuda_src "parallel/ParallelComputation.cu") set(cuda_hdr "parallel/ParallelComputation.h") add_library(${PROJECT

Boost::system link error on Ubuntu

試著忘記壹切 提交于 2019-12-01 08:04:55
问题 I'm trying to compile the following c++ code that implements Context Tree Switching (More info on the download page): Zip archive, 0.2 MB which requires some boost libraries. I download the latest version from boost.org and built all libraries that needed building following the instructions on the website. I also modified the makefile included in the archive to add the boost lib path and boost_system, but I still get an error. Here's the makefile i'm using: PROGRAM = cts SOURCES = $(wildcard

Linking of CUDA library in CMake

一曲冷凌霜 提交于 2019-12-01 06:46:08
问题 I am using CMake 3.10 and have a problem linking a compiled library to a test executable in CMake. I searched a lot and found that in earlier versions there was a problem where you could not link intermediate libraries in the result executable. I was not able to tell if this was resolved or still an issue. My CMake files look like this: Algo: cmake_minimum_required (VERSION 3.9) project(${MODULE_NAME}_core LANGUAGES CXX CUDA) add_subdirectory("${core_impl_dir}" implementation) set(cuda_src

XCode does not build Unity3D Project: lib not found

天大地大妈咪最大 提交于 2019-12-01 06:10:05
I have Unity3D project and I built it for iOS. If I run it using XCode's simulator it works fine. But if I want to compile it for "iOS Device" or for a physical device connected to my Mac, I get lots of errors and as a result I can't create an Archive. For a testing purpose, I even created an empty Unity3D project, built it for iOS and still get the same errors, although this project does absolutely nothing. The errors are the following: ld: library not found for -liPhone-lib clang: error: linker command failed with exit code 1 (use -v to see invocation) And these are the settings I use:

undefined reference to vtable for …

余生长醉 提交于 2019-12-01 05:54:40
I am trying to write an Http proxy that basically works like indianwebproxy So i fired up qtcreator and but one of my classes is failing to compile with the infamous error : undefined reference to vtable for HttpProxyThreadBrowser . I can't figure out why its doing this. I read through similar questions on Stackoverflow and apparently the problem is with undefined virtual methods that are not pure But i have not declared any virtual functions. Here is my class class HttpProxyThreadBrowser : public QThread { public: HttpProxyThreadBrowser(QTcpSocket outgoingSocket,QTcpSocket browserSocket

illegal text reloc to non_lazy_ptr error while building in xcode 4 with libav* libraries

不打扰是莪最后的温柔 提交于 2019-12-01 05:46:33
问题 I'm trying to build a simple application that uses ffmpeg's libav* libraries in xcode 4 and getting the following error: ld: illegal text reloc to non_lazy_ptr from /ffmpeg/temp/ffmpeg-0.8/builduni/lib/libavcodec.a(ac3.o) in _ff_ac3_bit_alloc_calc_psd for architecture i386 I've already tried to run ranlib -c libavcodec.a to fix this problem, but nothing happend. One more thing: my libav* libraries are fat binaries (i386 + x86_64). Any ideas what can it be? 回答1: I have the same error. Finally,

how to ignore LNK2005 & LNK1169?

青春壹個敷衍的年華 提交于 2019-12-01 05:23:39
So I have a Visual Studio 2010 project that uses external libraries and in order to get it compile without LNK2005 I had to juggle arround with the order of the libraries in the linker settings. I got it to compile fine in release mode, but for whatever reasons I don't manage to get it to compile without LNK errors in debug. Is there no way to generally ignore LNK2005 and tell the linker to simply use whatever he encounters first? Thanks! //edit: here are some of the errors output of the PARTICULAR problem. however I already tried to solve that in different ways with each solution giving me

RC2247 : Cannot open Rc file : Resource explorer cannot load resource ; Load failed

本秂侑毒 提交于 2019-12-01 05:12:16
I have a win 32 project I'm working on and the resource file were working fine till yesterday. Now when I try to open the resource file to edit, it crashes and gives me the following error: C://program files/Microsoft SDKs/Windows/v6.0A/include/prsht.h(0) error RC2247: Symbol name too long Can anybody tell me where I might be going wrong or where to look into. The rc file is a very simple dialog box with a static text and a progress bar. I had the error as well. The approach mentioned in the http://social.msdn.microsoft.com/Forums/{...} Link (in a comment from Michael Walz) should work. Here's

undefined reference to `crypt'

一笑奈何 提交于 2019-12-01 03:49:41
I am using the below code that i found somewhere in the net and i am getting an error when i try to build it. The compilation is ok. Here is the error: /tmp/ccCnp11F.o: In function `main': crypt.c:(.text+0xf1): undefined reference to `crypt' collect2: ld returned 1 exit status and here is the code: #include <stdio.h> #include <time.h> #include <unistd.h> #include <crypt.h> int main() { unsigned long seed[2]; char salt[] = "$1$........"; const char *const seedchars = "./0123456789ABCDEFGHIJKLMNOPQRST" "UVWXYZabcdefghijklmnopqrstuvwxyz"; char *password; int i; /* Generate a (not very) random