Jiberish Visual C++ Errors Un-Understandable

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Jul 2008
Posts: 45
Reputation: killdude69 is an unknown quantity at this point 
Solved Threads: 1
killdude69 killdude69 is offline Offline
Light Poster

Jiberish Visual C++ Errors Un-Understandable

 
0
  #1
Oct 13th, 2008
Ok, I am making a DLL Library for programs using Win32 WinAPI, It contains classes for common controls. I had only five errors, the errors were because I had did a bad typecast and misspelled some variables, once I worked out every single error, 15 new errors arose and they were all nothing but jiberish. It was like some cat was standing on the keyboard and typed every single ke

Can somebody tell me what the problem is or how I can understand the error coes myself and fix them?

Here is my code:
  1. // Original Source Code FileName: WGCL.h
  2. /*
  3.  * This source code/file is part of the WGCL C++ Programming Library DLL Module.
  4.  *
  5.  * This library is distributed in the hope that it will be useful,
  6.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  7.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  8.  * GNU General Public License for more details.
  9.  *
  10.  * You should have received a copy of the GNU General Public License
  11.  * along with this source code; if not, write to the Free Software
  12.  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  13. */
  14.  
  15. #pragma once
  16.  
  17. using namespace System;
  18.  
  19. namespace WGCL {
  20.  
  21. class Form;
  22. class TextBox;
  23. class RichTextBox;
  24. class Button;
  25. class CheckBox;
  26. class RadioButton;
  27. class ListBox;
  28. class Label;
  29. class ComboBox;
  30. class FontDialog;
  31. class ColorDialog;
  32. class OpenFileDialog;
  33. class SaveFileDialog;
  34.  
  35. }
  36.  
  37. class WGCL::Form
  38. {
  39. public:
  40. Form(DWORD, LPCTSTR, int, int, int, int);
  41. Form(DWORD, DWORD, LPCTSTR, int, int, int, int);
  42. DWORD dwExStyle, dwStyle;
  43. LPCTSTR ClassName, Title, MenuName;
  44. int x, y, width, height;
  45. HMENU Menu;
  46. WNDPROC WindowProc;
  47. HINSTANCE hInst;
  48. LPVOID lpParam;
  49. HBRUSH BGColor;
  50. HICON Icon, SmIcon;
  51. HCURSOR Cursor;
  52.  
  53. bool Show(int);
  54. bool Hide();
  55. bool Destroy();
  56. bool SetPos(int, int, int, int);
  57. protected:
  58. HWND _Window;
  59. bool Created;
  60. private:
  61. bool Register();
  62. bool Show();
  63. };
  64.  
  65. WGCL::Form::Form(DWORD Style, LPCTSTR Caption, int cx, int cy, int cwidth, int cheight)
  66. {
  67. dwExStyle = 0;
  68. dwStyle = Style;
  69. Title = Caption;
  70. x = cx;
  71. y = cy;
  72. width = cwidth;
  73. height = cheight;
  74. if(Register())
  75. {
  76. if(Show())
  77. Created = true;
  78. else
  79. Created = false;
  80. }else{
  81. PostQuitMessage(-1);
  82. }
  83. }
  84.  
  85. WGCL::Form::Form(DWORD Style, DWORD exStyle, LPCTSTR Caption, int cx, int cy, int cwidth, int cheight)
  86. {
  87. dwExStyle = exStyle;
  88. dwStyle = Style;
  89. Title = Caption;
  90. x = cx;
  91. y = cy;
  92. width = cwidth;
  93. height = cheight;
  94. if(Register())
  95. {
  96. if(Show())
  97. Created = true;
  98. else
  99. Created = false;
  100. }else{
  101. PostQuitMessage(-1);
  102. }
  103. }
  104.  
  105. bool WGCL::Form::Register()
  106. {
  107. WNDCLASSEX wcex;
  108.  
  109. wcex.cbSize = sizeof(WNDCLASSEX);
  110. wcex.cbClsExtra = 0;
  111. wcex.cbWndExtra = 0;
  112. wcex.lpszClassName = ClassName;
  113. wcex.lpfnWndProc = WindowProc;
  114. wcex.hbrBackground = BGColor;
  115. wcex.hInstance = hInst;
  116. wcex.hIcon = Icon;
  117. wcex.hIconSm = SmIcon;
  118. wcex.hCursor = Cursor;
  119. wcex.style = CS_DBLCLKS;
  120. wcex.lpszMenuName = MenuName;
  121.  
  122. if(RegisterClassEx(&wcex))
  123. return true;
  124. else
  125. return false;
  126. }
  127.  
  128. bool WGCL::Form::Show()
  129. {
  130. _Window = CreateWindowEx(
  131. dwExStyle,
  132. ClassName,
  133. Title,
  134. dwStyle,
  135. x,
  136. y,
  137. width,
  138. height,
  139. NULL,
  140. Menu,
  141. hInst,
  142. lpParam
  143. );
  144. if(_Window != NULL)
  145. {
  146. return true;
  147. ShowWindow(_Window, SW_SHOW);
  148. UpdateWindow(_Window);
  149. }else{
  150. return false;
  151. }
  152. }
  153.  
  154. bool WGCL::Form::Show(int nCmdShow)
  155. {
  156. if(Created)
  157. {
  158. if(ShowWindow(_Window, nCmdShow) && UpdateWindow(_Window))
  159. return true;
  160. else
  161. return false;
  162. }else{
  163. return false;
  164. }
  165. }
  166.  
  167. bool WGCL::Form::Hide()
  168. {
  169. if(Created)
  170. {
  171. if(ShowWindow(_Window, SW_HIDE))
  172. return true;
  173. else
  174. return false;
  175. }else{
  176. return false;
  177. }
  178. }
  179.  
  180. bool WGCL::Form::Destroy()
  181. {
  182. if(Created)
  183. {
  184. if(DestroyWindow(_Window))
  185. return true;
  186. else
  187. return false;
  188. }else{
  189. return false;
  190. }
  191. }
  192.  
  193. bool WGCL::Form::SetPos(int cx, int cy, int cwidth, int cheight)
  194. {
  195. if(Created)
  196. {
  197. if(SetWindowPos(_Window, NULL, cx, cy, cwidth, cheight, NULL) && UpdateWindow(_Window))
  198. return true;
  199. else
  200. return false;
  201. }else{
  202. return false;
  203. }
  204. }

Here is the errors:

------ Build started: Project: WGCL, Configuration: Debug Win32 ------
Compiling...
WGCL.cpp
Linking...
WGCL.obj : error LNK2028: unresolved token (0A000011) "extern "C" int __stdcall SetWindowPos(struct HWND__ *,struct HWND__ *,int,int,int,int,unsigned int)" (?SetWindowPos@@$$J228YGHPAUHWND__@@0HHHHI@Z) referenced in function "public: bool __thiscall WGCL::Form::SetPos(int,int,int,int)" (?SetPos@Form@WGCL@@$$FQAE_NHHHH@Z)
WGCL.obj : error LNK2028: unresolved token (0A000012) "extern "C" int __stdcall DestroyWindow(struct HWND__ *)" (?DestroyWindow@@$$J14YGHPAUHWND__@@@Z) referenced in function "public: bool __thiscall WGCL::Form::Destroy(void)" (?Destroy@Form@WGCL@@$$FQAE_NXZ)
WGCL.obj : error LNK2028: unresolved token (0A000013) "extern "C" int __stdcall UpdateWindow(struct HWND__ *)" (?UpdateWindow@@$$J14YGHPAUHWND__@@@Z) referenced in function "public: bool __thiscall WGCL::Form::Show(int)" (?Show@Form@WGCL@@$$FQAE_NH@Z)
WGCL.obj : error LNK2028: unresolved token (0A000014) "extern "C" int __stdcall ShowWindow(struct HWND__ *,int)" (?ShowWindow@@$$J18YGHPAUHWND__@@H@Z) referenced in function "public: bool __thiscall WGCL::Form::Show(int)" (?Show@Form@WGCL@@$$FQAE_NH@Z)
WGCL.obj : error LNK2028: unresolved token (0A000015) "extern "C" struct HWND__ * __stdcall CreateWindowExW(unsigned long,wchar_t const *,wchar_t const *,unsigned long,int,int,int,int,struct HWND__ *,struct HMENU__ *,struct HINSTANCE__ *,void *)" (?CreateWindowExW@@$$J248YGPAUHWND__@@KPB_W0KHHHHPAU1@PAUHMENU__@@PAUHINSTANCE__@@PAX@Z) referenced in function "private: bool __thiscall WGCL::Form::Show(void)" (?Show@Form@WGCL@@$$FAAE_NXZ)
WGCL.obj : error LNK2028: unresolved token (0A000016) "extern "C" unsigned short __stdcall RegisterClassExW(struct tagWNDCLASSEXW const *)" (?RegisterClassExW@@$$J14YGGPBUtagWNDCLASSEXW@@@Z) referenced in function "private: bool __thiscall WGCL::Form::Register(void)" (?Register@Form@WGCL@@$$FAAE_NXZ)
WGCL.obj : error LNK2028: unresolved token (0A000017) "extern "C" void __stdcall PostQuitMessage(int)" (?PostQuitMessage@@$$J14YGXH@Z) referenced in function "public: __thiscall WGCL::Form::Form(unsigned long,wchar_t const *,int,int,int,int)" (??0Form@WGCL@@$$FQAE@KPB_WHHHH@Z)
WGCL.obj : error LNK2019: unresolved external symbol "extern "C" unsigned short __stdcall RegisterClassExW(struct tagWNDCLASSEXW const *)" (?RegisterClassExW@@$$J14YGGPBUtagWNDCLASSEXW@@@Z) referenced in function "private: bool __thiscall WGCL::Form::Register(void)" (?Register@Form@WGCL@@$$FAAE_NXZ)
WGCL.obj : error LNK2019: unresolved external symbol "extern "C" struct HWND__ * __stdcall CreateWindowExW(unsigned long,wchar_t const *,wchar_t const *,unsigned long,int,int,int,int,struct HWND__ *,struct HMENU__ *,struct HINSTANCE__ *,void *)" (?CreateWindowExW@@$$J248YGPAUHWND__@@KPB_W0KHHHHPAU1@PAUHMENU__@@PAUHINSTANCE__@@PAX@Z) referenced in function "private: bool __thiscall WGCL::Form::Show(void)" (?Show@Form@WGCL@@$$FAAE_NXZ)
WGCL.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall UpdateWindow(struct HWND__ *)" (?UpdateWindow@@$$J14YGHPAUHWND__@@@Z) referenced in function "public: bool __thiscall WGCL::Form::Show(int)" (?Show@Form@WGCL@@$$FQAE_NH@Z)
WGCL.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall ShowWindow(struct HWND__ *,int)" (?ShowWindow@@$$J18YGHPAUHWND__@@H@Z) referenced in function "public: bool __thiscall WGCL::Form::Show(int)" (?Show@Form@WGCL@@$$FQAE_NH@Z)
WGCL.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall DestroyWindow(struct HWND__ *)" (?DestroyWindow@@$$J14YGHPAUHWND__@@@Z) referenced in function "public: bool __thiscall WGCL::Form::Destroy(void)" (?Destroy@Form@WGCL@@$$FQAE_NXZ)
WGCL.obj : error LNK2019: unresolved external symbol "extern "C" int __stdcall SetWindowPos(struct HWND__ *,struct HWND__ *,int,int,int,int,unsigned int)" (?SetWindowPos@@$$J228YGHPAUHWND__@@0HHHHI@Z) referenced in function "public: bool __thiscall WGCL::Form::SetPos(int,int,int,int)" (?SetPos@Form@WGCL@@$$FQAE_NHHHH@Z)
WGCL.obj : error LNK2019: unresolved external symbol "extern "C" void __stdcall PostQuitMessage(int)" (?PostQuitMessage@@$$J14YGXH@Z) referenced in function "public: __thiscall WGCL::Form::Form(unsigned long,wchar_t const *,int,int,int,int)" (??0Form@WGCL@@$$FQAE@KPB_WHHHH@Z)
C:\Users\Brandon\Documents\Visual Studio 2008\Projects\WGCL\Debug\WGCL.dll : fatal error LNK1120: 14 unresolved externals
Build log was saved at "file://c:\Users\Brandon\Documents\Visual Studio 2008\Projects\WGCL\Debug\BuildLog.htm"
WGCL - 15 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Please, this is the oddest thing ever to happen to me in programming so far.
Does anyone have some tips for me or somthing, I've gotta get this fixed.
Last edited by killdude69; Oct 13th, 2008 at 10:51 am.
Reply With Quote Quick reply to this message  
Join Date: Sep 2004
Posts: 7,740
Reputation: Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute Narue has a reputation beyond repute 
Solved Threads: 739
Team Colleague
Narue's Avatar
Narue Narue is offline Offline
Code Goddess

Re: Jiberish Visual C++ Errors Un-Understandable

 
1
  #2
Oct 13th, 2008
Unresolved symbol errors typically mean you aren't linking with the correct libraries. Those symbols are all part of the Win32 API, so your project settings for external libraries are probably incorrect.
I'm here to prove you wrong.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 2,001
Reputation: ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of ArkM has much to be proud of 
Solved Threads: 343
ArkM's Avatar
ArkM ArkM is offline Offline
Postaholic

Re: Jiberish Visual C++ Errors Un-Understandable

 
0
  #3
Oct 13th, 2008
Probably it's user32.lib from Windows SDK lib directory...
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 45
Reputation: killdude69 is an unknown quantity at this point 
Solved Threads: 1
killdude69 killdude69 is offline Offline
Light Poster

Re: Jiberish Visual C++ Errors Un-Understandable

 
0
  #4
Oct 13th, 2008
Originally Posted by Narue View Post
Unresolved symbol errors typically mean you aren't linking with the correct libraries. Those symbols are all part of the Win32 API, so your project settings for external libraries are probably incorrect.
Well how do you link a library in Visual C++ 2008 Express?
And what libraries should I link? I thought commctl32.dll is linked by default.
Thanks in advance.
Reply With Quote Quick reply to this message  
Join Date: Jul 2008
Posts: 45
Reputation: killdude69 is an unknown quantity at this point 
Solved Threads: 1
killdude69 killdude69 is offline Offline
Light Poster

Re: Jiberish Visual C++ Errors Un-Understandable

 
0
  #5
Oct 13th, 2008
Originally Posted by ArkM View Post
Probably it's user32.lib from Windows SDK lib directory...
Ok, thanks, btw do you think tell were to go on VC++ to import the library.
Last edited by killdude69; Oct 13th, 2008 at 9:44 pm.
Reply With Quote Quick reply to this message  
Reply

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



Other Threads in the C++ Forum
Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC