Jump to content

Can not build a debug version without any optimization


photo

Recommended Posts

I need to add some objects in engine, so I changed SConstruct to following

	g_env.Append(CPPFLAGS = Split('/EHsc /W3 /wd4355 /wd4250 /fp:precise'))
	g_env.Append(LINKFLAGS = Split('/fixed:no /nodefaultlib:libcmt /incremental:no'))

	# debugging
	if g_debug:
		g_env.Append(CPPFLAGS = Split('/Zi'))
		g_env.Append(LINKFLAGS = Split('/debug'))
	else:
		g_env.Append(CPPFLAGS = Split('/Oxisy /Ob2 /GFAT'))
		g_env.Append(CPPDEFINES = Split('NDEBUG'))

this will allow me to build a engine version without any optimization, that will be much easier for debugging, but using lastest version of unigine, it always crash at start, if I use unmodified SConstruct file, everything works. BUT, with these optimization, how can I debug a program??? all values of variables are invisible...

Link to comment

I changed it to these

	g_env.Append(LINKFLAGS = Split('/fixed:no /nodefaultlib:libcmt /incremental:no'))

	# debugging
	if g_debug:
		g_env.Append(CPPFLAGS = Split('/Zi'))
		g_env.Append(LINKFLAGS = Split('/debug'))
	else:
		g_env.Append(CPPDEFINES = Split('NDEBUG'))

 

then it works

Link to comment

got the problem, the default stack size for debug version is too small, so it always stack overflow.

 

change the debug link flags to this:

g_env.Append(LINKFLAGS = Split('/debug /stack:2097152'))

Link to comment
×
×
  • Create New...