Cannot Build in Release

Monkey Forums/Monkey Beginners/Cannot Build in Release

Kedric(Posted May) [#1]
Would someone be able to help me with this? I know it's been a while since I've used a Blitz language, but I'm stumped. I can compile and run a desktop app in Debug mode, but not Release.
TRANS monkey compiler V1.87
Parsing...
Semanting...
Translating...
Building...
g++  -m32  -O3 -DNDEBUG -Wno-free-nonheap-object -I../glfw3/include -I../glfw3/src -I../openal/include -I../stb -I../zlib-1.2.8 -I../lpng1610 -c -o build/Release32/main.o ../main.cpp
g++ -m32  -Wl,--subsystem,windows -L../openal/libs/Win32 -L../openal/libs/Win64 -o Release32/MonkeyGame build/Release32/context.o build/Release32/init.o build/Release32/input.o build/Release32/monitor.o build/Release32/wgl_context.o build/Release32/win32_init.o build/Release32/win32_monitor.o build/Release32/win32_time.o build/Release32/win32_tls.o build/Release32/win32_window.o build/Release32/window.o build/Release32/winmm_joystick.o build/Release32/stb_vorbis.o build/Release32/stb_image.o build/Release32/main.o -lcomdlg32 -lgdi32 -lopengl32 -lOpenAL32 -lws2_32
build/Release32/init.o:init.c:(.text+0x49): undefined reference to `__ms_vsnprintf'
collect2.exe: error: ld returned 1 exit status
Makefile:49: recipe for target 'Release32/MonkeyGame' failed
mingw32-make: *** [Release32/MonkeyGame] Error 1
TRANS FAILED: Error executing 'mingw32-make CCOPTS=" -m32  -O3 -DNDEBUG" LDOPTS=" -m32 " OUT="Release32/MonkeyGame"', return code=2

I'm running Windows 10 64-bit with MinGW 4.9.2.


dawlane(Posted May) [#2]
Sounds like that there is a installation problem with MinGW. You sometimes see this when there are two incompatible version of MinGW installed e.g. MinGW64 and MinGW-W64.
The solution is to remove MinGW and install (TDM-32/64 or MinGW-W64) and make a few modifications to the makefile template to allow the use of TDM/WinGW versions 5.1.x. Or Install one of the Visual Studio compilers.
See here. for how to fix the lib issues when using MinGW 5.1.x.

You should also delete any build directory that was create.


EdzUp(Posted May) [#3]
[quote]
TRANS FAILED: Error executing 'mingw32-make CCOPTS=" -m32 -O3 -DNDEBUG" LDOPTS=" -m32 " OUT="Release32/MonkeyGame"', return code=2
[/code]

Its this line that tells me that you need to search for the CCOPTS fixes that are on the forum, I fixed it by deleting the build folder when I had the issue.

Look at the following link it might help
http://www.monkey-x.com/Community/posts.php?topic=9265&post=99857&view=all#99857

It happens when the build is incompatible with the one your trying to compile so the .o files dont match deleting the build folder forces it to recompile the whole thing again and then it uses the correct files.