请教编译问题
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了请教编译问题相关的知识,希望对你有一定的参考价值。
参考技术A 生成命令:@cd ..
@call Targets/Build.bat $(ProjectName) $(Configuration) -output "../../Binaries/Win32/UDKGame.exe"
Build.bat:
@ECHO off
REM %1 is the game name
REM %2 is the platform name
REM %3 is the configuration name
IF EXIST ..\Intermediate\UnrealBuildTool\Release\UnrealBuildTool.exe (
..\Intermediate\UnrealBuildTool\Release\UnrealBuildTool.exe %* -DEPLOY
) ELSE (
ECHO UnrealBuildTool.exe not found in ..\Intermediate\UnrealBuildTool\Release\UnrealBuildTool.exe
EXIT /B 999
)
BuildTool中cl执行代码:
C# code?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
ActionStartInfo.FileName = E:\TOOLS\VS2010\Common7\Tools\../../VC/bin/x86_amd64/cl.exe
ActionStartInfo.Arguments = /nologo /Oi /Zp4 /Gy /fp:fast /c /Zm400 /bigobj /wd4819 /Ox /Ot /Ob2 /errorReport:prompt /EHsc /MD /I "Core/Inc/Epic" /I "Core/Inc/Licensee" /I "Core/Inc" /I "Engine/Inc" /I "GameFramework/Inc" /I "IpDrv/Inc" /I "UnrealEd/Inc" /I "UnrealEd/FaceFX" /I "UnrealEdCLR/Inc" /I "UnrealSwarm/Inc" /I "../External/FaceFX/Studio/Main/Inc" /I "../External/FaceFX/Studio/Widgets/Inc" /I "../External/FaceFX/Studio/Framework/Audio/Inc" /I "../External/FaceFX/Studio/Framework/Commands/Inc" /I "../External/FaceFX/Studio/Framework/Console/Inc" /I "../External/FaceFX/Studio/Framework/GUI/Inc" /I "../External/FaceFX/Studio/Framework/Misc/Extensions/Inc" /I "../External/FaceFX/Studio/Framework/Misc/Inc" /I "../External/FaceFX/Studio/Framework/Proxies/Inc" /I "../External/FaceFX/Studio/" /I "../External/FaceFX/Studio/Framework/Gestures/Inc" /I "../External/FaceFX/Studio/External/OpenAL/include" /I "../External/FaceFX/Studio/External/libresample-0.1.3/include" /I "../External/tinyXML" /I "E:/TOOLS/VS2010/VC/atlmfc/include" /I "E:/TOOLS/VS2010/VC/include" /I "../External/SpeedTree/Include" /I "GFxUI/Inc" /I "OnlineSubsystemPC/Inc" /I "WinDrv/Inc" /I "D3D9Drv/Inc" /I "D3D11Drv/Inc" /I "OpenGLDrv/Inc" /I "ES2Drv/Inc" /I "XAudio2/Inc" /I "Launch/Inc" /I "../Tools/UnrealLightmass/Public" /I "C:\Program Files\Common Files" /I "../External/IntelTBB-3.0/Include" /I "OnlineSubsystemSteamworks/Inc" /I "../External/ES2Emulation/NVIDIA/include" /I "../External/wxWidgets/include" /I "../External/wxWidgets/lib/vc_dll" /I "../External/wxExtended/wxDockit/include" /I "GFxUIEditor/Inc" /I "Engine\Src" /I "../External/PhysX/SDKs/Foundation/include" /I "../External/PhysX/SDKs/Physics/include" /I "../External/PhysX/SDKs/Physics/include/fluids" /I "../External/PhysX/SDKs/Physics/include/softbody" /I "../External/PhysX/SDKs/Physics/include/cloth" /I "../External/PhysX/SDKs/Cooking/include" /I "../External/PhysX/SDKs/PhysXLoader/include" /I "../External/PhysX/SDKs/PhysXExtensions/include" /I "../External/PhysX/SDKs/TetraMaker/NxTetra" /I "../External/PhysX/Nxd/include" /I "../External/PhysX/PxFoundation" /I "../External/PhysX/PxFoundation/legacy" /I "../External/PhysX/PxRenderDebug" /I "../External/PhysX/PxTask" /I "../External/PhysX/PxFoundation/windows" /I "../External/PhysX/APEX/framework/public" /I "../External/PhysX/APEX/NxParameterized/public" /I "../External/PhysX/APEX/EditorWidgets" /I "../External/PhysX/APEX/module/clothing/public" /I "../External/PhysX/APEX/module/destructible/public" /I "../External/PhysX/APEX/module/emitter/public" /I "../External/PhysX/APEX/module/explosion/public" /I "../External/PhysX/APEX/module/forcefield/public" /I "../External/PhysX/APEX/module/iofx/public" /I "../External/PhysX/APEX/module/basicios/public" /I "../External/PhysX/APEX/module/particles/public" /I "../External/FaceFX/FxSDK/Inc" /I "../External/FaceFX/FxCG/Inc" /I "../External/FaceFX/FxAnalysis/Inc" /I "../External/GFx/Include" /I "../External/GFx/Src" /I "../External/GFx/Src/GFx" /I "../External/GFx/Src/GFx/AMP" /I "../External/GFx/Src/GFx/AS2" /I "../External/GFx/Src/GFx/AS3" /I "../External/GFx/Src/GFx/Audio" /I "../External/GFx/Src/GFx/IME" /I "../External/GFx/Src/GFx/Text" /I "../External/GFx/Src/GFx/XML" /I "../External/GFx/Src/Kernel" /I "../External/GFx/Src/Render" /I "../External/GFx/Src/Render/ImageFiles" /I "../External/Recast/UE3/include" /I "../External/OpenGL" /I "../External/Steamworks/sdk/public" /I "../External/libPNG" /I "../External/DirectShow/DirectShow" /I "../External/nvapi" /I "../External/nvtesslib/inc" /I "../External/lzopro/include" /I "../External/zlib/inc" /I "../External/FBX/2012.1/include" /I "../External/FBX/2012.1/include/fbxfilesdk" /I "../External/EasyHook" /I "F:/SDK/DirectX9.0c/include" /I "../External/nvTextureTools-2.0.6/src/src" /I "../External/kiss_fft129" /I "../External/libogg-1.2.2/include" /I "../External/libvorbis-1.3.2/include" /D "UNICODE" /D "_UNICODE" /D "__UNREAL__" /D "USE_BINK_CODEC=0" /D "WITH_GFx=1" /D "WITH_GFx_AUDIO=0" /D "WITH_GFx_VIDEO=0" /D "WITH_GFx_IME=1" /D "WITH_RECAST=1" /D "UE3_LEAN_AND_MEAN=0" /D "WITH_EDITOR=1" /D "WITH_PERFORCE=1" /D "_WINDOWS=1" /D "WIN32=1" /D "_WIN32_WINNT=0x0502" /D "WINVER=0x0502" /D "USE_DYNAMIC_ES2_RHI=1" /D "WITH_STEAMWORKS=1" /D "DEDICATED_SERVER=0" /D "PNG_NO_FLOATING_POINT_SUPPORTED=1" /D "WXUSINGDLL" /D "wxUSE_NO_MANIFEST" /D "WITH_FBX=1" /D "WITH_KISSFFT=1" /D "XDKINSTALLED=0" /D "WITH_SPEEDTREE=0" /D "DWTRIOVIZSDK=0" /D "WITH_MANAGED_CODE=1" /D "NDEBUG=1" /D "FINAL_RELEASE=0" /Yc"EnginePrivate.h" /Fp"C:\UDK\UDK-2012-01\Development\Intermediate\UDKGame\Win64\Release\Engine\EnginePrivate.h.pch" "C:\UDK\UDK-2012-01\Development\Intermediate\UDKGame\Win64\Release\Engine\EnginePrivate.h.PCH.cpp" /Fo"C:\UDK\UDK-2012-01\Development\Intermediate\UDKGame\Win64\Release\Engine\EnginePrivate.h.obj" /Fd"C:\UDK\UDK-2012-01\Development\Intermediate\UDKGame\Win64\Release\Engine\EnginePrivate.h.pdb" /TP /GR- /WX /W4
ActionProcess = new Process();
ActionProcess.StartInfo = ActionStartInfo;
bool bShouldRedirectOuput = Action.OutputEventHandler != null;
if (bShouldRedirectOuput)
ActionStartInfo.RedirectStandardOutput = true;
ActionStartInfo.RedirectStandardError = true;
ActionProcess.EnableRaisingEvents = true;
ActionProcess.OutputDataReceived += Action.OutputEventHandler;
ActionProcess.ErrorDataReceived += Action.OutputEventHandler;
ActionProcess.Start();
请教JAVA 问题
想请问JAVA 高手如何解决以下问题, 谢谢:
编译好JAVA 程序后,将之用JAR 指令压缩成 .jar 文件再执行后出现以下讯息。想请教该如何解决。
Failed to load Mani-Class manifestattribute from
C:\Sun\SDK\jdk\bin\cpu09\cpu09.jar
谢谢指点,但根据答复去做还是出现以下讯息:
C:\Sun\SDK\jdk\bin\cpu09>jar cvfm cpu09.jar Manifest.txt
java.io.IOException: invalid header field name: ???Main-Class
at java.util.jar.Attributes.read(Attributes.java:409)
at java.util.jar.Manifest.read(Manifest.java:167)
at java.util.jar.Manifest.<init>(Manifest.java:52)
at sun.tools.jar.Main.run(Main.java:123)
at sun.tools.jar.Main.main(Main.java:903)
Manifest文件是要加入Main-Class: cpu09.frame.CPU09 但解压缩JAR 文件后发现 Mainfest文件没变化,而CPU09.JAR 还是不能执行。
请问要如何解决,谢谢。
1、建立一个文件夹,将你编译好的所有类放在这个文件夹里面。这里我们假设已经写好了一个Swing.class,那么把这个Swing.class放到这个文件夹
2、新建一个文件,文件名为manifest.mf,用记事本打开它,编辑里面的内容为Main-Class: Swing(然后按回车,记住一定要按回车,而且这里的类名不能带.class)
3、进行命令行,输入命令:jar cvfm Swing.jar manifest.mf *
看看文件夹下面是不是生成一个Swing.jar文件,如果你是用Swing或者AWT写的java程序,这时可以直接双击这个文件运行。 参考技术A 是 .jar 压缩包中 META-INF/MANIFEST.MF
文件不一样, 多了一行, Main-Class: xxxxx, 再看看出错信息, 原来是没有指定
Main-Class, 看看 jar 命令, 发现有一个参数 -m,
-m include manifest information from specified manifest file
和出错信息有点关系, 看来它要读一个配制文件. 只好照猫画虎写一个了.
[classes]$ cat myManifest
Manifest-Version: 1.0
Main-Class: pktest.PackageTest
Created-By: 1.2.2 (Sun Microsystems Inc.)
[classes]$ jar cvfm mypackage.jar myManifest pktest
added manifest
adding: pktest/(in = 0) (out= 0)(stored 0%)
adding: pktest/PackageSecond.class(in = 659) (out= 395)(deflated 40%)
adding: pktest/subpk/(in = 0) (out= 0)(stored 0%)
adding: pktest/subpk/PackageSub.class(in = 744) (out= 454)(deflated 38%)
adding: pktest/PackageTest.class(in = 1041) (out= 602)(deflated 42%)
[classes]$ java -jar mypackage.jar
Value of PackageTest is This is a Test Package
Value of PackageSecond is I am in PackageTest
Value of PackageSecond is I am in subpackage.
Value of PackageSub is I am in PackageTest
好了, 成功了, 这样就做好了一个可以直接执行的 .jar 文件. 参考技术B manifest文件有问题,
下个BlueJ,轻松搞定
http://www.bluej.org/download/download.html
或者用Ant
补充:
个人认为自己做jar有不确定性,特别是中文的系统,建议用工具,以上提供的工具都是免费的 参考技术C 我也遇到过这个问题,期待回答....
以上是关于请教编译问题的主要内容,如果未能解决你的问题,请参考以下文章