Jump to content

Disable console on release?


photo

Recommended Posts

you are using debug version of engine, release version don't have a separate log console window.

 

I guess you are talking about a command line console window like Command Propmt

Link to comment

you are using debug version of engine, release version don't have a separate log console window.

 

Well... I am building my app under Visual Studio. Debug version depends on Unigine_x86d.lib, Release — on Unigine_x86.lib. I taked all .lib's and .dll's from Unigine as they was (I didn't rebuild them). What else could I do to use Release version of Unigine?

Link to comment

How can I disable log and system consoles in my unigine-based application?

 

Try changing your project linker subsystem type from CONSOLE to WINDOWS to suppress windows console window. More details can be found on the web (e.g. here)

Link to comment

Please specify in details how you run your Unigine-based application (command line options, etc)

I copied main.cpp and main.vcproj from Unigine/source/app/main to my project folder.

Then I created bin/ folder and added there 4 Unigine*.dll's.

Then I created lib/ folder and added there 4 Unigine*.lib's.

Then I tuned project. Here is command line of project's C/C++ compiler (release):

/I".\include" /Zi /nologo /Wall /WX- /MP /Ox /Oi /Os /Oy /Gm- /EHsc /GS /fp:fast /Zc:wchar_t /Zc:forScope /Fp".\obj\r\mm.pch" /Fa".\obj\r\" /Fo".\obj\r\" /Fd".\obj\r\vc100.pdb" /Gd /wd"4514" /wd"4710" /analyze- /errorReport:queue

And here is command line of project's linker (release):

/OUT:".\bin\mm.exe" /NOLOGO /LIBPATH:".\lib" "Unigine_x86.lib" "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" /MANIFEST /ManifestFile:".\obj\r\mm.exe.intermediate.manifest" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /PDB:".\bin\mm.pdb" /PGD:".\bin\mm.pgd" /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 /ERRORREPORT:QUEUE

Also in main.cpp I set as unigine parameters custom paths to data/ and .cfg file.

 

Try changing your project linker subsystem type from CONSOLE to WINDOWS to suppress windows console window. More details can be found on the web (e.g. here)

As a result I have

MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16

 

A think it's Unigine console window, not the Windows.

Link to comment

MSVCRT.lib(crtexew.obj) : error LNK2001: unresolved external symbol _WinMain@16

 

If you choose "Win32 Application" you are required to have a WinMain entry function instead of main used in case of "Win32 Console Application". Something like

 

#include <windows.h>

int WINAPI WinMain(HINSTANCE d1, HINSTANCE d2, LPSTR d3, int d4)
{
   ....
}

 

instead of

 

#include <stdio.h>

main()
{
  ....
}

Link to comment

How do you run the application?

 

With builded mm.exe file or from Visual Studio. Unigine_x86.dll is required for run, not Unigine_x86d.dll.

 

If you choose "Win32 Application" you are required to have a WinMain entry function instead of main used in case of "Win32 Console Application". Something like<...>

 

It worked, thanks. But I would like to build my application without platform-specific features.

Link to comment

It worked, thanks. But I would like to build my application without platform-specific features.

 

Application main executable will always be platform-specific (same as libray linkage to Windows x86/x64 dll or Linux so etc). Simply use some #ifdef/#else pre-processor statements

Link to comment
×
×
  • Create New...