I create a project of static lib, and write a basic win32 app. I want to static lib.
The project structure is following:
│ RSWL2GCC.cbp
│
├─Win
│ WinMain.h
│ WinMain.cpp
│
└─obj
└─Debug
└─Win
WinMain.h is defined:
#ifndef WINMAIN_H
#define WINMAIN_H
#include <windows.h>
namespace Win
{
int Main (INSTANCE inst, char const * cmdParam, int cmdShow);
}
#endif // WINMAIN_H
WinMain.cpp is defined:
#include <windows.h>
#include <Win/WinMain.h>
int WINAPI WinMain
(HINSTANCE hInst, HINSTANCE hPrevInst, LPSTR cmdParam, int cmdShow)
{
return Win::Main (hInst, cmdParam, cmdShow);
}
I build the project , get error message :
:: === RSWL2GCC, Debug ===
D:\CodeWorld\RSWL2GCC\Win\WinMain.cpp:2: Win/WinMain.h: No such file or directory
D:\CodeWorld\RSWL2GCC\Win\WinMain.cpp:7: error: `Win' has not been declared
D:\CodeWorld\RSWL2GCC\Win\WinMain.cpp:7: error: `Main' was not declared in this scope
D:\CodeWorld\RSWL2GCC\Win\WinMain.cpp:7: warning: unused variable 'Main'
:: === Build finished: 3 errors, 1 warnings ===
Why I failed ?