My compile Log:
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Dev-Cpp\1.2.cpp" -o "C:\Dev-Cpp\1.2.exe" -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:\Dev-Cpp\1.2.cpp:1: error: LRESULT' does not name a type
C:\Dev-Cpp\1.2.cpp:2:31: invalid suffix "Param" on integer constant
C:\Dev-Cpp\1.2.cpp:12:54: invalid suffix "Param" on integer constant
C:\Dev-Cpp\1.2.cpp:15: error:WINAPI' does not name a type
Execution terminated
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You have not included <windows.h> where such things as LRESULT and WINAPI are defined.
Do not put your projects or source in c:\dev-cpp. Apart from being a fundamentally bad idea to 'pollute' an application installation, it sometimes causes problems that prevent Dev-C++ from building the code.
The easiest way to get started with a Win32 GUI app is to start wit the provided Win32 GUI template project. It will ensure that all the correct compiler and linker settings are applied as well as providing a minimal Win32 framework to get you started. File->New->Project
Symbols in C/C++ may not start with a number (only alphabetic or underscore). On lines 2 and 12 you have 1Param where you meant lParam (lowercase-L and the number 1 are almost indistinguishable in Courier font, but context is usually sufficient to distinguish them. Unfortunately many programming books use Courier). Try using a programming font where such characters are more clearly distinguishable. I recommend Consolas ( http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&displaylang=en )
Symbols in C/C++ (or any other programming language I am aware of) cannot contain spaces. So you may want to reconsider this line:
Zero Memory(&msg, sizeof(msg));
Clifford
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ok theres my basic 3:
Dev Version 4.9.9.2 with windows 2002
I'm trying to create a window using the WinMain() function.
LRESULT WINAPI MsgProc(HWND hWnd, UINT msg, WPARAM wPARAM,
LPARAM 1Param)
{
switch(msg)
{
case WM_DESTROY:
PostQuitMessage(0);
return 0;
break;
}
3
Compiler: Default compiler
Executing g++.exe...
g++.exe "C:\Dev-Cpp\1.2.cpp" -o "C:\Dev-Cpp\1.2.exe" -I"C:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"C:\Dev-Cpp\include\c++\3.4.2\backward" -I"C:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"C:\Dev-Cpp\include\c++\3.4.2" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
C:\Dev-Cpp\1.2.cpp:1: error:
LRESULT' does not name a type C:\Dev-Cpp\1.2.cpp:2:31: invalid suffix "Param" on integer constant C:\Dev-Cpp\1.2.cpp:12:54: invalid suffix "Param" on integer constant C:\Dev-Cpp\1.2.cpp:15: error:
WINAPI' does not name a typeExecution terminated
You have not included <windows.h> where such things as LRESULT and WINAPI are defined.
Do not put your projects or source in c:\dev-cpp. Apart from being a fundamentally bad idea to 'pollute' an application installation, it sometimes causes problems that prevent Dev-C++ from building the code.
The easiest way to get started with a Win32 GUI app is to start wit the provided Win32 GUI template project. It will ensure that all the correct compiler and linker settings are applied as well as providing a minimal Win32 framework to get you started. File->New->Project
Symbols in C/C++ may not start with a number (only alphabetic or underscore). On lines 2 and 12 you have 1Param where you meant lParam (lowercase-L and the number 1 are almost indistinguishable in Courier font, but context is usually sufficient to distinguish them. Unfortunately many programming books use Courier). Try using a programming font where such characters are more clearly distinguishable. I recommend Consolas ( http://www.microsoft.com/downloads/details.aspx?familyid=22e69ae4-7e40-4807-8a86-b3d36fab68d3&displaylang=en )
Symbols in C/C++ (or any other programming language I am aware of) cannot contain spaces. So you may want to reconsider this line:
Zero Memory(&msg, sizeof(msg));
Clifford