linker-errors

Why am I getting a Linker error with template function pointer?

筅森魡賤 提交于 2019-12-02 07:10:47
I have a class EventMgr which has a template function to register a listener. But, when I register a listener, linker gives me a " error LNK2019: unresolved external symbol ". Appetizer code: class EventMgr { template< class T, class EvenT> void RegisterListener(T* listener, int EventType, void (T::*MemFunc)(EvenT*) ); } SoundMgr(which is a listener) tries to register for event: SoundMgr::SoundMgr(void) { EventManager::GetInstance()->RegisterListener(this, 1, (&SoundMgr::handleBulletFired)); } I'm not sure why it won't link. Why can it not find the reference types ? If you simply declared the

Why am I getting a Linker error with template function pointer?

送分小仙女□ 提交于 2019-12-02 06:40:56
问题 I have a class EventMgr which has a template function to register a listener. But, when I register a listener, linker gives me a " error LNK2019: unresolved external symbol ". Appetizer code: class EventMgr { template< class T, class EvenT> void RegisterListener(T* listener, int EventType, void (T::*MemFunc)(EvenT*) ); } SoundMgr(which is a listener) tries to register for event: SoundMgr::SoundMgr(void) { EventManager::GetInstance()->RegisterListener(this, 1, (&SoundMgr::handleBulletFired));

Accesing global variable giving linker error in objective C

房东的猫 提交于 2019-12-02 06:37:35
问题 I have declared a global variable like below extern NSString *name; @interface viewcontrollerOne{} in implementation file i am accessing that global variable in some method like -(void)someMethod { name = @"hello"; } but this is giving linker error. "name", referenced from: -[viewcontrollerOne someMethod] in viewcontrollerOne.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) 回答1: The following is merely a

duplicate symbol linker error due to libWeANDSFLibrary.a(ASIReachability.o)

我与影子孤独终老i 提交于 2019-12-02 06:23:07
问题 I am using ASI ( ASIHTTPRequest , ASIDownloadCache , Reachability etc) request. Now in my project, I am using reachability.h and .m file.I have added one third party library and in that library I came to know that they are also using ASI library. But as per my knowledge they are using ASIReachability class instead of Reachability . So I added that .h file as well. Still I am getting linker error which says : duplicate symbol _kInternetConnection in: /Users/goutham.v/Library/Developer/Xcode

iPhone library: file is not of required architecture

泄露秘密 提交于 2019-12-02 06:12:58
问题 I have searched for hours however I still have no clue what is wrong with my configuration. My project uses a self-written libray (myLib). This library is compiled to work only for simulator and it works perfectly there. What do have to change so it compiles for my iPhone Device as well? This is my current warning: ld: warning: in /.../myLib.a, file is not of required architecture This is my configuration (of myLib.a) I found a lot of articles explaining the reason for this error however I

linker error when using tr1::regex

家住魔仙堡 提交于 2019-12-02 05:34:44
问题 I've got a program that uses tr1::regex , and while it compiles, it gives me very verbose linker errors. Here's my header file MapObject.hpp: #include <iostream> #include <string> #include <tr1/regex> #include "phBaseObject.hpp" using std::string; namespace phObject { class MapObject: public phBaseObject { private: string color; // must be a hex string represented as "#XXXXXX" static const std::tr1::regex colorRX; // enforces the rule above public: void setColor(const string&); (...) }; }

Cuda 5.0 Linking Issue

Deadly 提交于 2019-12-02 05:13:17
I'm just trying to build an old project of mine using cuda 5.0 preview. I get an Error when linking, telling me that certain cuda functions can not be found. For example: undefined reference to 'cudaMalloc' . My linking command includes the following options for cuda : -L/usr/local/cuda/lib64 -L/home/myhome/NVIDIA_CUDA_Samples/C/lib -L/home/myhome/NVIDIA_CUDA_Samples/C/common/lib/linux -lcudart ls -lah /usr/local/cuda/lib64/ gives me 8 cuda libraries including libcudart.so.5.0.7 with symlinks using only the .so-file-ending. ls /home/myhome/NVIDIA_CUDA_Samples/C/lib/ gives me an empty directory

“Undefined Symbol _memset”

点点圈 提交于 2019-12-02 04:36:43
问题 I asked a similar question, but I have some update which is really confusing me. Essentially, I want to link a number of object files with the linker as follows: /usr/ccs/bin/ld -o q -e start_master -dn -z defs -M ../../../mapfile.q {list of object files} I get the following error: Undefined first referenced symbol in file _memset reconf.o The interesting things is, that memset is not referenced in reconf.c and I also grep'ed the whole directory but there is also no reference in any of the

Accesing global variable giving linker error in objective C

烈酒焚心 提交于 2019-12-02 04:12:30
I have declared a global variable like below extern NSString *name; @interface viewcontrollerOne{} in implementation file i am accessing that global variable in some method like -(void)someMethod { name = @"hello"; } but this is giving linker error. "name", referenced from: -[viewcontrollerOne someMethod] in viewcontrollerOne.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) The following is merely a declaration: extern NSString * const name; // << side note: this should typically be const It declares there is a

Mach-o Linker Error

亡梦爱人 提交于 2019-12-02 04:04:40
I can't build my project because I keep getting this error. As I understood it deals with the constant tagShift I'm using in my code. I would appreciate if anyone could help me to solve this issue I had faced the same issue someday and figured out the result as: Here You have a int tagShit of constant type . So you can not make constant type variables of same name in two or more classes. Change that tagShit variable name in one of the class (may be as tagShift1 or anything else) and it will be good to go. Hope it'll help you. I guess you have included TrafficLightG.h in more than one file.