Comments (11)
Hi, can you please post the full log from the cmake command and any other commands you ran? In case there's more interesting info.
Please also attach the generated CMakeCache.txt.
The fact that a plain #include <iostream>
doesn't work suggests an issue with the setup, not really specific to Fruit. You can probably repro the same issue building a hello world program (with cmake).
You're already overriding the compiler locations, maybe you also need some flags to override the standard library locations?
Or maybe you installed the clang binaries but not the standard library headers?
from fruit.
I also found this:
opencv/opencv#8742 (comment)
Maybe you need similar cmake flags? Notably the tool chain override.
from fruit.
Appreciate the fast response :)
The entire CMake log and CMakeCache is here.
I will be attempting the toolchain override soon to see if that improves.
from fruit.
This is a log attempting to use the Android toolchain override.
https://gist.github.com/Fernthedev/d89c5f1d8797406af0411b4b1f7d479c
To clarify, I've used theses flags on another project being mimalloc
with success, I'm not sure how Fruit differs to it however.
from fruit.
There are warnings that the build may be incomplete due to clock skew.
Maybe delete the build dir and try from scratch to see if it's different?
Make uses timestamps to decide what to rebuild so otherwise it may not be building everything it should.
You might also want to try using -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF in case it's just the PCH compilation failing.
mimalloc seems to be a C library so the fact that it builds doesn't say much on whether the C++ STL is installed correctly and the C++-related cmake flags are correct.
You can also run make in verbose mode, as make VERBOSE=1
to see the exact command that is failing (that you can then run on its own manually playing around with flags to see if sth helps).
Btw, what make command are you running? Just make with no arguments or sth else?
from fruit.
-DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF
fixes it however I'm not sure if that guarantees it will work. Every build run has been with a completely new cache (I've essentially just removed all changed/added files using git)
I was running make -j
which you can see at the end of my long CMake build command.
from fruit.
Would you mind telling me where the built files would be? Checking out/release
it doesn't seem to have any .a
or .so
files 🤔
from fruit.
Oh great then it should be ok.
Pre compiled headers are a bit of an advanced feature, i guess they don't work well with cross compilation.
You can do make install DESTDIR=/some/dir
to install the built fruit there.
Iirc the lib in the build tree ends up in src, but it's better to use make install than hunting down the various built pieces manually.
from fruit.
Alright I found it in the src
folder. Thank you very much for your help and I'll be closing the issue as it seems (for now) to be building correctly.
Have a good day :)
from fruit.
Great!
Can you please post the final working command here in case someone else needs to do this in the future?
from fruit.
export CC=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang
export CXX=$ANDROID_NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/clang++
cmake . -DCMAKE_BUILD_TYPE=Release -DFRUIT_USES_BOOST=False -DCMAKE_SYSTEM_NAME=Android -DCMAKE_ANDROID_API=24 -DCMAKE_ANDROID_ARCH_ABI=arm64-v8a -DCMAKE_ANDROID_NDK=$ANDROID_NDK_ROOT -DCMAKE_ANDROID_STL_TYPE=c++_static -DCXX_STANDARD=20 -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake -DANDROID_TOOLCHAIN=clang -DFRUIT_TESTS_USE_PRECOMPILED_HEADERS=OFF && make -j
seems to work nicely. I'll be trying linking in a while though so I may come back to this at a later date.
from fruit.
Related Issues (20)
- Fruit does not build in Visual Studio Versions 2019, 2022 or 2022 Preview with CMake HOT 8
- what should I do to use a string as an annotion of some bind? HOT 3
- VS2022 Just My Code for Fruit Library fails using CMAKE HOT 6
- Create a fruit::Component by iterating over a list of fruit::Components HOT 7
- Can fruit be used with C language? HOT 2
- Handling lifetimes HOT 6
- Providing non-injected arguments to DI Objects HOT 14
- Build fails with Visual Studio 2022 with C++20 HOT 8
- Fruit with QT HOT 4
- Factories with reference types broken in fruit 3.7.0
- Generic binding? HOT 2
- Defining Factory Functions for Objects with Multiple Constructors HOT 11
- Replace boost HOT 1
- Creating Collections of DI Objects HOT 3
- [Suggestion] ExtractFirstError meta function SHOULD be non-error safe HOT 2
- Can no longer build examples in VS2022 Preview built by Visual Studio, VS CMake builds OK HOT 7
- Examples miss virtual dtor
- bindInstance with copy HOT 13
- Understanding Compiler error messages in Fruit HOT 6
- Adding a special constructor to one implementation of an interface HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fruit.