Raised This Month: $12 Target: $400
 3% 

Unresolved external


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
killerZM
Senior Member
Join Date: Sep 2016
Old 02-15-2017 , 12:58   Unresolved external
Reply With Quote #1

i tried to compile a module before but i get that error
LNK200 : Unresolved external .........
killerZM is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-15-2017 , 13:43   Re: Unresolved external
Reply With Quote #2

That's no info at all. Post the code and full compiler/linker log.
klippy is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 02-15-2017 , 14:54   Re: Unresolved external
Reply With Quote #3

linker ? i dont know about linker

i use msv 2013 express

code is 2300 line
killerZM is offline
addons_zz
Veteran Member
Join Date: Aug 2015
Location: Dreams, zz
Old 02-15-2017 , 15:29   Re: Unresolved external
Reply With Quote #4

Quote:
Originally Posted by KliPPy View Post
That's no info at all. Post the code and full compiler/linker log.
__________________
Plugin: Sublime Text - ITE , Galileo
Multi-Mod: Manager / Plugin / Server

Support me on Patreon, Ko-fi, Liberapay or Open Collective
addons_zz is offline
WildCard65
Veteran Member
Join Date: Aug 2013
Location: Canada
Old 02-15-2017 , 15:41   Re: Unresolved external
Reply With Quote #5

Quote:
Originally Posted by killerZM View Post
linker ? i dont know about linker

i use msv 2013 express

code is 2300 line
The error was generated by msvc's linker because it couldn't find the definition to a function to link your code to (as your code references it), we can't help you without knowing what that function it's trying to find.
__________________
WildCard65 is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 02-16-2017 , 08:59   Re: Unresolved external
Reply With Quote #6

PHP Code:
#include "stdafx.h"
#include "amxxmodule.h"

extern AMX_NATIVE_INFO my_natives[];

static 
cell AMX_NATIVE_CALL addti(AMX *amxcell *params)
{
    
int num_to_add params[1];
    
int num_to_add2 params[2];
    
int sum num_to_add num_to_add2;
    return 
sum;
}

AMX_NATIVE_INFO my_natives[]
{
    {
"addti" ,addti} ,
    {
NULL NULL}
};

void OnAmxxAttach()
{
    
MF_AddNatives(my_natives);

code up

error :
PHP Code:
Error    1    error LNK2001unresolved external symbol "int (__cdecl* g_fn_AddNatives)(struct AMX_NATIVE_INFO const *)" (?g_fn_AddNatives@@3P6AHPBUAMX_NATIVE_INFO@@@ZA)    C:\Users\Mhmdbedo\Documents\Visual Studio 2013\Projects\Win32Project1\Win32Project1\Win32Project1.obj    Win32Project1

Error    2    error LNK1120
1 unresolved externals    C:\Users\Mhmdbedo\Documents\Visual Studio 2013\Projects\Win32Project1\Debug\Win32Project1.dll    Win32Project1 
killerZM is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-16-2017 , 09:40   Re: Unresolved external
Reply With Quote #7

It seems like you didn't include amxxmodule.cpp in project's list of source files to be compiled.
klippy is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 02-16-2017 , 10:51   Re: Unresolved external
Reply With Quote #8

i need it ? lol
@edit : it worked
but how i can remove the pre-compiled headers in my project ?
i press FILE > new project win32 app > create then setting appear and choose DLL file
and i need amxx.dll prefix or dll only

Last edited by killerZM; 02-16-2017 at 11:09.
killerZM is offline
klippy
AlliedModders Donor
Join Date: May 2013
Location: Serbia
Old 02-16-2017 , 12:10   Re: Unresolved external
Reply With Quote #9

Name your project <name>_amxx and you'll be good. The output binary will be named <name>_amxx.dll.
Also, when creating a project you can disable precompiled headers. You should also be able to disable them somewhere in project propertied for existing projects, probably in the general tab (on phone currently, can't check where exactly the option is).

Last edited by klippy; 02-16-2017 at 12:11.
klippy is offline
killerZM
Senior Member
Join Date: Sep 2016
Old 02-16-2017 , 13:35   Re: Unresolved external
Reply With Quote #10

thx for help
killerZM is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:46.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode