Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

saisoft

Visual C++ errors

This topic is 6338 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

I have three source files: main.cpp contains my WinMain function. SlickDef.h contains the following: #ifndef SLICK_DEF__H #define SLICK_DEF__H LRESULT CALLBACK WinProc(HWND,UINT,WPARAM,LPARAM); BOOL CALLBACK DialogProc(HWND,UINT,WPARAM,LPARAM); #endif SlickDef.cpp contains: the WinProc and DialogProc Procedures, plus a few other structures. In main.cpp, the top order of includes is like this: #include #include "SlickDef.h" #define WIN32_LEAN_AND_MEAN When I try to build the app, it gives me these errors: Compiling... main.cpp SlickDef.cpp c:\slickedit\slickdef.h(6) : error C2146: syntax error : missing '';'' before identifier ''CALLBACK'' c:\slickedit\slickdef.h(6) : error C2501: ''LRESULT'' : missing storage-class or type specifiers c:\slickedit\slickdef.h(6) : fatal error C1004: unexpected end of file found Error executing cl.exe. SlickEdit.exe - 3 error(s), 0 warning(s) I did look at MSDN and they did say something about the order of your defines or includes, but I have tried everything and I can''t get it to work. If everything is under one source file it is ok, its when I break it up that I get all these problems. If anyone has any solutions, let me know, thanks.

Share this post


Link to post
Share on other sites
Advertisement
Your includes should probably follow this order:

define WIN32_LEAN_AND_MEAN
include windows.h
include yourstuff.h
etc...

I only missed out brackets/hashes so it would appear correctly
in the browser.

-Mezz

Share this post


Link to post
Share on other sites
When I do that, I get these errors:
compiling...
main.cpp
C:\SlickEdit\main.cpp(8) : error C2146: syntax error : missing '';'' before identifier ''openFileName_t''
C:\SlickEdit\main.cpp(8) : fatal error C1004: unexpected end of file found
SlickDef.cpp
c:\slickedit\slickdef.h(6) : error C2146: syntax error : missing '';'' before identifier ''CALLBACK''
c:\slickedit\slickdef.h(6) : error C2501: ''LRESULT'' : missing storage-class or type specifiers
c:\slickedit\slickdef.h(6) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

SlickEdit.exe - 5 error(s), 0 warning(s)


Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!