Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
I can' compile for Android / No puedo compilar para Android
-
Hello, since a couple of days ago I am trying to enter the world of mobile application development. I am using Qt 5.8 with Qt Creator 4.1.1 to develop android applications.
I took an example of the ones that come in Qt, to test the configuration of Qt Creator and it throws me the following errors:#error Qt requires a C++11 compiler and yours does not seem to be that #error "Qt requires C++11 support"
Please, help me with that
-
On which OS are you working?
Did you install an Android pre-build using the online installer?
-
@koahnig I'm working on Windows 10 Fall Creators Update and I have not installed an Android pre-build using the online installer because I have not access to internet at home
-
@Blaster You need Qt built for Android if you want to develop for Android.
-
@jsulm How do I get it? Can you share a link for download a offline installer?
-
@Blaster I'm not sure there is one - I cannot find it on the Qt website. I always use the online installer and Qt Maintenance Tool.
-
@jsulm So what do you suggest?
I have the Qt Creator 4.4.1 with Qt 5.8 ... is there no way to activate C++11 support?
-
@Blaster
if you need Qt 5.8, you can download it from archive:if you need the latest version, you can grab the offline installer from here
-
@dream_captain What I want is to solve the error mentioned above
-
@Blaster
What compiler are you using?
Please, post a screenshot of active kit (Options->Build&Run->Kits tab)
-
@dream_captain 
These are the kits
-
@Blaster
Seems it's MinGW related problem. Try to add-std=gnu++11
to your build command.
-
@dream_captain Where is that going exactly?
-
@Blaster
I use msvc build, so can't point the exact location. Look for something like "make arguments" in Projects->Build Steps.
-
@dream_captain Nothing happens. The same error is maintained. I'm going to download the latest version of Qt to try.
-
@dream_captain I was doing what you told me wrong. Now it gives me a single error, which says "invalid option - ="
-
@Blaster could it be possible for you to reinstall Qt and start from scratch? It seems that you'll be looking for a needle in a haystack.
If you really need to stick to Qt 5.8 release under Windows, use this link for the offline installer.
-
@Pablo-J.-Rogina let's see, and the option to reinstall the used, the same failure remains. I'm not attached to version 5.8, that's what I have, but I'm downloading version 5.9 to use that ... let's see how it goes
-
@Blaster please be aware that if you want to develop Qt application for Android, before Qt release 5.9.x the installer must refer to Android :-) i.e. "Qt 5.6.3 for Android (Linux 64-bit, 744 MB)"
-
@Pablo-J.-Rogina Yes.. thanks
-
There is no way that I can compile in Qt for android
-
Hi,
Did you install all the prerequisites listed here ?
-
@SGaist I think the only thing that may be giving the problem is the NDK. The one I have is the r8c. You could put a link to the NDK r10e to download it, which is not from Google. Is that the Google link is not allowed for my country. I am cuban
-
Do you mean that this link doesn't work ?
By the way, why are you using such an old version of Qt ? The current version is 5.10 and Qt Creator is at 4.5.
-
@SGaist The link does work, but it is not available for my country. So I can not access it, thanks to the economic and commercial blockade that the US has against Cuba. Anyway I will use a WebProxy to access.
I'm using this version of Qt because it's the one I could access, thanks to a friend. I'm a big fan of Qt and I recommend it to all the developers I know. Thanks for everything.
-
Sorry for the delay in publishing my solution. The problem was the ndk version, thanks to all those who responded
-
@Blaster ok, so if your issue is solved please don't forget to mark your post as such.
-
SOMETIMES, this will not be a configuration issue as mentioned in other answers. In my case, the problem was one file that happened to have been saved with a .CPP extension rather than .cpp. QMake (Qt5) was misidentifying the file and trying to compile it with the C compiler rather than the C++ compiler. The QMake from Qt4 was not exhibiting this issue. Renaming the file fixed the issue.
My comment at the time was "Could this really be that f&%%& simple!!"