Jump to content

Can not build a debug version without any optimization


photo

Recommended Posts

Posted

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...

Posted

Please take a look at output of scons run (both STDOUT and STDERR), usually it prints errors.

Posted

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

Posted

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'))

×
×
  • Create New...