I want to use std::shared_ptr in the Oculus Mobile SDK Sample code. It won't compile. The error message is: 'shared_ptr' is not a member of 'std'.
I'm using:
Oculus Mobile SDK 0.6.0.1
Android NDK r9d
Eclipse 4.2.1
I confirmed that NDK_TOOLCHAIN_VERSION is set to 4.8 in Application.mk (in the root directory ovr_mobile_sdk_0.6.0.1). I tried setting the cpp flags to C++11 values in every Android.mk and Application.mk I can find. I tried using Clang instead of GCC. I made sure the relevant include paths are added and tried adding others. I even tried the latest NDK r10e.
Unfortunately, none of this works. How can I use std::shared_ptr in the Oculus Mobile SDK sample code?
Related
I have succeeded in creating a statically linked version of an app in Windows. I have (1) compiled Qt statically and (2) compiled my application with the static version of Qt using the Qt Creator (see the documentation, and more in detail the steps I followed). This works great, and I'm able to distribute the app.
Now I'm trying to compile a different app, with the same compiler and settings in Qt Creator, but somehow the .exe ends up dynamically linked....?? Note that I have statically compiled both applications successfully on macOS.
What is going wrong?
I realize that this remains a wide question, but any suggestions are very much welcome.
I have tried so far to add CONFIG+=static to the .pro file (although that was not needed for the first app). Also here this had no effect.
I'm building a C++11 program that works on osX, but the build for android fails with "error: 'round' is not a member of 'std'".
This is a known problem, associated with the gnustl standard library (https://code.google.com/p/android/issues/detail?id=54418), and the current best workaround seems to be to link against LLVM libc++.
How to do so is documented here for Android Studio or cmake, but I cannot find any documentation for how to do the same with bazel, if it is possible.
A partial answer:
if just building an android static library, the command line call has to specify crosstool_top. This can be set to a specific toolchain using something like --crosstool_top=#androidndk//:toolchain-libcpp.
Options can be found in external/androidndk/BUILD in the directory generated by bazel.
However, if building the library as part of an android application, the crosstool would be inferred. I don't know whether the same approach works, or if not what the answer would be.
I have a serious issue getting Xcode 7.3 to compile a Project against Mac SDK 10.7 with LLVM (7+) and C++11. The source of the issue seems to be Xcode or the fact that I'm running OS X 10.11. Some colleagues of mine don't have the same issue compiling the same issue with older Xcode Versions (6). Here is the general setup:
The needed Libraries and Headers are linked with CMake. The Include paths of everything got checked multiple times. The created Xcode Project also seems to be ok, we've compared all important settings (C++ dialect, std library , target, defines etc) against systems where the project does compile.
The actual error comes when compiling vecLib source.It seems to be a set of random error messages I would trace back to the lack of c++ std headers.. Here are a few examples:
Explicite specialization of non-template class 'complex'
Redifinition of complex as different kind of symbol
Did anybody run into similar problems when working with newer Xcodes against older SDKs?
EDIT
Here is some more informations. After checking what was behind the redifinition, I found that for some odd reason, the complex definition that was interfering with the forward declaration in the file comes from /usr/include/c++/4.2.1. I think that the header is outdated or at least not compatible with c++11. I checked again what the compiler used and the lib / language (std=c++11 and stdlib=libc++) where correctly set. I have the strange feeling that the source in user/include isn't supposed to be included but I don't know how to fix it.
EDIT 2
I've checked the standard include paths with cpp -v and got the following list:
/usr/local/include
/Applications/XCode/.../XCodeDefault.xtoolchain/usr/bin/../lib/clang/7.3.0/include
/Applications/XCode/.../XCodeDefault.xtoolchain/usr/include
/usr/include
/System/Library/Frameworks
/Library/Frameworks
The definition of complex in the Xcode toolchain (3rd entry) is the correct one, the definition in /usr/include is the one that seems to be used while compiling, leading to the error messages. The definition of complex uses structs.
What is the issue here? Is the issue that Xcode / Clang or what ever decides to go with usr/include instead of the toolchain include? I've checked the project settings and the compiler output and there was no explicit include of this path.
It seems like AppleClang 7+ and libc++ just doesn't support vecLib from OS X SDK 10.7. I had to go back to Xcode 6 to get it to build.
i have a problem with win8 and directx library. i have directx jun 2010 i added its d3dx11.lib and .h files but it doesnt work and says library not found. i found hte link bellow that says you can work with win8 sdk instead of directx libraries and d3dx.... libraries are not supported anymore.
http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275%28v=vs.85%29.aspx
i found in vs2012 there is a project that builds directx proggram but when i made a project with it it wasnt like any directx code ive seen before its more like xna
what these really mean? how should i work with these changes? its better to return to win 7 and previous libraries or work with these new tools. thanks for helping
"Where is the DirectX SDK?" explains that well. Probably you will want to read it one more time.
D3DX
D3DX and D3D is not the same. D3DX is just a helper library. Microsoft not recommends to use D3DX anymore and stripped it from SDK. So now:
For new code: "Living without D3DX" (alternative link) explains what to use instead in your new code. And here are some D3DX replacement stuff.
For old code: if you just want to build old code that uses D3DX (tutorial samples, for example), you just need to install DirectX SDK and add include/lib paths to your project, as if it was any other library. Mixing Windows SDK and DirectX SDK is not recommended and can lead to errors, so don't use it in new code. Also read here.
Probably, you will be interested to read this and that answer also.
P.S. As always, if linker says, "Library not found", double check, that you've added library path to project options and that library file exists at that folder.
Happy coding!
I try to setup a new XCode Project for Cocos2D-x by myself, but I get an odd compile error in file cocos2dx/support/zip_support/ioapi.cpp, and XCode complains about the code using fopen64, ftello64 etc. My question is that is there any setting I need to set in order to make XCode compiled with these 64 bit functions? Thanks!
You can #define USE_FILE32API, preferably in your project settings. This is caused by the new version of minizip with 64-bit support.