Closed quentin452 closed 8 months ago
after some adjustments like adding cl path, i had an issue again when building
Unable to open include file: 'windows.h': No such file or directory
build.xml from native/windows
<project name="native" default="windows" basedir=".">
<description>native</description>
<property name="home" value="../.."/>
<property environment="env"/>
<property name="path.to.cl" value="C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64"/>
<target name="windows" description="create windows native files">
<!-- native library -->
<exec command="${path.to.cl}/cl /I '${java.home}/include' /I '${java.home}/include/win32' /I '${env.FFMPEG_HOME}' /I '../headers' native.cpp /c /Fo: native.obj"/>
<exec command="${path.to.cl}/cl /I '../glfw/include' glfw.c /c /Fo: glfw.obj"/>
<exec command="${path.to.cl}/lib /nologo /out:native.lib native.obj glfw.obj"/>
<!-- native loaders -->
<exec command="${path.to.cl}/cl /I '${java.home}/include' /I '${java.home}/include/win32' windows.cpp native.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib strmiids.lib opengl32.lib /Fe: ../win64.exe /link /subsystem:windows /entry:mainCRTStartup"/>
<exec command="${path.to.cl}/cl /I '${java.home}/include' /I '${java.home}/include/win32' windows.cpp native.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib strmiids.lib opengl32.lib /Fe: ../win64c.exe /link /subsystem:console"/>
<exec command="${path.to.cl}/cl /I '${java.home}/include' /I '${java.home}/include/win32' /D_JF_SERVICE windows.cpp native.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib strmiids.lib opengl32.lib /Fe: ../win64s.exe /link /subsystem:console"/>
<!-- native cli loaders -->
<exec command="${path.to.cl}/cl /I '${java.home}/include' /I '${java.home}/include/win32' /D_JF_CLI windows.cpp native.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib strmiids.lib opengl32.lib /Fe: ../../bin/jfexecw.exe /link /subsystem:windows /entry:mainCRTStartup"/>
<exec command="${path.to.cl}/cl /I '${java.home}/include' /I '${java.home}/include/win32' /D_JF_CLI windows.cpp native.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib strmiids.lib opengl32.lib /Fe: ../../bin/jfexec.exe /link /subsystem:console"/>
<exec command="${path.to.cl}/cl /I '${java.home}/include' /I '${java.home}/include/win32' /D_JF_CLI /D_JF_DEBUG windows.cpp native.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib strmiids.lib opengl32.lib /Fe: ../../bin/jfexecwd.exe /link /subsystem:windows /entry:mainCRTStartup"/>
<exec command="${path.to.cl}/cl /I '${java.home}/include' /I '${java.home}/include/win32' /D_JF_CLI /D_JF_DEBUG windows.cpp native.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib strmiids.lib opengl32.lib /Fe: ../../bin/jfexecd.exe /link /subsystem:console"/>
<exec command="${path.to.cl}/cl /I '${java.home}/include' /I '${java.home}/include/win32' /D_JF_CLI /D_JF_DEBUG /D_JF_CLI_SERVICE windows.cpp native.lib user32.lib gdi32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib strmiids.lib opengl32.lib /Fe: ../../bin/jfexecsd.exe /link /subsystem:console"/>
<delete>
<fileset dir="." includes="*.obj"/>
</delete>
</target>
<target name="get-bin" description="download pre-built binaries">
<sequential>
<get src="http://javaforce.sourceforge.net/jf-bin-win64.zip" dest="${home}/jf-bin-win64.zip" usetimestamp="true"/>
<unzip src="${home}/jf-bin-win64.zip" dest="${home}"/>
</sequential>
</target>
<target name="zip-bin" description="zip pre-built binaries">
<zip destfile="${home}/jf-bin-win64.zip">
<fileset dir="${home}">
<include name="bin/*.exe"/>
<include name="native/*.exe"/>
</fileset>
</zip>
</target>
</project>
build logs
Windows PowerShell
Copyright (C) Microsoft Corporation. Tous droits réservés.
Testez le nouveau système multiplateforme PowerShell https://aka.ms/pscore6
PS C:\Users\iamacatfr\Desktop\github-intellidea\javaforce\native\windows> ant windows
Buildfile: C:\Users\iamacatfr\Desktop\github-intellidea\javaforce\native\windows\build.xml
windows:
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] native.cpp
[exec] native.cpp(1): fatal error C1083: Impossible d'ouvrir le fichier include : 'windows.h' : No such file or directory
[exec] Compilateur d'optimisation Microsoft (R) C/C++ version 19.38.33135 pour x64
[exec] Copyright (C) Microsoft Corporation. Tous droits réservés.
[exec]
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'C:\Program', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9027 : fichier source 'C:\Program' ignoré
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Files\Microsoft', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9027 : fichier source 'Files\Microsoft' ignoré
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Visual', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9027 : fichier source 'Visual' ignoré
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64', fichier obje
t pris par défaut
[exec] cl : Ligne de commande warning D9027 : fichier source 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64' ignoré
[exec] Result: 2
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] glfw.c
[exec] C:\Users\iamacatfr\Desktop\github-intellidea\javaforce\native\glfw\src\../include/GLFW/glfw3.h(103): fatal error C1083: Impossible d'ouvrir le fichier in
clude : 'stddef.h' : No such file or directory
[exec] Compilateur d'optimisation Microsoft (R) C/C++ version 19.38.33135 pour x64
[exec] Copyright (C) Microsoft Corporation. Tous droits réservés.
[exec]
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'C:\Program', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9027 : fichier source 'C:\Program' ignoré
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Files\Microsoft', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9027 : fichier source 'Files\Microsoft' ignoré
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Visual', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9027 : fichier source 'Visual' ignoré
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64', fichier obje
t pris par défaut
[exec] cl : Ligne de commande warning D9027 : fichier source 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64' ignoré
[exec] Result: 2
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] LINK : fatal error LNK1181: impossible d'ouvrir le fichier en entrée 'native.obj'
[exec] Result: 1181
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] windows.cpp
[exec] windows.cpp(12): fatal error C1083: Impossible d'ouvrir le fichier include : 'windows.h' : No such file or directory
[exec] Compilateur d'optimisation Microsoft (R) C/C++ version 19.38.33135 pour x64
[exec] Copyright (C) Microsoft Corporation. Tous droits réservés.
[exec]
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'C:\Program', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Files\Microsoft', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Visual', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64', fichier obje
t pris par défaut
[exec] Result: 2
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] windows.cpp
[exec] windows.cpp(12): fatal error C1083: Impossible d'ouvrir le fichier include : 'windows.h' : No such file or directory
[exec] Compilateur d'optimisation Microsoft (R) C/C++ version 19.38.33135 pour x64
[exec] Copyright (C) Microsoft Corporation. Tous droits réservés.
[exec]
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'C:\Program', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Files\Microsoft', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Visual', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64', fichier obje
t pris par défaut
[exec] Result: 2
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] windows.cpp
[exec] windows.cpp(12): fatal error C1083: Impossible d'ouvrir le fichier include : 'windows.h' : No such file or directory
[exec] Compilateur d'optimisation Microsoft (R) C/C++ version 19.38.33135 pour x64
[exec] Copyright (C) Microsoft Corporation. Tous droits réservés.
[exec]
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'C:\Program', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Files\Microsoft', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Visual', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64', fichier obje
t pris par défaut
[exec] Result: 2
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] windows.cpp
[exec] windows.cpp(12): fatal error C1083: Impossible d'ouvrir le fichier include : 'windows.h' : No such file or directory
[exec] Compilateur d'optimisation Microsoft (R) C/C++ version 19.38.33135 pour x64
[exec] Copyright (C) Microsoft Corporation. Tous droits réservés.
[exec]
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'C:\Program', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Files\Microsoft', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Visual', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64', fichier obje
t pris par défaut
[exec] Result: 2
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] windows.cpp
[exec] windows.cpp(12): fatal error C1083: Impossible d'ouvrir le fichier include : 'windows.h' : No such file or directory
[exec] Compilateur d'optimisation Microsoft (R) C/C++ version 19.38.33135 pour x64
[exec] Copyright (C) Microsoft Corporation. Tous droits réservés.
[exec]
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'C:\Program', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Files\Microsoft', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Visual', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64', fichier obje
t pris par défaut
[exec] Result: 2
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] windows.cpp
[exec] windows.cpp(12): fatal error C1083: Impossible d'ouvrir le fichier include : 'windows.h' : No such file or directory
[exec] Compilateur d'optimisation Microsoft (R) C/C++ version 19.38.33135 pour x64
[exec] Copyright (C) Microsoft Corporation. Tous droits réservés.
[exec]
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'C:\Program', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Files\Microsoft', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Visual', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64', fichier obje
t pris par défaut
[exec] Result: 2
[exec] The command attribute is deprecated.
[exec] Please use the executable attribute and nested arg elements.
[exec] windows.cpp
[exec] windows.cpp(12): fatal error C1083: Impossible d'ouvrir le fichier include : 'windows.h' : No such file or directory
[exec] Compilateur d'optimisation Microsoft (R) C/C++ version 19.38.33135 pour x64
[exec] Copyright (C) Microsoft Corporation. Tous droits réservés.
[exec]
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'C:\Program', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Files\Microsoft', fichier objet pris par défaut
[exec] cl : Ligne de commande warning D9024 : type de fichier source non reconnu 'Studio\2022\Community\VC\Tools\MSVC\14.38.33130\bin\Hostx64\x64', fichier obje
t pris par défaut
[exec] Result: 2
BUILD SUCCESSFUL
Total time: 0 seconds
PS C:\Users\iamacatfr\Desktop\github-intellidea\javaforce\native\windows>
The VisualC++ compiler requires lots of environment variables (like INCLUDE and LIB).
After you install VisualC++ Build Tools there should be items in the start menu called "Developer Command Prompt".
This should setup the required variables.
Then run ant from this folder (which needs Java and ant in your path as well).
I use a lot of complex scripts to setup my build environment. Look for vcvars64.bat within VC++ which you can also run to setup the environment.
Thanks,
I'll see if I can modify the ant task to look for VC++ automatically and make this runnable from an IDE.
But for now try the "Developer Command Prompt".
There are pre-built natives available. Run "ant get-bin" in this folder to download from sourceforge.
Thanks,
I've updated the readme.txt file in that folder with more useful info.
Is your issue resolved? Were you able to compile it or use the pre-built option?
Closing issue, I've updating readme.txt to help compile (which I agree is a complex setup - nothing on Windows is designed well)
When i use Intellij idea
When i use Visual Studio
ant command not found