iOS Question B4i writing libraries problem

Ju Yang

Active Member
Licensed User
Longtime User
i had written a simple helloworld static library in xcode, when i call it in xcode ,it works
well

y-jnv-qe-u-2-e84do-l-jpg.38595




however , i use it in b4i ,it shows errors
B4X:
B4i version: 2.30
Parsing code.    (0.00s)
Compiling code.    (0.04s)
Compiling layouts code.    (0.03s)
Compiling debugger engine code.    (1.64s)
Building Xcode project    (0.11s)
Sending data to remote compiler.    Error
Out: Build settings from command line:
    ARCHS = i386
    CODE_SIGNING_REQUIRED = NO
    CONFIGURATION_BUILD_DIR = /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload
    PRODUCT_NAME = B4i Example23424
    SDKROOT = iphonesimulator8.3

=== BUILD TARGET B4iProject OF PROJECT B4iProject WITH CONFIGURATION Release ===

Check dependencies

Create product structure
/bin/mkdir -p /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload/B4i\ Example23424.app

ProcessInfoPlistFile Payload/B4i\ Example23424.app/Info.plist B4iProject/B4iProject-Info.plist
    cd /Users/b4i/Downloads/macserver/UploadedProjects/<user id>
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    builtin-infoPlistUtility /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/B4iProject/B4iProject-Info.plist -genpkginfo /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload/B4i\ Example23424.app/PkgInfo -expandbuildsettings -format binary -platform iphonesimulator -o /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload/B4i\ Example23424.app/Info.plist

CompileC build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/main.o B4iProject/main.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/b4i/Downloads/macserver/UploadedProjects/<user id>
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/8n/gd3_6nsj7b94sv3q_9vxsts80000h0/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -fexceptions -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -mios-simulator-version-min=7.0 -iquote /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-generated-files.hmap -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-own-target-headers.hmap -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-all-target-headers.hmap -iquote /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-project-headers.hmap -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/DerivedSources/i386 -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/DerivedSources -F/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload -F../../Libs -MMD -MT dependencies -MF /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/main.d --serialize-diagnostics /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/main.dia -c /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/B4iProject/main.m -o /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/main.o

CompileC build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/b4i_main.o B4iProject/b4i_main.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/b4i/Downloads/macserver/UploadedProjects/<user id>
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/8n/gd3_6nsj7b94sv3q_9vxsts80000h0/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -fexceptions -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -mios-simulator-version-min=7.0 -iquote /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-generated-files.hmap -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-own-target-headers.hmap -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-all-target-headers.hmap -iquote /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-project-headers.hmap -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/DerivedSources/i386 -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/DerivedSources -F/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload -F../../Libs -MMD -MT dependencies -MF /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/b4i_main.d --serialize-diagnostics /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/b4i_main.dia -c /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/B4iProject/b4i_main.m -o /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/b4i_main.o
In file included from /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/B4iProject/b4i_main.m:2:
/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/B4iProject/b4i_main.h:2:9: fatal error: 'hellowrld.h' file not found
#import "hellowrld.h"
        ^
1 error generated.

CompileC build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/LS_3.o B4iProject/LS_3.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
    cd /Users/b4i/Downloads/macserver/UploadedProjects/<user id>
    export LANG=en_US.US-ASCII
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch i386 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/8n/gd3_6nsj7b94sv3q_9vxsts80000h0/C/org.llvm.clang/ModuleCache/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror=non-modular-include-in-framework-module -Wno-trigraphs -fpascal-strings -O0 -Wno-missing-field-initializers -Wno-missing-prototypes -Werror=return-type -Wno-implicit-atomic-properties -Werror=deprecated-objc-isa-usage -Werror=objc-root-class -Wno-receiver-is-weak -Wno-arc-repeated-use-of-weak -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DNS_BLOCK_ASSERTIONS=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator8.3.sdk -fexceptions -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -fvisibility=hidden -Wno-sign-conversion -fobjc-abi-version=2 -fobjc-legacy-dispatch -mios-simulator-version-min=7.0 -iquote /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-generated-files.hmap -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-own-target-headers.hmap -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-all-target-headers.hmap -iquote /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/B4i\ Example23424-project-headers.hmap -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload/include -I/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/DerivedSources/i386 -I/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/DerivedSources -F/Users/b4i/Downloads/macserver/UploadedProjects/<user id>/Payload -F../../Libs -MMD -MT dependencies -MF /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/LS_3.d --serialize-diagnostics /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/LS_3.dia -c /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/B4iProject/LS_3.m -o /Users/b4i/Downloads/macserver/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/LS_3.o


Error: ** BUILD FAILED **


The following build commands failed:
    CompileC build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/i386/b4i_main.o B4iProject/b4i_main.m normal i386 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
 

Attachments

  • @Y]JNV[QE`]U[2@E84DO[[L.jpg
    @Y]JNV[QE`]U[2@E84DO[[L.jpg
    22.4 KB · Views: 395
  • helloworld.zip
    3.5 KB · Views: 262
Last edited:

JanPRO

Well-Known Member
Licensed User
Longtime User
The problem is that your library only contains the x86_64 architecture, but must contain the arm7v and arm64 architecture. Be sure to use the IOS Device SDK like in the picture: https://brokenfang.files.wordpress....-device-post-03-15-2015-img-1.png?w=442&h=344 for compiling.

When you also want to use your library on simulator, you have to create a fat library.

And be also sure the header file is located in the Lib folder
 
Last edited:
Upvote 0

Ju Yang

Active Member
Licensed User
Longtime User
The problem is that your library only contains the x86_64 architecture, but must contain the arm7v and arm64 architecture. Be sure to use the IOS Device SDK like in the picture: https://brokenfang.files.wordpress....-device-post-03-15-2015-img-1.png?w=442&h=344 for compiling.

When you also want to use your library on simulator, you have to create a fat library.

And be also sure the header file is located in the Lib folder
yet .when i use the ios device ,it shows the picture
qq%E5%9B%BE%E7%89%8720151102131439-jpg.38607
 

Attachments

  • QQ图片20151102131439.jpg
    QQ图片20151102131439.jpg
    5.5 KB · Views: 425
Upvote 0
Top