[Spice-devel] [PATCH win-agent 2/9] Revert "Revert "mingw: remove tMain use""

Arnon Gilboa agilboa at redhat.com
Sun May 13 04:10:06 PDT 2012


breaks vs build
1>LIBCMT.lib(wincrt0.obj) : error LNK2001: unresolved external symbol 
_WinMain at 16
1>Release\vdagent.exe : fatal error LNK1120: 1 unresolved externals
 
we may patch vsproj || ifdef || add this line to vdagent.cpp:
#pragma comment (linker, "/ENTRY:mainCRTStartup")

Marc-André Lureau wrote:
> This reverts commit 74af857e8e4a6240e9aac4a3d72aa0e5a443472b.
> ---
>  vdagent/vdagent.cpp     |    2 +-
>  vdservice/vdservice.cpp |    6 +++---
>  2 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/vdagent/vdagent.cpp b/vdagent/vdagent.cpp
> index 5cbe222..5ef0a18 100644
> --- a/vdagent/vdagent.cpp
> +++ b/vdagent/vdagent.cpp
> @@ -1355,7 +1355,7 @@ LRESULT CALLBACK VDAgent::wnd_proc(HWND hwnd, UINT message, WPARAM wparam, LPARA
>      return 0;
>  }
>  
> -int APIENTRY _tWinMain(HINSTANCE instance, HINSTANCE prev_instance, LPTSTR cmd_line, int cmd_show)
> +int main(int argc,char **argv)
>  {
>      VDAgent* vdagent = VDAgent::get();
>      vdagent->run();
> diff --git a/vdservice/vdservice.cpp b/vdservice/vdservice.cpp
> index 4701f5a..9c057bb 100644
> --- a/vdservice/vdservice.cpp
> +++ b/vdservice/vdservice.cpp
> @@ -1216,7 +1216,7 @@ void VDService::write_agent_control(uint32_t type, uint32_t opaque)
>      }
>  }
>  
> -int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
> +int main(int argc, char* argv[], char* envp[])
>  {
>      bool success = false;
>  
> @@ -1226,9 +1226,9 @@ int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
>      }
>      VDService* vdservice = VDService::get();
>      if (argc > 1) {
> -        if (lstrcmpi(argv[1], TEXT("install")) == 0) {
> +        if (strcmp(argv[1], "install") == 0) {
>              success = vdservice->install();
> -        } else if (lstrcmpi(argv[1], TEXT("uninstall")) == 0) {
> +        } else if (strcmp(argv[1], "uninstall") == 0) {
>              success = vdservice->uninstall();
>          } else {
>              printf("Use: vdservice install / uninstall\n");
>   



More information about the Spice-devel mailing list