Error messages aplenty!!!!!

Reply

Join Date: Jun 2007
Posts: 1
Reputation: Knightfall13x is an unknown quantity at this point 
Solved Threads: 0
Knightfall13x Knightfall13x is offline Offline
Newbie Poster

Error messages aplenty!!!!!

 
0
  #1
Jun 23rd, 2007
i am using visual studios 8 and have added the Platform sdk include and library files to visual studios. and i am when i debug my programs i get the following errors. (the program is just a simple shell program)
the code for it is as follows:
  1. // include files
  2. #include <windows.h>
  3. #include <stdio.h>
  4. #include <stdarg.h>
  5.  
  6.  
  7. //Main Application instances
  8. HINSTANCE g_hInst; //Global instance handle
  9. HWND g_hWnd; //Global window handle
  10.  
  11.  
  12.  
  13. //Application window dimensions, type, class, and window name
  14. #define WNDWIDTH 400
  15. #define WNDHEIGHT 400
  16. #define WNDTYPE WS_OVERLAPPEDWINDOW
  17. const char g_szClass[] = "FrameClass";
  18. const char g_szCaption[] ="FrameCaption";
  19.  
  20. //Main Application Prototypes
  21.  
  22. //Entry Point
  23. int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev,
  24. LPSTR szCmdLine, int nCmdShow);
  25.  
  26. // Function to display an error message
  27. void AppError(BOOL Fatal, char *Text, ...);
  28.  
  29. // Message Procedure
  30. long FAR PASCAL WindowProc(HWND hWnd, UINT uMsg,
  31. WPARAM wParam, LPARAM lParam);
  32.  
  33. // Functions to register and unregister windows' classes
  34. BOOL RegisterWindowClasses(HINSTANCE hInst);
  35. BOOL UnregisterWindowClasses(HINSTANCE hInst);
  36.  
  37. // Function to create the application window
  38. HWND CreateMainWindow(HINSTANCE hInst);
  39.  
  40. //Functions to init, shutdown, and handle per frame functions
  41. BOOL DoInit();
  42. BOOL DoShutdown();
  43. BOOL DoPreFrame();
  44. BOOL DoFrame();
  45. BOOL DoPostFrame();
  46.  
  47. int PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrev,
  48. LPSTR szCmdLine, int nCmdShow)
  49. {
  50. MSG Msg;
  51.  
  52. //save application instance
  53. g_hInst = hInst;
  54.  
  55. //Register window classes - return on FALSE
  56. if(RegisterWindowClasses(hInst)== FALSE)
  57. return FALSE;
  58.  
  59. //Create window - return on FALSE
  60. if((g_hWnd = CreateMainWindow(hInst)) == NULL)
  61. return FALSE;
  62.  
  63. //Do application initialization - return on FALSE
  64. if(DoInit() ==TRUE) {
  65.  
  66. //Enter the Message Pump
  67. ZeroMemory(&Msg, sizeof(MSG));
  68. while(Msg.message != WM_QUIT) {
  69. //Handle Windows Messages (if any)
  70. if(PeekMessage(&Msg, NULL, 0, 0, PM_REMOVE)) {
  71. TranslateMessage(&Msg);
  72. DispatchMessage(&Msg);
  73. } else {
  74.  
  75. //do pre-frame processing, break on FALSE return Value
  76. if(DoPreFrame() == FALSE)
  77. break;
  78.  
  79. //Do pre-fram processing, breeak on a FALSE return value
  80. if(DoFrame() == FALSE)
  81. break;
  82.  
  83. //Do post - Frame processing, break on a FALSE reurn value
  84. if(DoPostFrame() == FALSE)
  85. break;
  86. }
  87. }
  88. }
  89.  
  90. //Do shutdown function
  91. DoShutdown();
  92.  
  93. // Unregister window
  94. UnregisterWindowClasses(hInst);
  95.  
  96. return TRUE;
  97. }
  98. BOOL RegisterWindowClasses(HINSTANCE hInst)
  99. {
  100. WNDCLASSEX wcex;
  101.  
  102. //Create the window class here and register it
  103. wcex.cbSize = sizeof(wcex);
  104. wcex.style = CS_CLASSDC;
  105. wcex.lpfnWndProc = WindowProc;
  106. wcex.cbClsExtra = 0;
  107. wcex.cbWndExtra = 0;
  108. wcex.hInstance = hInst;
  109. wcex.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  110. wcex.hCursor = LoadCursor(NULL, IDC_ARROW);
  111. wcex.hbrBackground = NULL;
  112. wcex.lpszMenuName = NULL;
  113. wcex.lpszClassName = g_szClass;
  114. wcex.hIconSm = LoadIcon(NULL, IDI_APPLICATION);
  115.  
  116. if(!RegisterClassEx(&wcex))
  117. return FALSE;
  118.  
  119. return TRUE;
  120. }
  121. BOOL UnregisterWindowClasses(HINSTANCE hInst)
  122. {
  123. // unregister the window class
  124. UnregisterClass(g_szClass, hInst);
  125. return TRUE;
  126. }
  127.  
  128. HWND CreateMainWindow(HINSTANCE hInst)
  129. {
  130. HWND hWnd;
  131.  
  132. // Create the main Window
  133. hWnd = CreateWindow(g_szClass, g_szCaption,
  134. WNDTYPE, 0, 0, WNDWIDTH, WNDHEIGHT,
  135. NULL, NULL, hInst, NULL);
  136. if(!hWnd)
  137. return NULL;
  138.  
  139. //show and update the window
  140. ShowWindow(hWnd, SW_NORMAL);
  141. UpdateWindow(hWnd);
  142.  
  143. // Return the window handle
  144. return hWnd;
  145. }
  146. void AppError(BOOL Fatal, char *Text, ...)
  147. {
  148. char CaptionText[12];
  149. char ErrorText[2048];
  150. va_list valist;
  151.  
  152. //Build the message box caption based on fatal flag
  153. if(Fatal == FALSE)
  154. strcpy(CaptionText, "Error");
  155. else
  156. strcpy(CaptionText, "Fatal Error");
  157.  
  158. //build variabl text buffer
  159. va_start(valist, Text);
  160. vsprintf(ErrorText, Text, valist);
  161. va_end(valist);
  162.  
  163. //display the message box
  164. MessageBox(NULL, ErrorText, CaptionText,
  165. MB_OK | MB_ICONEXCLAMATION);
  166.  
  167. //post a quit message if error is fatal
  168. if(Fatal == TRUE)
  169. PostQuitMessage(0);
  170. }
  171.  
  172. // the message procedure - empty except for the destroy message
  173. long FAR PASCAL WindowProc(HWND hWnd, UINT uMsg,
  174. WPARAM wParam, LPARAM lParam)
  175. {
  176. switch(uMsg) {
  177. case WM_DESTROY:
  178. PostQuitMessage(0);
  179. return 0;
  180. }
  181. return DefWindowProc(hWnd, uMsg, wParam, lParam);
  182. }
  183.  
  184. BOOL DoInit()
  185. {
  186. //preform application initialization functions here
  187. //such as those that set up graphics, sound, etc.
  188. // return the value of TRUE for sucess, FALSE otherwise.
  189. return TRUE;
  190. }
  191.  
  192. BOOL DoShutdown()
  193. {
  194. // preform application shutdown function here
  195. // such as those that sgutdown graphics, sound, etc.
  196. //return a value of TRUE for success, FALSE otherwise.
  197. return TRUE;
  198. }
  199.  
  200. BOOL DoPreFrame()
  201. {
  202. // preform pre-frame processing here, such as settign up a timer.
  203. //return TRUE on success, FALSE otherwise.
  204. return TRUE;
  205. }
  206.  
  207. BOOL DoFrame()
  208. {
  209. // preform per frame processing here, such as rendering
  210. // return TRUE for sucess, FALSE otherwise.
  211. return TRUE;
  212. }
  213.  
  214. BOOL DoPostFrame()
  215. {
  216. //preform post frame processing, such as time synching, etc
  217. //return TRUE for success, FALSE for otherwise.
  218. return TRUE;
  219. }
and when i run it i get theses errors:
Error 1 error LNK2019: unresolved external symbol __imp__DispatchMessageA@4 referenced in function _WinMain@16 Framework Main.obj

Error 2 error LNK2019: unresolved external symbol __imp__TranslateMessage@4 referenced in function _WinMain@16 Framework Main.obj

Error 3 error LNK2019: unresolved external symbol __imp__PeekMessageA@20 referenced in function _WinMain@16 Framework Main.obj

Error 4 error LNK2019: unresolved external symbol _memset referenced in function _WinMain@16 Framework Main.obj

Error 5 error LNK2019: unresolved external symbol @_RTC_CheckStackVars@8 referenced in function _WinMain@16 Framework Main.obj

Error 6 error LNK2019: unresolved external symbol __RTC_CheckEsp referenced in function _WinMain@16 Framework Main.obj

Error 7 error LNK2001: unresolved external symbol __RTC_Shutdown Framework Main.obj

Error 8 error LNK2001: unresolved external symbol __RTC_InitBase Framework Main.obj

Error 9 error LNK2019: unresolved external symbol __imp__RegisterClassExA@4 referenced in function "int __cdecl RegisterWindowClasses(struct HINSTANCE__ *)" (?RegisterWindowClasses@@YAHPAUHINSTANCE__@@@Z) Framework Main.obj

Error 10 error LNK2019: unresolved external symbol __imp__LoadCursorA@8 referenced in function "int __cdecl RegisterWindowClasses(struct HINSTANCE__ *)" (?RegisterWindowClasses@@YAHPAUHINSTANCE__@@@Z) Framework Main.obj

Error 11 error LNK2019: unresolved external symbol __imp__LoadIconA@8 referenced in function "int __cdecl RegisterWindowClasses(struct HINSTANCE__ *)" (?RegisterWindowClasses@@YAHPAUHINSTANCE__@@@Z) Framework Main.obj

Error 12 error LNK2019: unresolved external symbol __imp__UnregisterClassA@8 referenced in function "int __cdecl UnregisterWindowClasses(struct HINSTANCE__ *)" (?UnregisterWindowClasses@@YAHPAUHINSTANCE__@@@Z) Framework Main.obj

Error 13 error LNK2019: unresolved external symbol __imp__UpdateWindow@4 referenced in function "struct HWND__ * __cdecl CreateMainWindow(struct HINSTANCE__ *)" (?CreateMainWindow@@YAPAUHWND__@@PAUHINSTANCE__@@@Z) Framework Main.obj

Error 14 error LNK2019: unresolved external symbol __imp__ShowWindow@8 referenced in function "struct HWND__ * __cdecl CreateMainWindow(struct HINSTANCE__ *)" (?CreateMainWindow@@YAPAUHWND__@@PAUHINSTANCE__@@@Z) Framework Main.obj

Error 15 error LNK2019: unresolved external symbol __imp__CreateWindowExA@48 referenced in function "struct HWND__ * __cdecl CreateMainWindow(struct HINSTANCE__ *)" (?CreateMainWindow@@YAPAUHWND__@@PAUHINSTANCE__@@@Z) Framework Main.obj

Error 16 error LNK2019: unresolved external symbol __imp__PostQuitMessage@4 referenced in function "void __cdecl AppError(int,char *,...)" (?AppError@@YAXHPADZZ) Framework Main.obj

Error 17 error LNK2019: unresolved external symbol __imp__MessageBoxA@16 referenced in function "void __cdecl AppError(int,char *,...)" (?AppError@@YAXHPADZZ) Framework Main.obj

Error 18 error LNK2019: unresolved external symbol __imp__vsprintf referenced in function "void __cdecl AppError(int,char *,...)" (?AppError@@YAXHPADZZ) Framework Main.obj

Error 19 error LNK2019: unresolved external symbol _strcpy referenced in function "void __cdecl AppError(int,char *,...)" (?AppError@@YAXHPADZZ) Framework Main.obj

Error 20 error LNK2019: unresolved external symbol ___security_cookie referenced in function "void __cdecl AppError(int,char *,...)" (?AppError@@YAXHPADZZ) Framework Main.obj

Error 21 error LNK2019: unresolved external symbol @__security_check_cookie@4 referenced in function "void __cdecl AppError(int,char *,...)" (?AppError@@YAXHPADZZ) Framework Main.obj

Error 22 error LNK2019: unresolved external symbol __imp__DefWindowProcA@16 referenced in function "long __stdcall WindowProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WindowProc@@YGJPAUHWND__@@IIJ@Z) Framework Main.obj

Error 23 error LNK2001: unresolved external symbol _WinMainCRTStartup Application Framework

Error 24 fatal error LNK1120: 23 unresolved externals C:\Documents and Settings\John Geddes\Desktop\rpg\Chapter 2\Application Framework\Debug\Application Framework.exe
im sure it probably has something to do with depreciated files and changing my declares but im having a major problem with this, and it used to work before i installed the platform SDK, this is really bugging me can anyone make any suggestions
Last edited by ~s.o.s~; Jun 23rd, 2007 at 4:33 am. Reason: Added code tags, learn to use them.
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,145
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1434
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is online now Online
Most Valuable Poster

Re: Error messages aplenty!!!!!

 
0
  #2
Jun 23rd, 2007
I just compiled and linked your program without any error messages after adding pragma to remove warning C4996. So your problem must be that you did not set up the paths to the SDK correctly.

recheck the tools to see that you added the path to the platform sdk libraries correctly and that it is the first path in the list. If you left the path at the bottom of the list them use the arrow button to move it up to the top. Below is how mine is set up
Attached Images
File Type: jpg screen.jpg (153.3 KB, 12 views)
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC