linker-errors

GLEW: Apple Mach-O Linker (Id) Error

我是研究僧i 提交于 2019-12-03 17:13:49
I'm trying to use glew in my Xcode project, but I'm getting this: Apple Mach-O Linker (Id) Error... Undefined symbols for architecture x86_64 I'm using the current version of glew that I downloaded from their sourceforge site . Here's what I did: Install Glew via MacPorts. (in terminal run the command sudo port install glew ) In the Xcode project's build settings add the following: other linker flags: -lGLEW header search paths: /opt/local/include/ library search paths: /opt/local/lib/ You aren't linking with the GLEW library. You will probably have to add the directory, you installed GLES

error LNK2001: unresolved external symbol "private: static class

左心房为你撑大大i 提交于 2019-12-03 17:07:39
问题 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

CUDA __device__ Unresolved extern function [duplicate]

…衆ロ難τιáo~ 提交于 2019-12-03 17:05:05
问题 This question already has an answer here : External calls are not supported - CUDA (1 answer) Closed 4 years ago . 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"

Function already defined error in C++

放肆的年华 提交于 2019-12-03 16:29:28
问题 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

How to redefine malloc() in Linux for use in C++ new

可紊 提交于 2019-12-03 16:22:45
I have a mem_malloc() and mem_free() defined for me and I want to use them to replace the malloc() and free() and consequently C++'s new and delete. I define them as follows: extern "C" { extern void *mem_malloc(size_t); extern void mem_free(void *); void * malloc(size_t size) { return mem_malloc(size); } void free(void *memory) { mem_free(memory); } } However, I get two link errors: [user@machine test]$ g++ -m32 -pthread main.cpp -static libmemnmf-O.a /usr/lib/../lib/libc.a(malloc.o): In function `free': (.text+0x153c): multiple definition of `free' /tmp/ccD2Mgln.o:main.cpp:(.text+0x842):

Pure Virtual Function call from Base Ctor

╄→гoц情女王★ 提交于 2019-12-03 15:16:54
Consider the following sample code: #include <iostream> using namespace std; class base { public: base() { bar(); //Line1 this->bar(); //Line2 base *bptr = this; bptr->bar(); //Line3 ((base*)(this))->bar(); //Line4 } virtual void bar() = 0; }; class derived: base { public: void bar() { cout << "vfunc in derived class\n"; } }; int main() { derived d; } The above code has pure virtual function bar() in base class which is overriden in the derived class. The pure virtual function bar() has no definition in base class. Now focus on Line1 , Line2 , Line3 and Line4 . I understand : Line1 gives

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

◇◆丶佛笑我妖孽 提交于 2019-12-03 13:17:31
问题 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/... 回答1: Go to edit scheme as shown below. then uncheck all other targets except your main target under build tab. 回答2: I recently got this

How to build Boost 1.55 with Visual Studio 2013?

╄→гoц情女王★ 提交于 2019-12-03 12:42:28
I'm trying to build Boost 1.55 with Visual Studio 2013. 1) I tried to use boost-binaries ( boost-binaries ), but Visual Studio wrote about the error, when I tried to compile: error LNK1104: cannot open file 'libboost_serialization-vc120-mt-gd-1_55.lib'. I used boost_1_55_0-msvc-12.0-32.exe or 1.55.0-build2 (boost-binaries). I didn't find that .lib file in the boost_1_55_0\lib32-msvc-12.0 directory. 2) I also tried to use this program BlueGo 0.1.7 ( BlueGo ). It works very smooth, and create all libraries, which I am needed. The problem in that it creates .lib files like this: libboost

Cannot link Boost regex

烂漫一生 提交于 2019-12-03 11:18:39
I am currently trying to compile a Contraction Hierachies implementation by KIT which requires Boost::Regex. The supplied Makefile already makes sure (and I have also double-checked this manually) that g++ is supplied with the -lboost_regex switch. If the library is not installed, g++ will complain. So I installed the library from my package sources and tried compiling again. This time I am getting a huge load of linker errors regarding Boost::Regex. Here is a short excerpt: main.o: In function `boost::re_detail::perl_matcher<__gnu_cxx::__normal_iterator<char const*, std::string>, std:

andEngine Android-Studio linker Error during Build

 ̄綄美尐妖づ 提交于 2019-12-03 07:58:34
I took the source of AndEngine from their git repo, downloaded a fresh AndroidStudio, sdk and ndk,imported it, and tried to creat a simple new empty GameActivity extends BaseGameActivity. But I could not start it, cause I get the following errors: /home/uhu/android-ndk-r9d/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/uhu/AndroidStudioProjects/aaa/andEngine/build/intermediates/ndk/release/obj/local/armeabi-v7a/objs/andengine_shared//home/uhu/AndroidStudioProjects/aaa/andEngine/src/main/jni/src