WinMain entry point in .lib

This is a discussion on WinMain entry point in .lib within the Windows Programming forums, part of the Platform Specific Boards category; Hi all,
In my visual studio solution i have 2 projects. One is a Win32 App and the other is ...

WinMain entry point in .lib

Hi all,

In my visual studio solution i have 2 projects. One is a Win32 App and the other is a static lib. I want the static lib to have the winmain entry point in and not the win32 app. Everything builds fine and the win32 appp does successfully link with the library. However when i run the program the winmain entry point in the library never executes.

The Win32 app doesnt have an entry point no. However I believe it should have an entry point, because before i linked it with the library the compiler was complaining that there was no entry point defined. But once I linked it with the library it compiled fine.

I want to do this because im trying to program a piece of software that im coding a program and it may need to run on linux inthe near future aswell as windows. So the idea is to write the application completely OS independtly and all OS calls like the entry point will be handled through the library. So when its time to switch OS, I need to change the library and not the application.

I have a valid reason why im doing it, but it is difficult to explain why lol. It's basically so when it comes time to switch OS's i dont need to make changes to the main application because it is completely OS independenty and all of the OS dependency is done through the library which I can easily replace with the linux equivelent.

So the WinMain entry point would be replaced with in main to run on linux