Im building svo package following this guide https://github.com/uzh-rpg/rpg_svo/wiki/Run-SVO-without-ROS on raspberry pi.
Everything except last package builded succesfully. While building last package I faced next error:
/home/pi/workspace/rpg_svo/svo/src/map.cpp: In member function ‘svo::FramePtr svo::Map::getClosestKeyframe(const FramePtr&) const’:
/home/pi/workspace/rpg_svo/svo/src/map.cpp:135:12: error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘svo::FramePtr {aka boost::shared_ptr<svo::Frame>}’
CMakeFiles/svo.dir/build.make:146: recipe for target 'CMakeFiles/svo.dir/src/map.cpp.o' failed
make[2]: *** [CMakeFiles/svo.dir/src/map.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/svo.dir/all' failed
make[1]: *** [CMakeFiles/svo.dir/all] Error 2
Makefile:72: recipe for target 'all' failed
I builded everything except SVO package with:
export ARM_ARCHITECTURE=True
And changed compilers flags: I deleted -march=native. Also I tried to add these flags:
-march=armv6 -mfloat-abi=hard -mfpu=vfp
But it changed nothing.
Full building log:
Scanning dependencies of target svo
[ 4%] Building CXX object CMakeFiles/svo.dir/src/frame_handler_mono.cpp.o
/tmp/ccqAImPE.s: Assembler messages:
/tmp/ccqAImPE.s:1875: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/ccqAImPE.s:1885: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/ccqAImPE.s:1902: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/ccqAImPE.s:2077: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/ccqAImPE.s:2087: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/ccqAImPE.s:2104: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/ccqAImPE.s:2161: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/ccqAImPE.s:2171: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/ccqAImPE.s:2188: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 9%] Building CXX object CMakeFiles/svo.dir/src/frame_handler_base.cpp.o
/tmp/cclVVat6.s: Assembler messages:
/tmp/cclVVat6.s:3429: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:3439: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:3456: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:3513: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:3523: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:3540: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:4324: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:4333: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:4350: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:4684: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:4693: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
/tmp/cclVVat6.s:4710: Warning: swp{b} use is deprecated for ARMv6 and ARMv7
[ 14%] Building CXX object CMakeFiles/svo.dir/src/frame.cpp.o
[ 19%] Building CXX object CMakeFiles/svo.dir/src/point.cpp.o
[ 23%] Building CXX object CMakeFiles/svo.dir/src/map.cpp.o
/home/pi/workspace/rpg_svo/svo/src/map.cpp: In member function ‘svo::FramePtr svo::Map::getClosestKeyframe(const FramePtr&) const’:
/home/pi/workspace/rpg_svo/svo/src/map.cpp:135:12: error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘svo::FramePtr {aka boost::shared_ptr<svo::Frame>}’
CMakeFiles/svo.dir/build.make:146: recipe for target 'CMakeFiles/svo.dir/src/map.cpp.o' failed
make[2]: *** [CMakeFiles/svo.dir/src/map.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/svo.dir/all' failed
make[1]: *** [CMakeFiles/svo.dir/all] Error 2
Makefile:72: recipe for target 'all' failed
make: *** [all] Error 2
error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘svo::FramePtr {aka boost::shared_ptr}
Hi! I have met the same problem as you. I solved this problem by defining a new variable whose type is FramePtr. ie. adding "FramePtr m;"before "return nullptr;"in map.cpp;and then changing "return nullptr"--->"return m;"
Related
How to solve ld: file is universal (2 slices) but does not contain a(n) armv7 slice: /Users/admin/Downloads/FaceDetect/libcv.a for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation) error in iphone opencv project
You need to change the architecture armv7.
and change the compiler GCC to LLVM.
I am trying to debug in device with iOS 6 (iPhone 4) but getting error. below is the complete log of it. can anyone explain this? thanks
Ld /Users/xyz/Desktop/app-ebcjtnqmxrkylhalerydbplwewus/Build/Intermediates/app.build/Debug-iphoneos/app.build/Objects-normal/armv7s/app normal armv7s
cd "/Users/folder/Desktop/4.0 app 1010"
setenv IPHONEOS_DEPLOYMENT_TARGET 4.0
setenv PATH "/Volumes/Xcode 1/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Volumes/Xcode 1/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
"/Volumes/Xcode 1/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang" -arch armv7s -isysroot "/Volumes/Xcode 1/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS6.0.sdk" -L/Users/folder/Desktop/app-ebcjtnqmxrkylhalerydbplwewus/Build/Products/Debug-iphoneos "-L/Users/folder/Desktop/4.0 app 1010/Twitter+OAuth/SAOAuthTwitterEngine" -F/Users/folder/Desktop/app-ebcjtnqmxrkylhalerydbplwewus/Build/Products/Debug-iphoneos "-F/Users/folder/Desktop/4.0 app 1010" -filelist /Users/folder/Desktop/app-ebcjtnqmxrkylhalerydbplwewus/Build/Intermediates/app.build/Debug-iphoneos/app.build/Objects-normal/armv7s/app.LinkFileList -dead_strip -ObjC -all_load -fobjc-link-runtime -miphoneos-version-min=4.0 -framework EventKit -framework MobileCoreServices -framework CFNetwork -framework MessageUI -framework MapKit -framework CoreData -framework CoreLocation -framework AVFoundation -framework AudioToolbox -framework Foundation -framework UIKit -framework BugSense-iOS -framework CoreGraphics -framework MediaPlayer -framework SystemConfiguration -lz.1.1.3 -lxml2 -weak-lSystem -lsqlite3 -o /Users/folder/Desktop/app-ebcjtnqmxrkylhalerydbplwewus/Build/Intermediates/app.build/Debug-iphoneos/app.build/Objects-normal/armv7s/app
ld: warning: directory not found for option '-L/Users/folder/Desktop/4.0 app 1010/Twitter+OAuth/SAOAuthTwitterEngine'
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/folder/Desktop/4.0 app 1010/BugSense-iOS.framework/BugSense-iOS for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
(null): Directory not found for option '-L/Users/folder/Desktop/4.0 app 1010/Twitter+OAuth/SAOAuthTwitterEngine'
(null): File is universal (3 slices) but does not contain a(n) armv7s slice: /Users/folder/Desktop/4.0 app 1010/BugSense-iOS.framework/BugSense-iOS for architecture armv7s
(null): Linker command failed with exit code 1 (use -v to see invocation)
"File is universal (3 slices) but does not contain a(n) armv7s slice:" It actually says what the problem is. The BugSense framework wasn't built with armv7s as a supported architecture. The 3 slices mentioned in the error are most likely armv6, armv7 and i386 (Simulator).
When you build an app or a static library you have to set which architectures you want to support, see Build Settings -> Architectures. This relates to the iPhone's processor, iPhone 3G and lower has an ARM6 processor, iPhone 3GS to 4S has ARM7 and now the iPhone5 has ARM7s. Since Xcode 4.5, support for armv6 has dropped and armv7s is added to the Build Settings architectures by default.
So basically, your project supports armv7s while the library you're trying to use doesn't. Either contact the developers of this library and ask to add support for armv7s or if you can build the library yourself, add armv7s to the list of architectures in the build settings and rebuild. Or you could also set "Build active architecture only" for debugging.
Looks like you are using the third party library 'bugsense' that has not been optimized yet for armv7s (note the 's') used in iPhone 5. You will either need to get an updated bugsense SDK or remove armv7s from the 'architectures' in your projects 'build settings'.
Iam developing one application.In that i am using libz.1.dylib framework.And this application will be working fine in simulator.When i try to archive this application i got a error like Apple Mach-O linker error.And show the error like
/Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/InstallationBuildProductsLocation/Applications/StudyApp.app/StudyApp normal armv7
cd /Users/wifin/Desktop/K.V.Naresh/SmartSvn/27-04-2012
setenv IPHONEOS_DEPLOYMENT_TARGET 3.0
setenv PATH "/Users/wifin/Desktop/software/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Users/wifin/Desktop/software/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Users/wifin/Desktop/software/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch armv7 -isysroot /Users/wifin/Desktop/software/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.1.sdk -L/Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/BuildProductsPath/Release-iphoneos -F/Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/BuildProductsPath/Release-iphoneos -filelist /Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/IntermediateBuildFilesPath/StudyApp.build/Release-iphoneos/StudyApp.build/Objects-normal/armv7/StudyApp.LinkFileList -dead_strip -fobjc-arc -miphoneos-version-min=3.0 -lz -lsqlite3.0 -framework AVFoundation -framework QuartzCore -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/wifin/Library/Developer/Xcode/DerivedData/StudyApp-fhamcsbyepwhdebjbmkfyfbroacl/Build/Intermediates/ArchiveIntermediates/IpadExStudyApp/InstallationBuildProductsLocation/Applications/StudyApp.app/StudyApp
ld: library not found for -lz
clang: error: linker command failed with exit code 1 (use -v to see invocation)
So please tell me how to solve this error.
EDIT: Check that each module and lib you expect to be in the build are actually in the build
See this SO answer and this answer also for more clang errors and what to try.
You should still link against libz as a matter of course:
Instead of linking against libz.1.dylib you need to link against libz.dylib
Remove the entry for libz.1.dylib from your linker settings and add libz.dylib manually
When using Xcode 4.2 to build an armv6 architecture program, I am getting a weird linker error:
Symbol not found for architecture armv6
___divmodsi4
Which is a math function symbol included with llvm
What could be the cause of this problem? Is this because of a bug in xcode, or is it because armv6 is not able to use this? (Note: Compiling the same code for armv7 does not cause this issue.)
Thanks
try change the compiler to APPLE llvm.
I tried this to build armv7 boost libs:
./bjam toolset=darwin cflags="-fvisibility=default" architecture=arm target-os=iphone macosx-version=iphone-4.1 link=static threading=multi define=_LITTLE_ENDIAN include=/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.1.sdk/usr/include/c++/4.2.1/armv7-apple-darwin10 --with-thread --with-date_time
But the lipo -info command told me that the compiled library is armv6, not armv7 lib!
Could anyone please tell me a boost command line to create a libs with armv7
Pass the "-arch armv7" flag to the compiler. In your example, setting architecture=armv7 should probably do the trick.
In any case, armv6 executables can always be run (to the extent of my knowledge) on armv7 CPUs.