Advertisement

Visual C++ errors

Started by January 14, 2001 01:58 PM
1 comment, last by saisoft 24 years ago
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.
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
Advertisement
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)


This topic is closed to new replies.

Advertisement