<div style="font-family: Helvetica; font-size: 13px;"><div>Hi Casey,</div><div><br></div>I have reached the conclusion I cannot use this library for my project, as I have a deadline and the it is still not linking.<div><br></div><div>This time I passed CPPFLAGS=-stdlib=libc++ directly to the make command (and I could see it passed to the compiler), but I still get the same linking error; tried explicitly setting libc++ in XCode, together with different C++ dialects, but still nothing.<div><br></div><div>Thank you for your help with debugging.</div></div></div>
<div><div><br></div>-- <br>Alessandro Dal Grande<div><br></div></div>
<p style="color: #A0A0A8;">On Friday, 23 May 2014 at 11:42, Alessandro Dal Grande wrote:</p><blockquote type="cite"><div>
<span><div><div>
<div style="font-family: Helvetica; font-size: 13px;">It still seems Clang was using libstdc++ because if I switch to that, the errors disappear (but then I have OpenCV not linking! meh). I will try to compile once again, now I removed GCC from my system completely. libc++ should be the default in Mavericks, so don’t understand why this is happening; will make sure that it’s added to the CXX_FLAGS as I don’t see it in the Makefile.<br></div>
<div><div><br></div>-- <br>Alessandro Dal Grande<div><br></div></div>
<p style="color: #A0A0A8;">On Friday, 23 May 2014 at 11:15, Casey Goodlett wrote:</p><blockquote type="cite"><div>
<span><div><div><div dir="ltr">Maybe in the xcode project you are using c++11 but compiled the libraries without. I am not sure.<br></div><div><br><br><div>On Fri, May 23, 2014 at 2:02 PM, Alessandro Dal Grande <span dir="ltr"><<a href="mailto:adgror@gmail.com" target="_blank">adgror@gmail.com</a>></span> wrote:<br><blockquote type="cite"><div>
<div>
Hi Casey,
</div><div><br></div><div>After adding:</div><div><br></div><div>$(PROJECT_DIR)/kiwi.framework/Headers</div><div>$(PROJECT_DIR)/vtk.framework/Headers</div><div><br></div><div>to Header Search Paths for my target, the statement:</div>
<div><br></div><div>#import <kiwi/vesKiwiViewerApp.h></div><div><br></div><div>inside my .mm file doesn’t throw any compilation error any more. At this time the linker errors out with:</div><div><br></div><div><div>
Undefined symbols for architecture armv7:</div><div> "std::ios_base::Init::~Init()", referenced from:</div><div> ___cxx_global_var_init in vtk(vtkUnicodeString.cxx.o)</div><div> ___cxx_global_var_init in vtk(vtkOutputWindow.cxx.o)</div>
<div> ___cxx_global_var_init in vtk(vtkOStreamWrapper.cxx.o)</div><div> ___cxx_global_var_init in vtk(vtkOStrStreamWrapper.cxx.o)</div><div> ___cxx_global_var_init in vtk(vtkObject.cxx.o)</div><div> ___cxx_global_var_init in vtk(vtkCommand.cxx.o)</div>
<div> ___cxx_global_var_init in vtk(vtkTimeStamp.cxx.o)</div><div> ...</div><div> "std::ios_base::Init::Init()", referenced from:</div><div> ___cxx_global_var_init in vtk(vtkUnicodeString.cxx.o)</div>
<div> ___cxx_global_var_init in vtk(vtkOutputWindow.cxx.o)</div><div> ___cxx_global_var_init in vtk(vtkOStreamWrapper.cxx.o)</div><div> ___cxx_global_var_init in vtk(vtkOStrStreamWrapper.cxx.o)</div><div> ___cxx_global_var_init in vtk(vtkObject.cxx.o)</div>
<div> ___cxx_global_var_init in vtk(vtkCommand.cxx.o)</div><div> ___cxx_global_var_init in vtk(vtkTimeStamp.cxx.o)</div><div> ...</div><div>ld: symbol(s) not found for architecture armv7</div><div>clang: error: linker command failed with exit code 1 (use -v to see invocation)</div>
</div>
<div><div><br></div><div>What should I add to the Library Search Paths? I looked at the example applications, but they have static libraries instead of frameworks, so I cannot relate.</div><div><br></div>
<div>Thanks</div><div><br></div><div>PS: sorry but I cannot share the code at this time</div>-- <br>Alessandro Dal Grande<div><br></div></div><div><div>
<p style="color:#a0a0a8">On Friday, 23 May 2014 at 06:04, Casey Goodlett wrote:</p><blockquote type="cite"><div>
<span><div><div><div dir="ltr"><div><div>Alessanro,<br><br>You should normally have to add the include path for each framework as you have done. I assume you also included the vtk.framework headers? You will see the same in the KiwiSimple and KiwiViewer projects.<br>
<br></div>Another option that you may investigate is how to compile each file. I forget the name of the option, but its something like compile each file as objective-c / objective-c++ or by file type. My experience has been best when I use "by file type". You do have to be careful then that any ves/ves header is included in a file with .mm extension. You can get strange build errors if some of the eigen headers get included in a file with .m extension.<br>
<br></div>Do you have a project file you can share?<br></div><div><br><br><div>On Fri, May 23, 2014 at 3:21 AM, Alessandro Dal Grande <span dir="ltr"><<a href="mailto:adgror@gmail.com" target="_blank">adgror@gmail.com</a>></span> wrote:<br><blockquote type="cite"><div>
<div style="font-family:Helvetica;font-size:13px"><div><span style="font-size:13.000000953674316px">Update: I managed to compile by removing the c++11 flag I added.</span></div><div><br></div>OK, I don’t know how to go forward with the framework in XCode, the example app doesn’t work either. I tried to manually add to the include path the headers with:<div>
<br></div><div>$(PROJECT_DIR)/kiwi.framework/Headers</div><div><br></div><div>in the Build Settings, but that breaks OpenCV for some reason. If I don’t, the compiler errors out with:</div><div><div><br></div><div>
[…]/kiwi.framework/Headers/vesKiwiBaseApp.h:30:10: 'vesMath.h' file not found with <angled> include; use "quotes” instead</div></div></div><span><font color="#888888">
<div><div><br></div>-- <br>Alessandro Dal Grande<div><br></div></div></font></span><div><div>
<p style="color:#a0a0a8">On Thursday, 22 May 2014 at 15:01, Alessandro Dal Grande wrote:</p><blockquote type="cite"><div>
<span><div><div>
<div style="font-family:Helvetica;font-size:13px">Yup, it switched back to Clang:<div><br></div><div><div>[ 0%] Building C object libarchive/CMakeFiles/archive.dir/archive_acl.c.o</div><div>cd /Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Build/libarchive-ios-simulator/libarchive && /usr/bin/cc -DHAVE_CONFIG_H -Darchive_EXPORTS -fvisibility=hidden -fvisibility-inlines-hidden -mios-simulator-version-min=5.0 -fvisibility=hidden -fvisibility-inlines-hidden -mios-simulator-version-min=5.0 -g -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk -fPIC -I/Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Source/libarchive/libarchive -I/Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Build/libarchive-ios-simulator -I/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/usr/include/libxml2 -o CMakeFiles/archive.dir/archive_acl.c.o -c /Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Source/libarchive/libarchive/archive_acl.c</div>
<div>/usr/local/Cellar/cmake/<a href="http://2.8.12.2/bin/cmake" target="_blank">2.8.12.2/bin/cmake</a> -E cmake_progress_report /Users/ale/Desktop/projects/nifty/KiwiWebinar/Build/CMakeExternals/Build/libarchive-ios-simulator/CMakeFiles 1</div>
</div></div>
<div><div><br></div>-- <br>Alessandro Dal Grande<div><br></div></div>
<p style="color:#a0a0a8">On Thursday, 22 May 2014 at 14:58, Alessandro Dal Grande wrote:</p><blockquote type="cite"><div>
<span><div><div>
<div style="font-family:Helvetica;font-size:13px">Sure I will try it now.<br></div>
<div><div><br></div>-- <br>Alessandro Dal Grande<div><br></div></div>
<p style="color:#a0a0a8">On Thursday, 22 May 2014 at 14:56, Casey Goodlett wrote:</p><blockquote type="cite"><div>
<span><div><div><div dir="ltr"><div>That should not be a problem.<br><br></div>If you dont mind testing removing the find_program for the compilers in the simulator toolchain, it would help me to confirm that I understand the situation.<br>
<br>Thanks<br></div><div><br><br><div>On Thu, May 22, 2014 at 5:44 PM, Alessandro Dal Grande <span dir="ltr"><<a href="mailto:adgror@gmail.com" target="_blank">adgror@gmail.com</a>></span> wrote:<br><blockquote type="cite"><div>
<div>
<div>
<div style="font-family:Helvetica;font-size:13px">I think I can live without the simulator build, as I cannot test on it anyway, based on my app requirements ;)<div><br></div><div>Another strange thing that happens is I get warnings like this one:<div>
<br></div><div>/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: for architecture: armv7 file: ./CMakeExternals/Install/vtk-ios-device/lib/libvtklibxml2-6.0.a(debugXML.c.o) has no symbols</div>
<div><br></div><div>Is it fine, am I missing something?</div></div></div><span><font color="#888888">
<div><div><br></div>-- <br>Alessandro Dal Grande<div><br></div></div></font></span><div><div>
<p style="color:#a0a0a8">On Thursday, 22 May 2014 at 14:30, Casey Goodlett wrote:</p><blockquote type="cite"><div>
<span><div><div><div dir="ltr"><div>You can use the same compiler for both simulator and device builds with the arch, sysroot, and ios-version-min flags set from the toolchain file. In other words the compiler is the same for both builds but the build options are different.<br>
</div><div><br></div><div>The key flags are<br></div><div>-arch<br></div><div>-isysroot<br></div><div>-mios-simulator-version-min=5.0 <br>
or<div>-mios-iphoneos-version-min=5.0 <br><br><br></div><div>Note the version min is key for the simulator build otherwise you may link against host (OS X) libraries.<br><br></div></div><div><br><div>
On Thu, May 22, 2014 at 5:24 PM, Alessandro Dal Grande <span dir="ltr"><<a href="mailto:adgror@gmail.com" target="_blank">adgror@gmail.com</a>></span> wrote:<br><blockquote type="cite"><div>
<div style="font-family:Helvetica;font-size:13px">Yeah, I get the same:<div><br></div><div><div><div>$ c++ -v</div><div>Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)</div></div><div>
Target: x86_64-apple-darwin13.1.0</div><div>Thread model: posix</div></div><div><br></div><div>This seems to be the compiler used for armv7/armv7s architectures though, so it should be working if I run the builds on my iDevice?</div>
<div><br></div><div>Thanks</div></div><span><font color="#888888">
<div><div><br></div>-- <br>Alessandro Dal Grande<div><br></div></div></font></span><div><div>
<p style="color:rgb(160,160,168)">On Thursday, 22 May 2014 at 14:21, Casey Goodlett wrote:</p><blockquote type="cite"><div>
<span><div><div><div dir="ltr"><div><br><div>On Thu, May 22, 2014 at 5:17 PM, Alessandro Dal Grande <span dir="ltr"><<a href="mailto:adgror@gmail.com" target="_blank">adgror@gmail.com</a>></span> wrote:<br><blockquote type="cite"><div><div>Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1</div>
</div></blockquote></div><br>I believe that --with-gxx-include-dir line means you get libstdc++<br></div><div><br></div><div>Compare with <br>$ c++ -v<br>Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)<br>
Target: x86_64-apple-darwin13.2.0<br>Thread model: posix
<br clear="all"><br>-- <br><div dir="ltr">Casey B. Goodlett, Ph.D.<br>Technical Leader<br>Kitware, Inc. - North Carolina Office<br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br><a href="tel:%28919%29%20969-6990%20x310" value="+19199696990" target="_blank">(919) 969-6990 x310</a></div>
</div></div>
</div></div></span>
</div></blockquote><div>
<br>
</div>
</div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Casey B. Goodlett, Ph.D.<br>Technical Leader<br>Kitware, Inc. - North Carolina Office<br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
<a href="tel:%28919%29%20969-6990%20x310" value="+19199696990" target="_blank">(919) 969-6990 x310</a></div>
</div></div>
</div></div></span>
</div></blockquote><div>
<br>
</div>
</div></div></div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Casey B. Goodlett, Ph.D.<br>Technical Leader<br>Kitware, Inc. - North Carolina Office<br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
<a href="tel:%28919%29%20969-6990%20x310" value="+19199696990" target="_blank">(919) 969-6990 x310</a></div>
</div>
</div></div></span>
</div></blockquote><div>
<br>
</div>
</div></div></span>
</div></blockquote><div>
<br>
</div>
</div></div></span>
</div></blockquote><div>
<br>
</div>
</div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Casey B. Goodlett, Ph.D.<br>Technical Leader<br>Kitware, Inc. - North Carolina Office<br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
<a href="tel:%28919%29%20969-6990%20x310" value="+19199696990" target="_blank">(919) 969-6990 x310</a></div>
</div>
</div></div></span>
</div></blockquote><div>
<br>
</div>
</div></div></div></blockquote></div><br><br clear="all"><br>-- <br><div dir="ltr">Casey B. Goodlett, Ph.D.<br>Technical Leader<br>Kitware, Inc. - North Carolina Office<br><a href="http://www.kitware.com" target="_blank">http://www.kitware.com</a><br>
(919) 969-6990 x310</div>
</div>
</div></div></span>
</div></blockquote><div>
<br>
</div>
</div></div></span>
</div></blockquote><div>
<br>
</div>