help me im new to c++

error LNK2019: unresolved external symbol

Page 1 of 1

2 Replies - 571 Views - Last Post: 24 August 2008 - 12:26 AM Rate Topic: -----

#1 pineapplems  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-August 08

help me im new to c++

Posted 23 August 2008 - 09:33 AM

hey guys im new to this whole coding thing and i reallly need to get this done soon!
im getting this error "error LNK2019: unresolved external symbol"
heres my code
 #ifndef NPCSSCRIPT_H
#define NPCSSCRIPT_H

class NPC;

class QuestsScripts {
public:
	static void handle(int npcid, NPC* npc, bool start){
		if(start){
			switch(npcid){
				case 2000: npc_2000s(npc); break;
				default: npc->end(); break;
			}
		}
		else{
			switch(npcid){
				case 2000: npc_2000e(npc); break;
				default: npc->end(); break;
			}
		}
	}
private:
	static void npc_2000s(NPC* npc);
	static void npc_2000e(NPC* npc);
};

class NPCsScripts {
public:
	static void handle(int npcid, NPC* npc){
		if(npc->isQuest()){
			QuestsScripts::handle(npcid, npc, npc->isStart());
			return;
		}
		switch(npcid){
			case 2100: npc_2100(npc); break;
			case 2101: npc_2101(npc); break;
			case 2020005: npc_2020005(npc); break;
			case 9101001: npc_9101001(npc); break;
			case 9900000: npc_9900000(npc); break;
			case 9900001: npc_9900001(npc); break;
			case 11000: shop(npc); break; 
			case 11100: shop(npc); break; 
			case 21000: shop(npc); break; 
			case 9201020: shop(npc); break; 
			case 2070003: shop(npc); break;
			case 2070001: shop(npc); break; 
			case 2070002: shop(npc); break;
			case 2041002: shop(npc); break; 
			case 2041003: shop(npc); break; 
			case 2041006: shop(npc); break; 
			case 2090002: shop(npc); break; 
			case 2090001: shop(npc); break; 
			case 2090003: shop(npc); break; 
			case 9110003: shop(npc); break; 
			case 9110004: shop(npc); break; 
			case 9110005: shop(npc); break; 
			case 9110006: shop(npc); break; 
			case 9110007: shop(npc); break;
			case 9201058: shop(npc); break; 
			case 9201059: shop(npc); break; 
			case 9201060: shop(npc); break; 
			case 1061001: shop(npc); break; 
			case 1031000: shop(npc); break; 
			case 1031001: shop(npc); break; 
			case 1031100: shop(npc); break; 
			case 1081000: shop(npc); break; 
			case 1011000: shop(npc); break; 
			case 1011001: shop(npc); break; 
			case 1011100: shop(npc); break; 
			case 1051000: shop(npc); break; 
			case 1051001: shop(npc); break;
			case 1051002: shop(npc); break; 
			case 1001000: shop(npc); break; 
			case 1001001: shop(npc); break; 
			case 1001100: shop(npc); break; 
			case 1021000: shop(npc); break; 
			case 1021001: shop(npc); break; 
			case 1021100: shop(npc); break; 
			case 1061002: shop(npc); break; 
			case 2022001: shop(npc); break; 
			case 2094001: npc_2094001(npc); break; 
			case 2090000: npc_2090000(npc); break; 
			case 2001001: npc_2001001(npc); break; 
			case 2020001: shop(npc); break;
			case 2022000: shop(npc); break; 
			case 2060004: shop(npc); break; 
			case 2060003: shop(npc); break; 
			case 2060007: shop(npc); break; 
			case 2050000: shop(npc); break; 
			case 2050003: shop(npc); break; 
			case 2051000: shop(npc); break; 
			case 2012003: shop(npc); break; 
			case 2012004: shop(npc); break; 
			case 2012005: shop(npc); break; 
			case 2093000: shop(npc); break; 
			case 2093002: shop(npc); break; 
			case 2093001: shop(npc); break; 
			case 2080002: shop(npc); break; 
			case 2080001: shop(npc); break; 
			case 1052104: shop(npc); break; 
			case 1032103: shop(npc); break; 
			case 2022002: shop(npc); break; 
			case 2041016: shop(npc); break; 
			case 2040049: shop(npc); break; 
			case 2030009: shop(npc); break; 
			case 9010002: shop(npc); break;
			case 1002000: npc_1002000(npc); break; 
			case 1012000: npc_1012000(npc); break; 
			case 1022001: npc_1022001(npc); break; 
			case 1032000: npc_1032000(npc); break; 
			case 1052016: npc_1052016(npc); break; 
			case 1002004: npc_1002004(npc); break;
			case 1032005: npc_1032005(npc); break; 
			case 1081001: npc_1081001(npc); break; 
			case 1002002: npc_1002002(npc); break; 
			case 9201056: npc_9201056(npc); break;  
			case 9000020: npc_9000020(npc); break; 
			case 2040019: npc_2040019(npc); break;
			case 2093004: npc_2093004(npc); break; 
			case 2060009: npc_2060009(npc); break; 
			case 9201057: npc_9201057(npc); break; 
			case 2012000: npc_2012000(npc); break; 
			case 2082000: npc_2082000(npc); break;
			case 2040000: npc_2040000(npc); break; 
			case 1032007: npc_1032007(npc); break; 
			case 2090005: npc_2090005(npc); break; 
			case 22000: npc_22000(npc); break; 
			case 2030000: npc_2030000(npc); break; 
			case 9100100: gachapon(npc); break;  
			case 9100101: gachapon(npc); break;
			case 9100102: gachapon(npc); break;
			case 9100103: gachapon(npc); break;
			case 9100104: gachapon(npc); break;
			case 9100106: gachapon(npc); break;
			case 9100109: gachapon(npc); break;
			case 9100110: gachapon(npc); break;
			case 1012100: npc_1012100(npc); break; 
			case 1032001: npc_1032001(npc); break; 
			case 1022000: npc_1022000(npc); break; 
			case 1052001: npc_1052001(npc); break; 
			case 2020008: npc_2020008(npc); break; 
			case 2020010: npc_2020010(npc); break; 
			case 2020011: npc_2020011(npc); break; 
			case 2020009: npc_2020009(npc); break; 
			case 2012014: npc_2012014(npc); break;
			case 2012015: npc_2012015(npc); break; 
			case 1012002: npc_1012002(npc); break; 
			case 1012103: npc_1012103(npc); break;
			case 1012104: npc_1012104(npc); break;
			case 1052100: npc_1052100(npc); break;
			case 1052101: npc_1052101(npc); break;
			case 2041007: npc_2041007(npc); break;
			case 2041009: npc_2041009(npc); break;
			case 1012105: npc_1012105(npc); break;
			case 1052004: npc_1052004(npc); break;
			case 1052005: npc_1052005(npc); break;
			case 2041013: npc_2041013(npc); break;
			case 2041010: npc_2041010(npc); break;
			case 2010002: npc_2010002(npc); break;
			case 2012008: npc_2012008(npc); break;
			case 2010001: npc_2010001(npc); break;
			case 2012007: npc_2012007(npc); break;
			case 2040024: npc_2040024(npc); break; 
			case 2040036: npc_2040036(npc); break; 
			case 2040025: npc_2040025(npc); break; 
			case 2040026: npc_2040026(npc); break; 
			case 2040027: npc_2040027(npc); break; 
			case 9200000: npc_9200000(npc); break;
			case 2060005: npc_2060005(npc); break;  
			case 9220004: npc_9220004(npc); break;
			case 2001004: npc_2001004(npc); break;  
			case 9201022: npc_9201022(npc); break; 
			case 2041024: npc_2041024(npc); break;
			case 9200100: npc_9200100(npc); break;
			case 2041025: npc_2041025(npc); break; 
			case 1061100: npc_1061100(npc); break; 
			case 9120018: npc_9120018(npc); break;
			case 1022101: npc_1022101(npc); break;
			case 9201008: npc_9201008(npc); break; 
			case 9201010: npc_9201010(npc); break;
			case 9201021: npc_9201021(npc); break;
			case 2030008: npc_2030008(npc); break; 
			case 2030010: npc_2030010(npc); break; 
			case 2083002: npc_2083002(npc); break;
			case 2081005: npc_2081005(npc); break;
			case 9000011: npc_9000011(npc); break;
			case 9000000: npc_9000000(npc); break;
			case 9000013: npc_9000013(npc); break;
			case 9000001: npc_9000001(npc); break;
			case 1052002: npc_1052002(npc); break;
			case 2080005: npc_2080005(npc); break; 
			case 1052003: npc_1052003(npc); break;
			case 9000019: npc_9000019(npc); break;
			case 1052011: npc_1052011(npc); break;
			case 2081300: npc_2081300(npc); break;
			case 2081100: npc_2081100(npc); break;
			case 2081200: npc_2081200(npc); break;
			case 2081400: npc_2081400(npc); break;
			case 2040044: npc_2040044(npc); break;  
			case 1012004: npc_1012004(npc); break;  
			case 9020000: npc_9020000(npc); break; 
			case 9020002: npc_9020002(npc); break; 
			case 2020002: shop(npc); break; 
			case 9120015: npc_9120015(npc); break; 
			case 9000004: npc_9000004(npc); break; 
			case 9120200: npc_9120200(npc); break; 
			case 9201030: npc_9201030(npc); break; 
			case 9120201: npc_9120201(npc); break; 
			case 9120202: npc_9120202(npc); break; 
			case 9120000: shop(npc); break;
			case 1063001: shop(npc); break;
			case 9120001: shop(npc); break;
			case 1002005: shop(npc); break; //SCROLL
			case 9000017: npc_9000017(npc); break; //GLOVE
			case 9120002: shop(npc); break;
			case 2094002: npc_2094002(npc); break; //GUON
			case 2050014: npc_2050014(npc); break; //METEOR
			case 9300000: shop(npc); break; //CS SHOP
			case 9300001: shop(npc); break; //CS SHOP
			case 9300002: shop(npc); break; //CS SHOP
			case 9300003: shop(npc); break; //CS SHOP
			case 9300004: shop(npc); break; //CS SHOP
			case 9300005: shop(npc); break; //CS SHOP
			case 9300006: shop(npc); break; //CS SHOP
			case 9300007: shop(npc); break; //CS SHOP
			case 9300008: shop(npc); break; //CS SHOP
			case 9300009: shop(npc); break; //CS SHOP
			case 9300010: shop(npc); break; //CS SHOP
			case 9300011: shop(npc); break; //CS SHOP
			case 9300012: shop(npc); break; //CS SHOP
			case 9300013: npc_9300013(npc); break; //CS SHOP
			case 9300014: shop(npc); break; //CS SHOP
									  case 9310010: shop(npc); break; //CS SHOP
									  case 9010001: shop(npc); break; // TIA
									  case 1052017: npc_1052017(npc); break;
			default: npc->end(); break;
		}   
	}
private:
	static void npc_2100(NPC* npc);
	static void npc_2101(NPC* npc);
	static void npc_9000017(NPC* npc);
	static void npc_1012004(NPC* npc);
	static void npc_2020005(NPC* npc);
	static void npc_9101001(NPC* npc);
	static void npc_9900000(NPC* npc);
	static void npc_9900001(NPC* npc);
	static void npc_9900017(NPC* npc);
	static void npc_2094002(NPC* npc);
	static void npc_2050014(NPC* npc);
	static void shop(NPC* npc);
	static void npc_1002000(NPC* npc);
	static void npc_9201030(NPC* npc);
	static void npc_9220004(NPC* npc);
	static void npc_2094001(NPC* npc);
	static void npc_2040036(NPC* npc);
	static void npc_2090000(NPC* npc);
	static void npc_1012000(NPC* npc);
	static void npc_9000004(NPC* npc);
	static void npc_1022001(NPC* npc);
	static void npc_1032000(NPC* npc);
	static void npc_1052016(NPC* npc);
	static void npc_1002004(NPC* npc);
	static void npc_9200100(NPC* npc);
	static void npc_1032005(NPC* npc);
	static void npc_1081001(NPC* npc);
	static void npc_1002002(NPC* npc);
	static void npc_9201056(NPC* npc);
	static void npc_9000020(NPC* npc);
	static void npc_2093004(NPC* npc);
	static void npc_1012002(NPC* npc);
	static void npc_2060009(NPC* npc);
	static void npc_9201057(NPC* npc);
	static void npc_2012000(NPC* npc);
	static void npc_2082000(NPC* npc);
	static void npc_2040000(NPC* npc);
	static void npc_1032007(NPC* npc);
	static void npc_2090005(NPC* npc);
	static void npc_22000(NPC* npc);
	static void npc_2030000(NPC* npc);
	static void npc_1012100(NPC* npc);
	static void npc_1032001(NPC* npc); 
	static void npc_1022000(NPC* npc); 
	static void npc_1052001(NPC* npc);
	static void npc_2020008(NPC* npc); 
	static void npc_2020010(NPC* npc);
	static void npc_2001001(NPC* npc); 
	static void npc_2020011(NPC* npc); 
	static void npc_2020009(NPC* npc);  
	static void gachapon(NPC* npc); 
	static void npc_2012015(NPC* npc); 
	static void npc_2012014(NPC* npc); 
	static void npc_1012103(NPC* npc);
	static void npc_1012104(NPC* npc);
	static void npc_1052100(NPC* npc);
	static void npc_1052101(NPC* npc);
	static void npc_2041007(NPC* npc);
	static void npc_2041009(NPC* npc);
	static void npc_1012105(NPC* npc);
	static void npc_1052004(NPC* npc);
	static void npc_1052005(NPC* npc);
	static void npc_2041013(NPC* npc);
	static void npc_2041010(NPC* npc);
	static void npc_2010002(NPC* npc);
	static void npc_2012008(NPC* npc);
	static void npc_2010001(NPC* npc);
	static void npc_2012007(NPC* npc);
	static void npc_2040024(NPC* npc); 
	static void npc_2040025(NPC* npc);
	static void npc_2040026(NPC* npc);
	static void npc_2040027(NPC* npc);
	static void npc_9200000(NPC* npc);
	static void npc_2060005(NPC* npc); 
	static void npc_9201022(NPC* npc);
	static void npc_2041024(NPC * npc);
	static void npc_2041025(NPC * npc);
	static void npc_1061100(NPC* npc); 
	static void npc_9120018(NPC* npc);
	static void npc_1022101(NPC* npc);
	static void npc_2001004(NPC* npc);
	static void npc_2002000(NPC* npc);
	static void npc_9201008(NPC* npc);
	static void npc_9201010(NPC* npc); 
	static void npc_9201021(NPC* npc); 
	static void npc_9201049(NPC* npc);
	static void npc_2030008(NPC * npc);
	static void npc_2030010(NPC * npc);
	static void npc_2081005(NPC * npc); 
	static void npc_2083002(NPC * npc); 
	static void npc_9000011(NPC* npc);
	static void npc_9000000(NPC* npc);
	static void npc_9000013(NPC* npc);
	static void npc_9000001(NPC* npc);
	static void npc_1052002(NPC* npc);
	static void npc_2080005(NPC* npc); 
	static void npc_1052003(NPC* npc);
	static void npc_9000019(NPC* npc);
	static void npc_1052011(NPC* npc);
	static void npc_2081300(NPC* npc);
	static void npc_2081100(NPC* npc);
	static void npc_2081200(NPC* npc);
	static void npc_2081400(NPC* npc);
	static void npc_2040044(NPC* npc); 
	static void npc_9020000(NPC* npc); 
	static void npc_9020002(NPC* npc); 
	static void npc_2020002(NPC* npc);
	static void npc_9120015(NPC* npc); 
	static void npc_9120200(NPC* npc);
	static void npc_9120201(NPC* npc); 
	static void npc_9120202(NPC* npc); 
	static void npc_2040019(NPC* npc);
	static void npc_9300013(NPC* npc); 
	static void npc_1052017(NPC* npc); 
};

#endif 


and here are my errors
1>------ Build started: Project: MapleStoryServer, Configuration: Debug Win32 ------
1>Linking...
1>reborn.obj : error LNK2019: unresolved external symbol "public: void __thiscall NPC::setSP(short)" (?setSP@NPC@@QAEXF@Z) referenced in function "private: static void __cdecl NPCsScripts::npc_1052017(class NPC *)" (?npc_1052017@NPCsScripts@@CAXPAVNPC@@@Z)
1>C:\Users\Tom\Desktop\msps2\FuckMS Repack\DYS REPACK\DYS Repack\Debug\MapleStoryServer.exe : fatal error LNK1120: 1 unresolved externals
1>Build log was saved at "file://c:\Users\Tom\Desktop\msps2\FuckMS Repack\DYS REPACK\DYS Repack\MapleStoryServer\Debug\BuildLog.htm"
1>MapleStoryServer - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 2 up-to-date, 0 skipped ==========




thnak u soo much in advance,

umm u dont have to.....
but it would be GREATLY apreaciated if u could fix it for me!
i have been using c++ fo 2 days...help! plz

Is This A Good Question/Topic? 0
  • +

Replies To: help me im new to c++

#2 Martyr2  Icon User is offline

  • Programming Theoretician
  • member icon

Reputation: 4316
  • View blog
  • Posts: 12,096
  • Joined: 18-April 07

Re: help me im new to c++

Posted 23 August 2008 - 10:31 AM

Look at your definition of the NPC class. You should have a function called setSP() which takes a short data type parameter and returns void. If you don't have one defined, define it. If you have one defined make sure that the capitalization is correct (C++ is case sensitive) and that it is defined as taking a short datatype and returning void.

My guess is that you have the wrong capitalization or spelling or that it is taking the wrong type of parameter.

If you continue to have problems with this, show us the code for your NPC class. :)
Was This Post Helpful? 0
  • +
  • -

#3 lucky4it  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 22-August 08

Re: help me im new to c++

Posted 24 August 2008 - 12:26 AM

first of all i want to tell u mister that a 2 day C++ learner camt have such kinda prog, anyways tell me hav u completed ur C language?
i completely agree with Martyr2, his suggestions will be helpful for u...
do reply my question, i'll reply u then wats wrong in ur prog if i get the prob... bye tc

This post has been edited by lucky4it: 24 August 2008 - 12:32 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1