[SOLVED] Problem compiling to Windows

Hi,
I have had some problems with C++ compiler, I installed VS Community but compilation didn’t work, so I installed the good old VS2010 Express and everything seemed to work ok, I managed to compile an empty project and then I went to sleep.

Tonight I tried to compile again (after a “clean project”), the same project, and I obtained this result

Running process: C:\HaxeDevelop\Tools\fdbuild\fdbuild.exe "D:\Code test\OpenFl\windows\windows.hxproj" -ipc e52ab9ce-0a18-4efb-8daa-2a77c6a8e948 -version "3.4.7" -compiler "C:\HaxeToolkit\haxe" -library "C:\HaxeDevelop\Library" -target "windows"
Building windows
Running Pre-Build Command Line...
cmd: "C:\HaxeToolkit\haxe/haxelib" run lime build "project.xml" windows -debug -Dfdb
Creating D:/Code test/OpenFl/windows/bin/windows/obj/obj/msvc16-debug-ncxp/__pch/haxe/hxcpp.pch...
hxcpp.cpp

Compiling group: haxe
cl.exe -Iinclude -nologo -DHX_WINDOWS -GR -Od(optim-std) -Zi(optim-std) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(optim-std) -Zi(debug) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 ... tags=[haxe,static]
 - src/sys/io/Process.cpp 
 - src/sys/io/_Process/Stdout.cpp 
 - src/sys/io/_Process/Stdin.cpp 
 - src/sys/FileSystem.cpp 
 - src/haxe/lang/Iterable.cpp 
 - src/haxe/lang/Iterator.cpp 
 - src/openfl/utils/_Object/Object_Impl_.cpp 
 - src/openfl/utils/_Endian/Endian_Impl_.cpp 
 - src/openfl/utils/_CompressionAlgorithm/CompressionAlgorithm_Impl_.cpp 
 - src/openfl/utils/ByteArrayData.cpp  [haxe,release]
 - src/openfl/utils/IDataInput.cpp 
[...]
 - src/ApplicationMain.cpp 
 - src/lime/app/Application.cpp  [haxe,release]
 - src/lime/_backend/native/NativeApplication.cpp  [haxe,release]
 - src/lime/_backend/native/NativeCFFI.cpp  [haxe,release]
 - src/cpp/Prime.cpp 
 - src/lime/app/Module.cpp  [haxe,release]
 - src/lime/app/IModule.cpp 
 - src/__boot__.cpp 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/src/hx/NoFiles.cpp 
 - src/__resources__.cpp 

and it stopped doing anything.
I stopped the process and restarted the compilation:

Running process: C:\HaxeDevelop\Tools\fdbuild\fdbuild.exe "D:\Code test\OpenFl\windows\windows.hxproj" -ipc e52ab9ce-0a18-4efb-8daa-2a77c6a8e948 -version "3.4.7" -compiler "C:\HaxeToolkit\haxe" -library "C:\HaxeDevelop\Library" -target "windows"
Building windows
Running Pre-Build Command Line...
cmd: "C:\HaxeToolkit\haxe/haxelib" run lime build "project.xml" windows -debug -Dfdb
Creating D:/Code test/OpenFl/windows/bin/windows/obj/obj/msvc16-debug-ncxp/__pch/haxe/hxcpp.pch...
hxcpp.cpp

Compiling group: haxe
cl.exe -Iinclude -nologo -DHX_WINDOWS -GR -Od(optim-std) -Zi(optim-std) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(optim-std) -Zi(debug) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 ... tags=[haxe,static]
 - src/lime/utils/AssetCache.cpp  [haxe,release]
 - src/ApplicationMain.cpp 

Compiling group: __main__
cl.exe -Iinclude -DHX_DECLARE_MAIN -nologo -DHX_WINDOWS -GR -Od(optim-std) -Zi(optim-std) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(optim-std) -Zi(debug) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 ... tags=[haxe,main,static]
 - src/__main__.cpp 

Compiling group: __resources__
cl.exe -nologo -DHX_WINDOWS -GR -Od(optim-std) -Zi(optim-std) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(optim-std) -Zi(debug) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 ... tags=[haxe]
 - src/resources/__res_0.cpp  [optim-none]
Creating D:/Code test/OpenFl/windows/bin/windows/obj/obj/msvc16-debug-ncxp/__pch/runtime/hxcpp.pch...
hxcpp.cpp

Compiling group: runtime
cl.exe -D_CRT_SECURE_NO_DEPRECATE -DHX_UNDEFINE_H -nologo -DHX_WINDOWS -GR -Od(optim-std) -Zi(optim-std) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(optim-std) -Zi(debug) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 ... tags=[haxe]
 - src/hx/Anon.cpp 
 - src/hx/Boot.cpp 
 - src/hx/CFFI.cpp  [haxe,static]
 - src/hx/gc/GcCommon.cpp  [haxe,gc]
 - src/hx/Date.cpp 
 - src/hx/gc/Immix.cpp  [haxe,gc]
 - src/hx/gc/GcRegCapture.cpp  [haxe,gc]
 - src/hx/Hash.cpp 
 - src/hx/Interface.cpp 
 - src/hx/Lib.cpp  [haxe,static]
 - src/hx/Object.cpp 
 - src/hx/StdLibs.cpp  [haxe,static]
 - src/hx/Debug.cpp 
 - src/hx/Thread.cpp 
 - src/Array.cpp 
 - src/hx/Class.cpp 
 - src/Dynamic.cpp 
 - src/Enum.cpp 
 - src/Math.cpp 
 - src/String.cpp  [haxe,hxstring]

Compiling group: hxcpp_regexp
cl.exe -DPCRE_STATIC -DSUPPORT_UTF8 -DSUPPORT_UCP -DNO_RECURSE -IC:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8 -nologo -DHX_WINDOWS -GR -Od(optim-std) -Zi(optim-std) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(optim-std) -Zi(debug) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 ... tags=[haxe,static]
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_get.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_study.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/src/hx/libs/regexp/RegExp.cpp 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_chartables.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_globals.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_tables.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_compile.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_info.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_try_flipped.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_config.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_maketables.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_ucd.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_dfa_exec.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_newline.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_valid_utf8.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_exec.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_ord2utf8.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_version.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_fullinfo.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_refcount.c 
 - C:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/project/thirdparty/pcre-7.8/pcre_xclass.c 

Compiling group: hxcpp_std
cl.exe -nologo -DHX_WINDOWS -GR -Od(optim-std) -Zi(optim-std) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(optim-std) -Zi(debug) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 ... tags=[haxe,static]
 - Sys.cpp 
 - File.cpp 
 - Process.cpp 
 - Socket.cpp 
 - Random.cpp 
Link: ApplicationMain-debug.exe
obj/msvc16-debug-ncxp/ea84b922_NativeCFFI.obj : fatal error LNK1136: invalid or corrupt file

obj/msvc16-debug-ncxp/ea84b922_NativeCFFI.obj : fatal error LNK1000: Internal error during IMAGE::Pass1

  Version 10.00.30319.01

  ExceptionCode            = C0000005
  ExceptionFlags           = 00000000
  ExceptionAddress         = 77012104 (76FD0000) "C:\WINDOWS\SYSTEM32\ntdll.dll"
  NumberParameters         = 00000002
  ExceptionInformation[ 0] = 00000000
  ExceptionInformation[ 1] = 00007FFF

CONTEXT:
  Eax    = 00830798  Esp    = 0078E610
  Ebx    = 00008000  Ebp    = 0078E650
  Ecx    = 770120A0  Esi    = 028C0000
  Edx    = 00000053  Edi    = 00000000
  Eip    = 77012104  EFlags = 00010246
  SegCs  = 00000023  SegDs  = 0000002B
  SegSs  = 0000002B  SegEs  = 0000002B
  SegFs  = 00000053  SegGs  = 0000002B
  Dr0    = 00000000  Dr3    = 00000000
  Dr1    = 00000000  Dr6    = 00000000
  Dr2    = 00000000  Dr7    = 00000000
CTIPlugin::InvokeCallback=APPCRASHCTIPlugin::InvokeCallback=APPCRASHCTIPlugin::InvokeCallback=APPCRASH
Build halted with errors.
Done(1)

Can you see where the problem is? I can’t… :cold_sweat:

Latest libs, I updated hxcpp to 4.0.4 too but the result was the same, so I tried to fix by going back to 3.4.188, this is why you see that version number.

The new HXCPP release should support VS Community 2017 out of the box now, so perhaps try updating Visual Studio again? :sweat:

if you put something in assets folder this issue will stop

No, it doesn’t work… same error… :cold_sweat:

Is this folder structure correct?
folders

Delete the obj file that’s causing the error, or do a -clean build now that you changed your VS version

I have deleted ea84b922_NativeCFFI.obj, but now it stops at

Running process: C:\HaxeDevelop\Tools\fdbuild\fdbuild.exe "D:\Code test\OpenFl\windows\windows.hxproj" -ipc 47f0943f-afa5-47d9-8510-35a0dc454d64 -version "3.4.7" -compiler "C:\HaxeToolkit\haxe" -library "C:\HaxeDevelop\Library" -target "windows"
Building windows
Running Pre-Build Command Line...
cmd: "C:\HaxeToolkit\haxe/haxelib" run lime build "project.xml" windows -debug -Dfdb
Creating D:/Code test/OpenFl/windows/bin/windows/obj/obj/msvc16-debug-ncxp/__pch/haxe/hxcpp.pch...
hxcpp.cpp

Compiling group: haxe
cl.exe -Iinclude -nologo -DHX_WINDOWS -GR -Od(optim-std) -Zi(optim-std) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(optim-std) -Zi(debug) -FdD:\Code test\OpenFl\windows\bin\windows\obj\obj/msvc16-debug-ncxp/vc.pdb(debug) -Od(debug) -O2(release) -Os(optim-size) -Oy- -c -EHs -GS- -arch:SSE2 -IC:/HaxeToolkit/haxe/lib/hxcpp/3,4,188/include -DHXCPP_DEBUG -DHXCPP_VISIT_ALLOCS(haxe) -DHXCPP_API_LEVEL=331(haxe) -D_CRT_SECURE_NO_DEPRECATE -D_ALLOW_MSC_VER_MISMATCH -D_ALLOW_ITERATOR_DEBUG_LEVEL_MISMATCH -DHX_WIN_MAIN(main) -wd4996 ... tags=[haxe,static]
 - src/lime/_backend/native/NativeCFFI.cpp  [haxe,release]
 - src/lime/utils/AssetCache.cpp  [haxe,release]
 - src/ApplicationMain.cpp

maybe because it doesn’t find ea84b922_NativeCFFI.obj anymore?


EDIT: I still have VS Express 2010

Looks like it’s working, or do a -clean build if you’re unsure

But it doesn’t go over that point.

Now I have launched compilation with -clean, but I’ve already used “clean project” in the previous try.


EDIT : same behaviour as before…

I wonder what has changed recently, in the past it worked flawlessly… :thinking:

The only thing I can recommend is a newer Visual Studio version, I’ve been using VS Community 2017 for a long time and it’s worked fine (once HXCPP was patched to support it, but that’s been released)

EDIT: Or you could try the older HXCPP release with the older Visual Studio, might work too. Could try another sample/test project on it as well, to see if that works?

HXCPP 4.0.4 + VS Community work, but… :exploding_head: