简体   繁体   English

生成monobjc本机应用程序时出现Xbuild / Mono错误

[英]Xbuild/Mono errors when building monobjc Native App

I'm trying to build a native monobjc bundle from the command line using xbuild (on OSX 10.8). 我正在尝试使用xbuild(在OSX 10.8上)从命令行构建本机monobjc包。 I've built my Cocoa Application using Xamarin Studios and the Monobjc addin. 我已经使用Xamarin Studios和Monobjc插件构建了我的Cocoa应用程序。 I can successfully run "Create Monobjc Bundle" > "Export As Native Application" and get an app that is redistributable. 我可以成功运行“创建Monobjc捆绑包”>“导出为本机应用程序”,并获得可重新分发的应用程序。 However, when I try to run the xbuild command from the Terminal, I get the following: 但是,当我尝试从终端运行xbuild命令时,得到以下信息:

$xbuild /p:Configuration=Release TestProject.csproj /t:BundleNative
Build FAILED.
    Errors:
    /Users/Test/Documents/test/TestProject.csproj (BundleNative) ->
     /Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/Monobjc.CocoaApplication.targets (CoreBundleNative target) ->

    /Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/Monobjc.CocoaApplication.targets: error : clang: warning: argument unused during compilation: '-pthread'
    /Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/Monobjc.CocoaApplication.targets: error : Error executing task EncryptFiles: Required property 'EncryptionSeed' not set.

    0 Warning(s)
    2 Error(s)

I've set the <EncryptionSeed> attribute of the csproj to some arbitrary value to see if that was the issue. 我已经将csproj的<EncryptionSeed>属性设置为某个任意值,以查看是否是问题所在。 But alas, I've gotten nowhere. 但是可惜,我什么都没有。 As you can see I'm using Mono 2.10.12 (the SDK) and Monobjc 4.0.2167.11 that was installed via Xamarin. 如您所见,我正在使用通过Xamarin安装的Mono 2.10.12(SDK)和Monobjc 4.0.2167.11。 Any help would be appreciated. 任何帮助,将不胜感激。

UPDATE 1: I fixed the encryption seed error by installing the newest monobjc bridge via the monobjc package from the monobjc download page (5.0.2165.0), however still the error about the pthread, which occurs during the embed application step: 更新1:我通过从monobjc下载页面(5.0.2165.0)的monobjc软件包安装了最新的monobjc桥来修复了加密种子错误,但是仍然存在关于pthread的错误,该错误在嵌入应用程序步骤期间发生:

Compiling...
        Arguments: ' -Os -gdwarf-2  -arch i386 -mmacosx-version-min=10.8  -I"bin/Release//Embed"  -c "bin/Release//Embed/main.c" -o "bin/Release//Embed/main.o" -D_THREAD_SAFE -I/Library/Frameworks/Mono.framework/Versions/2.10.12/include/mono-2.0  '
        -pthread -L/Library/Frameworks/Mono.framework/Versions/2.10.12/lib -lmono-2.0 -lpthread  
        Linking...
        Arguments: '  -arch i386 -mmacosx-version-min=10.8  -L"bin/Release//Embed" -pthread -L/Library/Frameworks/Mono.framework/Versions/2.10.12/lib -lmono-2.0 -lpthread   -lz  -lmonobjc  -lTest_exe -lMono_Posix_dll -lMono_Security_dll -lMonobjc_AppKit_dll -lMonobjc_dll -lMonobjc_Foundation_dll -lMonobjc_ScriptingBridge_dll -lmscorlib_dll -lMSWordInterface_dll -lSystem_Configuration_dll -lSystem_Core_dll -lSystem_dll -lSystem_Runtime_Serialization_dll -lSystem_Security_dll -lSystem_Xml_dll -lmachine_config -o "bin/Release//Embed/Test" "bin/Release//Embed/main.o" '
/Library/Frameworks/Mono.framework/Versions/2.10.12/lib/mono/4.0/Monobjc.CocoaApplication.targets: error : clang: warning: argument unused during compilation: '-pthread'
        Embedding done

The EncryptionSeed tag was introduced in the latest Monobjc MonoDevelop Addin to handle resources encryption and is only handled by Monobjc 5.0 serie. 最新的Monobjc MonoDevelop外接程序中引入了EncryptionSeed标记来处理资源加密,并且仅由Monobjc 5.0系列处理。

As for the clang message, this is not quite an error. 至于clang消息,这并不是一个错误。 If you read the description, you will notice that this is a warning. 如果您阅读了说明,将会注意到这是一个警告。 The clang compiler is called through the Process class which allow the capture of the standard output and error streams. 通过Process类调用clang编译器,该类允许捕获标准输出和错误流。 Unfortunately, the warnings are reported on the standard error stream: this is why the embedding task reports some errors when there are only warnings. 不幸的是,警告是在标准错误流上报告的:这就是为什么在仅警告的情况下嵌入任务会报告一些错误的原因。

Please file a bug if you think the problem is a showstopper. 如果您认为问题出在顶部,请提交错误

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM