iOS Question XUI Views causing compiler error

CaptKronos

Active Member
Licensed User
I have a rather complex project which currently doesn't use XUI Views. I now want to use this library but on just adding XUI Views to the project (i.e. just selecting it in the Library Manager) and then compiling, I get the following compiler error.

B4X:
CompileC /Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/x86_64/b4i_b4xlisttemplate.o /Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/B4iProject/b4i_b4xlisttemplate.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler (in target: B4iProject)
    cd /Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>
    export LANG=en_US.US-ASCII
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c -arch x86_64 -fmessage-length=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit=0 -std=gnu99 -fobjc-arc -fmodules -gmodules -fmodules-prune-interval=86400 -fmodules-prune-after=345600 -fbuild-session-file=/var/folders/0h/bgjhf82s4dq6fj8sj13288_r0000gn/C/org.llvm.clang/ModuleCache.noindex/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 -Wno-objc-interface-ivars -Werror=objc-root-class -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 -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wno-non-literal-null-conversion -Wno-objc-literal-conversion -Wshorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wno-deprecated-implementations -DB4I_VERSION=11 -DNS_BLOCK_ASSERTIONS=1 -DOBJC_OLD_DISPATCH_PROTOTYPES=1 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator12.2.sdk -fasm-blocks -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -mios-simulator-version-min=10.3 -fvisibility=hidden -Wno-sign-conversion -Wno-infinite-recursion -Wno-comma -Wno-block-capture-autoreleasing -Wno-strict-prototypes -Wno-semicolon-before-method-body -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote /Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Zoetic-generated-files.hmap -I/Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Zoetic-own-target-headers.hmap -I/Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Zoetic-all-target-headers.hmap -iquote /Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Zoetic-project-headers.hmap -I/Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/Payload/include -I/Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/DerivedSources-normal/x86_64 -I/Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/DerivedSources/x86_64 -I/Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/DerivedSources -F/Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/Payload -F../../Libs -MMD -MT dependencies -MF /Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/x86_64/b4i_b4xlisttemplate.d --serialize-diagnostics /Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/x86_64/b4i_b4xlisttemplate.dia -c /Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/B4iProject/b4i_b4xlisttemplate.m -o /Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/build/B4iProject.build/Release-iphonesimulator/B4iProject.build/Objects-normal/x86_64/b4i_b4xlisttemplate.o
/Users/bob/Desktop/B4iBuildServer/UploadedProjects/<user id>/B4iProject/b4i_b4xlisttemplate.m:192:7: error: expected identifier or '('
_item = [__ref->__customlistview1 _getrawlistitem:_i];
      ^
1 error generated.
I have tried creating a simpler project with the same libraries but can't replicate the error in
b4i_b4xlisttemplate.m.

I realise this isn't much to go on but does anyone have any ideas?
 

CaptKronos

Active Member
Licensed User
After ripping my project apart, bit by bit, I have found the problem. In one of my classes I had:
B4X:
Type item(index As Int, text As String)
No idea why, but declaring a type called item clashes with XUI Views. Changing the type's names and everything is fine. It is possible to replicate this issue by creating a new project, adding XUI Views and the above type declaration.

I think it would be helpful if the compiler could flag up when a 'reserved' name is used in this way. I'll add the suggestion to Bugs & Wishlist.
 
Top