Question

I use premake4.exe utility for generate project files for different platforms. The problem is that I could not find how to specify custom application entry point in lua-config file.

Which option should I use? For example, in Visual Studio I can go to

Project Properties->Linker->Advanced
Entry Point  = name_of_my_entry_point_function

In premake4 manual (http://industriousone.com/flags) I found only WinMain() flag that determinate WinMain function as application entry point, but I need custom entry point for example like a wmain().

Was it helpful?

Solution

There is no field to specify a custom entrypoint in Premake4. Indeed, I'm not sure that GCC even allows a custom entrypoint, so it would be platform-specific.

But, since you're being platform-specific, you can always just specify additional command-line arguments. For example:

configuration { "vc2008" }
  linkoptions { "/ENTRY:<function name here>" }

BTW, it should be noted that the MSDN docs for this seem to suggest that using it will not properly initialize global static objects. So use this with care. For more information, see What is the difference between main and mainCRTStartup?

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top