Sign in to follow this  

'mrError32' : missing storage-class or type specifiers

This topic is 4586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

A program copied from DE SOUSAs book has 2 errors: 1.'mrError32' : missing storage-class or type specifiers Error executing cl.exe. 2. Syntax error : missing ';' before identifier 'Create' in: mrError32 Create (HINSTANCE hInstance, LPSTR szTitle, mrInt iWidth = CW_USEDEFAULT, mrInt iHeight = CW_USEDEFAULT, mrUInt32 istyle = WS_OVERLAPPEDWINDOW | WS_VISIBLE); static LRESULT CALLBACK WndProc (HWND hWindow, UINT iMessage, WPARAM wParam, LPARAM lParam); What do you think may be wrong? I installed Direct SDK properly. Thanks for your help in advance!

Share this post


Link to post
Share on other sites
I included that file straight to main.cpp and got slightly more erros
(this is from linking):

02 Main.obj : error LNK2001: unresolved external symbol _Direct3DCreate8@4
02 Main.obj : error LNK2001: unresolved external symbol "public: void __thiscall mrWindow::Run(void)" (?Run@mrWindow@@QAEXXZ)
02 Main.obj : error LNK2001: unresolved external symbol "public: enum mrError32 __thiscall mrWindow::Create(struct HINSTANCE__ *,char *,int,int,unsigned long)" (?Create@mrWindow@@QAE?AW4mrError32@@PAUHINSTANCE__@@PADHHK@Z)
02 Main.obj : error LNK2001: unresolved external symbol "public: virtual enum mrBool32 __thiscall mrWindow::MessageHandler(unsigned int,unsigned int,long)" (?MessageHandler@mrWindow@@UAE?AW4mrBool32@@IIJ@Z)
02 Main.obj : error LNK2001: unresolved external symbol "public: __thiscall mrWindow::mrWindow(void)" (??0mrWindow@@QAE@XZ)
02 Main.obj : error LNK2001: unresolved external symbol "public: __thiscall mrWindow::~mrWindow(void)" (??1mrWindow@@QAE@XZ)
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/02 Main.exe : fatal error LNK1120: 7 unresolved externals
Error executing link.exe.

What does it all mean?

Share this post


Link to post
Share on other sites
Quote:
Original post by Plewna Plewa
I included that file straight to main.cpp and got slightly more erros
(this is from linking):

<snip>

What does it all mean?


It means, most likely, that the header file you included also contains the declaration of such things as mrWindow, which is used in your Main.cpp file, but you never copied and compiled the actual implementation code for mrWindow.

Share this post


Link to post
Share on other sites
I thought that when I compile a project which consist of several files, VC++ will care that all of them shall be properly compiled and linked.

Nevertheless I tried what you suggested compiling all files from my project with .cpp extension. Now I got such errors:

Linking...
02 Main.obj : error LNK2001: unresolved external symbol _Direct3DCreate8@4
LIBCD.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
Debug/02 Main.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

02 Main.exe - 3 error(s), 0 warning(s)


(I may send you this stuff if u like)

Share this post


Link to post
Share on other sites
The first thing means that you aren't linking with DirectX libraries.

The second thing means your main function signature is wrong, I think.

The third thing will automagically go away when you fix the first two.

Share this post


Link to post
Share on other sites
I set lib and include paths from DirectX SDK properly. Also I commented all winmain leaving only declaration and return value. Situation the same.

Besides author of this book somehow managed to compile this (i got compiled version from him) :(

Share this post


Link to post
Share on other sites
To get rid of error LNK2001: unresolved external symbol _Direct3DCreate8@4 you must link with d3d8.lib. You said that you have already set up the paths, so go to project->settings and in the Link tab add d3d8.lib to the end of the Object/modules edit box.

You are getting error LNK2001: unresolved external symbol _main because you've created the wrong type of project. In this case you've created a Win32 Console Application instead of a Win32 Application. While still in the Link tab of the project->settings window, look through the Project Settings edit box until you find /subsystem:console. Change this part to /subsystem:windows.

As vovansim said, once you've fixed those the last error message will go away.

Share this post


Link to post
Share on other sites

This topic is 4586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this