HelpLNK2001 again -_-

Posts 115 of 16 · Page 1 of 2
LNK2001 again -_-
i've never actually figured out how to fix this, but i only get it when i try to put in S2S hacks

Code:
Main.obj : error LNK2001: unresolved external symbol "public: static int __cdecl LTAssert::RunAssert(char const *,char const *,int,char const *,bool,char const *,...)" (?RunAssert@LTAssert@@SAHPBD0H0_N0ZZ)
1>C:\Users\Boxxi\Documents\Visual Studio 2010\Projects\Hotkey2\Release\Hotkey2.dll : fatal error LNK1120: 1 unresolved externals
i just wanted to test some stuff i have, idk how to fix it and nothing i googled helped
Code:
#define DISSABLE_ASSERTS
In Files.h or wherever.
Quote Originally Posted by Flengo View Post
Code:
#define DISSABLE_ASSERTS
In Files.h or wherever.
didn't fix it
Quote Originally Posted by supercarz1991 View Post
didn't fix it
Put it in Main.h
Quote Originally Posted by Flengo View Post
Code:
#define DISSABLE_ASSERTS
In Files.h or wherever.
It is a linking error... how will defining "dissable_asserts" link it for him? Smh.
@OP You will need to link it in your IDE
Quote Originally Posted by Flengo View Post


Put it in Main.h
I don't have a main.h lol, i have

Addies.h
classes.h
message.h
files.h
Main.cpp

that's it lol

and @Herpina I'm self taught from just doing it overtime... "link it in your ide" does not make sense to me XD
Quote Originally Posted by Herpina View Post
It is a linking error... how will defining "dissable_asserts" link it for him? Smh.
@OP You will need to link it in your IDE
If you've ever use FEAR SDK You would know.
Quote Originally Posted by Herpina View Post
It is a linking error... how will defining "dissable_asserts" link it for him? Smh.
@OP You will need to link it in your IDE
With pre-processor conditionals. A lot of commercial code is written this way to allow for production/debug builds with easy switching.

I.e

Code:
#ifndef DISABLE_ASSERTS //debugging
   RunAssert( ... )
#endif
By defining/not defining the pre-processor macro, certain parts of the code will remain uncompiled. If all calls to the unresolved function are encased in a preprocessor conditional like that, defining DISABLE_ASSERTS will get rid of the LNK error because no calls to the unresolved external would be compiled any more.. The actual LNK error itself would be due to only having a partial codebase of the original (usually happens when people strip functions from code they don't understand).

@OP, please tell me you didn't just directly copy and paste
Code:
DISSABLE_ASSERTS
everywhere? It's a spelling mistake (I'm not familiar with the FEAR SDK, but DISSABLE is actually spelled DISABLE).
Try defining
Code:
#define DISABLE_ASSERTS
Quote Originally Posted by Broderick View Post


With pre-processor conditionals. A lot of commercial code is written this way to allow for production/debug builds with easy switching.

I.e

Code:
#ifndef DISABLE_ASSERTS //debugging
   RunAssert( ... )
#endif
By defining/not defining the pre-processor macro, certain parts of the code will remain uncompiled. If all calls to the unresolved function are encased in a preprocessor conditional like that, defining DISABLE_ASSERTS will get rid of the LNK error because no calls to the unresolved external would be compiled any more.. The actual LNK error itself would be due to only having a partial codebase of the original (usually happens when people strip functions from code they don't understand).

@OP, please tell me you didn't just directly copy and paste
Code:
DISSABLE_ASSERTS
everywhere? It's a spelling mistake (I'm not familiar with the FEAR SDK, but DISSABLE is actually spelled DISABLE).
Try defining
Code:
#define DISABLE_ASSERTS
Yeah, that would work. OP Doesn't "Know" C++ but he works at it pretty close to someone knowing it

I didn't realize I spelt disable wrong My bad.
1. The define helps, when you put it in the preprocessor located in:
Project settings -> C/C++ -> preprocessor -> Processordefinitions. Add the define name there.
All should work now!
Quote Originally Posted by Ch40zz-C0d3r View Post
1. The define helps, when you put it in the preprocessor located in:
Project settings -> C/C++ -> preprocessor -> Processordefinitions. Add the define name there.
All should work now!
that didn't fix it either haha
i'm sure that in a cpp file u have defined a class with some function in it and then, in the header u haven't written that function.. that's the why the IDE says it's unresolved
Quote Originally Posted by Sixx93 View Post
i'm sure that in a cpp file u have defined a class with some function in it and then, in the header u haven't written that function.. that's the why the IDE says it's unresolved
Dude unresolved functions are 100% the opposite of what youve said!
Its when you declare a function in a header, but theres no function called so in the cpp...
Quote Originally Posted by Ch40zz-C0d3r View Post
Dude unresolved functions are 100% the opposite of what youve said!
Its when you declare a function in a header, but theres no function called so in the cpp...
uhuhu, yup xD sorry for the mistake xD anyway it was what i was thinking
I get this and 2019 all the time, idk how to fix(yes I have read msdn and things none of it helped/was relevant)
Posts 115 of 16 · Page 1 of 2

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?