linker-errors

CUDA __device__ Unresolved extern function [duplicate]

廉价感情. 提交于 2019-12-03 06:04:33
This question already has an answer here: External calls are not supported - CUDA 1 answer I am trying to understand how to decouple CUDA __device__ codes in separate header files. I have three files. File: 1: int2.cuh #ifndef INT2_H_ #define INT2_H_ #include "cuda.h" #include "cuda_runtime.h" #include "device_launch_parameters.h" __global__ void kernel(); __device__ int k2(int k); int launchKernel(int dim); #endif /* INT2_H_ */ File 2: int2.cu #include "int2.cuh" #include "cstdio" __global__ void kernel() { int tid = threadIdx.x; printf("%d\n", k2(tid)); } __device__ int k2(int i) { return i

Xcode gives Apple Mach-O linker error

China☆狼群 提交于 2019-12-03 05:41:56
问题 I just compiled a project and Xcode returns these two errors which don't seem to be my code's fault. How do I fix them? Undefined symbols for architecture i386: "_vImageBoxConvolve_ARGB8888", referenced from: -[UIImage(Blur) boxblurImageWithBlur:] in UIImage+Blur.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 回答1: Teaching a man (or women) how to fish: Usually Mach-O Linker Error means you have not included a

Function already defined error in C++

一世执手 提交于 2019-12-03 05:39:37
I have a file called "SimpleFunctions.h" defined as follow: #ifndef SIMPLEFUNCTIONS_H #define SIMPLEFUNCTIONS_H namespace my_namespace { double round(double r) { return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5); } float round(float r) { return round((double)r); } } #endif // SIMPLEFUNCTIONS_H This file was previously included in only one file and it was working fine. Now today I have included it in a second file and it no longer works. At link time, it tells me that the function is already defined in "firstfile.obj". However, since I am using include guards, I would expect the functions to be

error LNK2001: unresolved external symbol \"private: static class

拈花ヽ惹草 提交于 2019-12-03 05:24:22
error LNK2001: unresolved external symbol "private: static class irrklang::ISoundEngine * GameEngine::Sound::_soundDevice" (?_soundDevice@Sound@GameEngine@@0PAVISoundEngine@irrklang@@A) I cannot figure out why i am receiving this error. I believe i am initializing correctly. Can anyone lend a hand? sound.h class Sound { private: static irrklang::ISoundEngine* _soundDevice; public: Sound(); ~Sound(); //getter and setter for _soundDevice irrklang::ISoundEngine* getSoundDevice() { return _soundDevice; } // void setSoundDevice(irrklang::ISoundEngine* value) { _soundDevice = value; } static bool

Linker errors in Android NDK (undefined reference to `__cxa_end_cleanup')

让人想犯罪 __ 提交于 2019-12-03 04:54:50
I'm getting this output after adding in a set of code from a colleague: ./obj/local/armeabi/objs/jniWrapper/native.o: In function `_Vector_base': D:/opt/android-ndk/sources/cxx-stl/stlport/stlport/stl/_vector.h:73: undefined reference to `__cxa_end_cleanup' ./obj/local/armeabi/objs/jniWrapper/native.o:(.ARM.extab.text._ZNSt6vectorIhSaIhEEC1ERKS1_[std::vector<unsigned char, std::allocator<unsigned char> >::vector(std::vector<unsigned char, std::allocator<unsigned char> > const&)]+0x0): undefined reference to `__gxx_personality_v0' ./obj/local/armeabi/objs/jniWrapper/native.o: In function `std::

'ld: file not found' after changing product name in Xcode

杀马特。学长 韩版系。学妹 提交于 2019-12-03 03:42:56
I was working on my application and i started out with a really bad name. So i decided to change it. I did that like this. At the top right corner i simply changed the name to what i want. and then i started getting the error as you can see there. Reveal in Log shows these details: The main error says: ld: file not found: /Users/.../XCode/DerivedData/... Go to edit scheme as shown below. then uncheck all other targets except your main target under build tab. I recently got this error under different circumstances. Running Ionic, updating my ios platform from 3.8.0 to 4.0.1 I discovered this

Using GNU Scientific Library (GSL) under Windows x64 with MinGW

冷暖自知 提交于 2019-12-03 02:51:28
I have installed MinGW and MSYS on Microsoft Windows (64bit), inside directory C:\MinGW (MSYS directory is C:\MinGW\msys\1.0 ). I have downloaded the latest GNU Scientific Library ( GNU GSL ) package from the official ftp . I have used MSYS to perform configure and make successfully as described in the INSTALL file in the GSL package. That means, in the MSYS command-line interface, in the MSYS home directory, I have inserted: $ ./configure $ make $ make install This produces a local directory under the MSYS directory ( C:\MinGW\msys\1.0 ) including the directories bin , include , lib , and

Cannot add embedded binaries (other projects) to project dependencies in XCode

守給你的承諾、 提交于 2019-12-03 01:48:36
I have an XCode workspace created with XCode 6.0.1. It constains 2 (Swift) libraries and one iOS app (Swift) that depends on those 2 libraries. I had stable setup that allowed me to run the iOS app on both iPhone and simulators: The 2 library projects were added as Embedded Binaries (see picture) of the app. Now, I have XCode 6.1. Recently, I deleted DerivedData folder in ~/Library/Developer/Xcode folder while XCode was running. After that my workspace did not work - the iOS app would fail to compile and I got linker error saying it cannot find the library projects. I tried to solve it by

Why doesn't this “undefined extern variable” result in a linker error in C++17?

删除回忆录丶 提交于 2019-12-03 00:58:49
I have compiled and ran the following program in a C++17 compiler (Coliru). In the program, I declared an extern variable, but did not define it. However, the compiler doesn't give a linker error . #include <iostream> extern int i; // Only declaration int func() { if constexpr (true) return 0; else if (i) return i; else return -1; } int main() { int ret = func(); std::cout<<"Ret : "<<ret<<std::endl; } Why doesn't the compiler give a linker error? Because the variable isn't odr-used. You have a constexpr if there that always discards the branch that could use it. One of the points of constexpr

How to link C++ object files with ld

筅森魡賤 提交于 2019-12-02 21:52:33
I'm trying to link the output of C++ using ld and not g++. I'm only doing this to learn how to do it, not for practical purposes, so please don't suggest just to do it with g++. Looking at this question , the person gets the same error when they run the ld command: $ ld test.o -o test.out ld: warning: cannot find entry symbol _start; defaulting to 00000000004000e8 test.o: In function `main': test.cpp:(.text+0x1c): undefined reference to `strcasecmp' test.cpp:(.text+0x23): undefined reference to `std::cout' test.cpp:(.text+0x28): undefined reference to `std::ostream::operator<<(int)' test.cpp:(