Results 1 to 10 of 10

Thread: Qt Android Application in Visual Studio

  1. #1
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Qt Android Application in Visual Studio

    I'd like to know if it's possible to develop Qt android applications with Visual Studio. If so, could somebody give me advice on how to do that? I use Visual Studio 2015 (Community) and Qt 5.6 (Windows + Android versions) running on Windows 8.1 x64.

    I succeeded in building Qt sensors sample with Qt Creator, but when I try to create a Visual Studio project
    Qt Code:
    1. C:\Qt\5.6.0-android\5.6\android_armv7\bin\qmake.exe -spec win32-msvc2015 -tp vc
    To copy to clipboard, switch view to plain text mode 
    it generates a desktop-like application targeting x86 architecture (ARM is not available) which in addition fails to compile not finding "GLES2/gl2.h".
    Magicians do not exist

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,073
    Thanks
    233
    Thanked 649 Times in 639 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt Android Application in Visual Studio

    You are including the wrong mkspec file. Even though you are building through Visual Studio, it is using the android g++ toolchain. So you have to tell qmake to use the android-g++ mkspec.

    Magicians do not exist
    That's just an illusion.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Qt Android Application in Visual Studio

    Ok, I tried this
    Qt Code:
    1. C:\Qt\5.6.0-android\5.6\android_armv7\bin\qmake.exe -spec android-g++ -tp vc
    To copy to clipboard, switch view to plain text mode 
    and this
    Qt Code:
    1. C:\Qt\5.6.0-android\5.6\android_armv7\bin\qmake.exe -spec android-g++ -t vcapp
    To copy to clipboard, switch view to plain text mode 
    The answer is
    Qt Code:
    1. WARNING: Unable to generate output for: Z:/test/Makefile [TEMPLATE vcapp]
    To copy to clipboard, switch view to plain text mode 
    Not sure what Makefile it tried to generate output for as there is no Makefile. I have only a .pro file and want to generate visual studio project for android development.
    Magicians do not exist

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,073
    Thanks
    233
    Thanked 649 Times in 639 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt Android Application in Visual Studio

    What happens if you import the .pro file into Visual Studio using the Qt VS Plugin? If you build it from within VS, at some point you will have to tell VS which toolchain to use (via the "Configuration Manager"). You are sort of trying to mix apples and oranges here - either let qmake do the work of managing your project or let Visual Studio do it. So if you use the VS plugin wizard to start your project from scratch from within VS, then you'll likely have fewer mismatch issues.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  5. #5
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Qt Android Application in Visual Studio

    If you mean Qt Visual Studio Add-in, as far as I know it doesn't work with VS2015, which I use:
    http://blog.qt.io/blog/2016/03/16/qt-5-6-released/

    Thus, I can't try that...
    Magicians do not exist

  6. #6
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,073
    Thanks
    233
    Thanked 649 Times in 639 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt Android Application in Visual Studio

    I don't know about that. It's working for me.

    The Add-in installs itself to VS 2015, as the "Help -> About" in VS 2015 shows.

    Qt Code:
    1. Microsoft Visual Studio Professional 2015
    2. Version 14.0.23107.0 D14REL
    3. Microsoft .NET Framework
    4. Version 4.6.01038
    5.  
    6. Installed Version: Professional
    7.  
    8. Visual Basic 2015 00322-50050-...
    9. Microsoft Visual Basic 2015
    10.  
    11. Visual C# 2015 00322-50050-...
    12. Microsoft Visual C# 2015
    13.  
    14. Visual C++ 2015 00322-50050-...
    15. Microsoft Visual C++ 2015
    16.  
    17. AnkhSVN - Subversion Support for Visual Studio 2.6.12735.14
    18. AnkhSVN - Subversion Support for Visual Studio 2.6.12735.14
    19. * Ankh.Package 2.6.12735.14
    20. * Subversion 1.9.2 via SharpSvn 1.9002.3777.76
    21.  
    22. SharpSvn is linked to: Apr 1.5.1, Apr-util 1.5.4, Cyrus Sasl 2.1.26, eXpat 2.1.0, LibSSH2 1.6.0, OpenSSL 1.0.2d 9 Jul 2015, Serf 1.3.8, SQLite 3.8.11.1, Subversion 1.9.2-SharpSvn, Utf8proc 1.1.5, ZLib 1.2.8
    23. SharpSvn is optionally linked to: Berkeley DB 4.4.20, SharpPlink 0.65.0(SharpSvn)
    24.  
    25. Atomineer Pro Documentation 1.0
    26. Source-code documentation-comment creation and maintenance, and other documentation-related tools.
    27.  
    28. Common Azure Tools 1.5
    29. Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.
    30.  
    31. GenerateUnitTest 1.0
    32. Generates unit test code for methods in classes under test.
    33.  
    34. GitHub.VisualStudio 1.0
    35. A Visual Studio Extension that brings the GitHub Flow into Visual Studio.
    36.  
    37. Intel® Parallel Studio XE 2016 Update 2 Composer Edition for C++ Windows* Package ID: w_comp_lib_2016.2.180
    38. Intel® Parallel Studio XE 2016 Update 2 Composer Edition for C++ Windows* Integration for Microsoft* Visual Studio* 2015, Version 16.0.107.14, Copyright © 2002-2016 Intel Corporation. All rights reserved.
    39. * Other names and brands may be claimed as the property of others.
    40.  
    41. Microsoft Azure Mobile Services Tools 1.4
    42. Microsoft Azure Mobile Services Tools
    43.  
    44. Microsoft MI-Based Debugger 1.0
    45. Provides support for connecting Visual Studio to MI compatible debuggers
    46.  
    47. NuGet Package Manager 3.0.0
    48. NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.
    49.  
    50. NVIDIA Nsight Visual Studio Edition 5.1.0.16062
    51. NVIDIA Nsight Visual Studio Edition provides tools for GPGPU and graphics development. Copyright © NVIDIA 2010 - 2016.
    52. •Direct3D® and DirectX® are registered trademarks of Microsoft Corporation in the United States and/or other countries.
    53. •Microsoft Detours is used under the Professional license (http://research.microsoft.com/en-us/projects/detours/).
    54. •Gardens Point Parser Generator Copyright 2005 Queensland University of Technology (QUT). All rights reserved.
    55. •NLog Copyright © 2004-2006 Jaroslaw Kowalski (jaak@jkowalski.net)
    56. •IronPython and WPFToolkit used under Microsoft Public License (Ms-PL) and are Copyright © Microsoft Corporation
    57. •Portions of RadControls for WPF © 2010-2011 by Telerik Corporation. All rights reserved.
    58. •zlib and libpng used under the zlib/libpnc license (http://opensource.org/licenses/Zlib)
    59.  
    60. Warning: This computer program is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this program, or any portion of it, may result in severe civil and criminal penalties, and will be prosecuted to the maximum extent possible under the law.
    61.  
    62. PreEmptive Analytics Visualizer 1.2
    63. Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.
    64.  
    65. Python Tools for Visual Studio 2.2.30718.00
    66. Python Tools for Visual Studio provides IntelliSense, projects, templates, Interactive windows, and other support for Python developers.
    67.  
    68. Python Tools for Visual Studio - Django Integration 2.2.30718.00
    69. Provides templates and integration for the Django web framework.
    70.  
    71. Python Tools for Visual Studio - Profiling Support 2.2.30718.00
    72. Profiling support for Python projects.
    73.  
    74. Qt5Package 1.3.9
    75. Fully functional repeats Qt VS Addin
    76.  
    77. Visual Assist
    78. For more information about Visual Assist, see the Whole Tomato Software website at http://www.WholeTomato.com. Copyright (c) 1997-2016 Whole Tomato Software, Inc.
    79.  
    80. Visual C++ for Cross Platform Mobile Development 1.0
    81. Visual C++ for Cross Platform Mobile Development
    82.  
    83. Visual C++ for Cross Platform Mobile Development 1.0
    84. Visual C++ for Cross Platform Mobile Development
    To copy to clipboard, switch view to plain text mode 

    And as the screenshot shows, it works when adding a new project to a solution:

    Capture.jpg
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  7. #7
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Qt Android Application in Visual Studio

    Ok, Qt5Package seems to be a third-party replacement for Qt Add-in. I've just installed it. Unfortunately it doesn't work well. Probably, because I have several Qt versions installed and the primary qmake points to Qt4 location.

    The first issue I faced when trying to open the .pro file. It complained about not finding qmake and asked whether I had set the qt version. So I tried to add the version for android:
    Version name: 5.6-android-armv7
    Path: C:\Qt\5.6.0-android\5.6\android_armv7
    It failed with the following error:
    This Qt version uses an unsupported makefile generator (used: , supported: MSVC.NET, MSBUILD)
    Then I tried to add a Qt5 version for desktop:
    Qt Version: 5.6-desktop
    Path: C:\Qt\5.6.0\5.6\msvc2015
    It seemed to work fine, but when I try to build a newly created GUI application it fails with the following:
    1>------ Build started: Project: testqtgui, Configuration: Debug Win32 ------
    1> Moc'ing testqtgui.h...
    1> The system cannot find the path specified.
    1> Uic'ing testqtgui.ui...
    1> The system cannot find the path specified.
    1> Rcc'ing testqtgui.qrc...
    1> The system cannot find the path specified.
    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cp pCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code 3.
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
    A console application fails to compile in a different way. It can't find QtCore.

    Building qmake-generated project in VS still works fine, but not for android.
    Magicians do not exist

  8. #8
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,073
    Thanks
    233
    Thanked 649 Times in 639 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt Android Application in Visual Studio

    This Qt version uses an unsupported makefile generator (used: , supported: MSVC.NET, MSBUILD)
    Google is your friend on this one. Search the entire quoted string, first hit gives the answer.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  9. #9
    Join Date
    Feb 2011
    Posts
    354
    Thanks
    17
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows

    Default Re: Qt Android Application in Visual Studio

    Nope... Google didn't prove to be a good friend in this case. The first answer is about Qt5.6-windows-beta and the error is slightly different: they seemed to have their MAKEFILE_GENERATOR set to a wrong value, while mine isn't set at all. I have tried all the suggestions, but none of them worked.

    I've found somebody else reporting the same problem for this very extension about Qt-WinRT version, but nobody replied to him:
    https://visualstudiogallery.msdn.mic...2-e4fa07168408
    Magicians do not exist

  10. #10
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,073
    Thanks
    233
    Thanked 649 Times in 639 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Qt Android Application in Visual Studio

    Well, sorry. You -can- configure Qt Creator to use the android compilers if you want to go that route instead of using Visual Studio, but I prefer VS myself.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 1
    Last Post: 12th January 2016, 14:16
  2. Using Qt 5.4.1 Visual Studio 2013 libs in Visual Studio 2010
    By ^NyAw^ in forum Installation and Deployment
    Replies: 0
    Last Post: 6th March 2015, 10:20
  3. Replies: 2
    Last Post: 24th December 2011, 00:19
  4. Unable to run debug exe of Qt application in visual studio 2008
    By merry in forum Installation and Deployment
    Replies: 9
    Last Post: 8th October 2010, 09:24
  5. Build application using visual studio 6 ?
    By aamer4yu in forum Newbie
    Replies: 1
    Last Post: 3rd October 2006, 09:34

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.