linker-errors

Cuda C - Linker error - undefined reference

血红的双手。 提交于 2019-11-26 22:42:49
I am having a hard time compiling a simple cuda program consiting of only two files. The main.c looks like this: #include "my_cuda.h" int main(int argc, char** argv){ dummy_gpu(); } The cuda.h looks like this: #ifndef MY_DUMMY #define MY_DUMMY void dummy_gpu(); #endif And the my_cuda.cu file loos like this: #include <cuda_runtime.h> #include "my_cuda.h" __global__ void dummy_gpu_kernel(){ //do something } void dummy_gpu(){ dummy_gpu_kernel<<<128,128>>>(); } However if I compile I allways receive the following error: gcc -I/usr/local/cuda/5.0.35/include/ -c main.c nvcc -c my_cuda.cu gcc -L/usr

How do I specify, which version of boost library to link to?

﹥>﹥吖頭↗ 提交于 2019-11-26 21:34:51
问题 I'm trying to migrate a project written in VS2012 to VS2013. I successfully compiled boost 1.53.0 (I first tried 1.54.0, but got some compiler errors) and got libraries like libboost_filesystem-vc120-mt-1_53.lib . But when trying to build my project, the linker complains: error LNK1104: cannot open file 'libboost_filesystem-vc110-mt-1_53.lib' I've been looking for some project settings in my entire solution to find out, why it's trying to load the older library version, but I didn't find

Using pthread in c++

孤街醉人 提交于 2019-11-26 21:17:57
问题 I am using pthread.h in a *.cc file. when I try to use pthread_exit(0); or pthread_join(mythrds[yy],NULL); it says: .cc:(.text+0x3e): undefined reference to `pthread_exit' when complied very similar code in a *.c file with gcc it work perfect. How Can I use pthread's in c++.. (I also added -lpthread) .. void *myThreads ( void *ptr ) { ... pthread_exit(0); } .. flags: g++ -lpthread -Wall -static -W -O9 -funroll-all-loops -finline -ffast-math 回答1: You might try using the -pthread option to g++.

Linking files in g++

橙三吉。 提交于 2019-11-26 20:57:34
问题 Recently I have tried to compile a program in g++ (on Ubuntu). Usually i use Dev-C++ (on Windows) and it works fine there as long as I make a project and put all the necessary files in there. The error that occurs when compiling the program is: $filename.cpp: undefined reference to '[Class]::[Class Member Function]' The files used are as following: The source code (.cpp) file with the main function. The header file with the function prototypes. The .cpp file with the definitions for each

Inline function “undefined symbols” error

橙三吉。 提交于 2019-11-26 20:50:17
问题 I want to write an inline function, but I get an error. How can I fix it? Error information: Undefined symbols for architecture i386: "_XYInRect", referenced from: -[BeginAnimation ccTouchesEnded:withEvent:] in BeginAnimation.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) Code: CGPoint location = CGPointMake(60, 350); if (XYInRect(location, 53, 338, 263, 369)) { } inline BOOL XYInRect(CGPoint location, float MixX

Calling C++ method from Objective C

落花浮王杯 提交于 2019-11-26 19:31:46
问题 I have the following files. foo.h (C++ header file) foo.mm (C++ file) test_viewcontroller.h (objective c header file) test_viewcontroller.m (Objective c file) I have declared a method donothing() in foo.h and defined it in foo.mm.Lets say it is double donothing(double a) { return a; } Now,I try to call this function in test_viewcontroller.m double var = donothing(somevar); I get linker error which says "cannot find symbols" _donothing() in test_viewcontroller.o collect2: ld returned 1 exit

STD linker error with Apple LLVM 4.1

拜拜、爱过 提交于 2019-11-26 19:24:49
问题 I've got a large static library in C++ with bits of Objective-C originally built for iOS (armv7). I built a OS X (64-bit Intel x86_64) version of it, but as soon as I tried to use it in a OS X app project (targeted to Lion 10.7), tens of linker errors appeared, most of them about standard library symbols. I know how to solve "my" linker problems, but the STD ones copied below are bugging me. "std::basic_filebuf<char, std::char_traits<char> >::is_open() const" "std::basic_stringbuf<char, std:

Link error while building a unit test target

ε祈祈猫儿з 提交于 2019-11-26 19:05:43
问题 I have a XCode4 / iOS project with a regular target and unit test target. Everything works fine, except when I try to #import one of my classes in my test class and try to use it. If I try to build the unit test target, I get the following link error: Undefined symbols for architecture i386: "_OBJC_CLASS_$_FRRCategory", referenced from: objc-class-ref in CategoryTests.o ld: symbol(s) not found for architecture i386 collect2: ld returned 1 exit status In CategoryTests.m I'm importing the

dyld: Symbol not found: error how to resolve this issue

百般思念 提交于 2019-11-26 17:49:42
问题 I have the following code (given below) where I am using NSURLConnection for connecting and parsing the response string. But I am getting the following error: dyld: Symbol not found: _CFXMLNodeGetInfoPtr Referenced from: /System/Library/Frameworks/Security.framework/Versions/A/Security Expected in: /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk/System/Library/Frameworks/CoreFoundation.framework/CoreFoundation in /System/Library/Frameworks/Security

Multiple definition of inline functions when linking static libs

谁说胖子不能爱 提交于 2019-11-26 17:28:03
问题 I have a C++ program that I compile with mingw (gcc for Windows). Using the TDM release of mingw which includes gcc 4.4.1. The executable links to two static library (.a) files: On of them is a third-party library written in C; the other is a C++ library, written by me, that uses the C library provides my own C++ API on top. An (in my view, excessive) portion of the C library's functionality is implemented in inline functions. You can't avoid including the inline functions when you use the C