How to install QCA for Qt Creator 5 on a Win7 32bit system



  • Hi,
    I struggle through the installation of "QCA":http://delta.affinix.com/qca/.
    I found 2 guides "here":http://www.essentialunix.org/index.php?option=com_content&view=article&id=48:qcatutorial&catid=34:qttutorials&Itemid=53 and "here":https://github.com/JPNaude/dev_notes/wiki/Using-the-Qt-Cryptographic-Architecture-with-Qt5.
    Due to the fact that english isn't my first language I don't understand everything from these guides. I couldn't even complete the first step from the first guide. So I decided to switch to the other one.

    What I have done so far: I downloaded QCA 2.1.0, CMake, Win32OpenSSL 1.0.1L and Visual C++ 2008 Redistributables (32 Bit) and installed VCRedist. and OpenSSL. I copied CMake to C:\cmake\ and QCA to C:\qca_2-1-0.
    Then i run cmake in console using cmake c:\qca_2-1-0\ (where the CMakeLists.txt is located) and get an error.
    The error message and the CMakeError.txt are listed below.

    Can someone please guide me and tell me what I'm doing wrong so that I'm able to use QCA?

    Thank you!

    Error:

    -- Building for: NMake Makefiles
    CMake Warning at CMakeLists.txt:9 (project):
    To use the NMake generator, cmake must be run from a shell that can use the
    compiler cl from the command line. This environment does not contain
    INCLUDE, LIB, or LIBPATH, and these must be set for the cl compiler to
    work.

    -- The C compiler identification is unknown
    -- The CXX compiler identification is unknown
    CMake Error at CMakeLists.txt:9 (project):
    The CMAKE_C_COMPILER:

    cl
    

    is not a full path and was not found in the PATH.

    Tell CMake where to find the compiler by setting either the environment
    variable "CC" or the CMake cache entry CMAKE_C_COMPILER to the full path to
    the compiler, or to the compiler name if it is in the PATH.

    CMake Error at CMakeLists.txt:9 (project):
    The CMAKE_CXX_COMPILER:

    cl
    

    is not a full path and was not found in the PATH.

    Tell CMake where to find the compiler by setting either the environment
    variable "CXX" or the CMake cache entry CMAKE_CXX_COMPILER to the full path
    to the compiler, or to the compiler name if it is in the PATH.

    -- Configuring incomplete, errors occurred!
    See also "C:/cmake/bin/CMakeFiles/CMakeOutput.log".
    See also "C:/cmake/bin/CMakeFiles/CMakeError.log".

    CMakeError.txt:

    Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
    Compiler: cl
    Build flags:
    Id flags:

    The output was:
    Das System kann die angegebene Datei nicht finden

    Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
    Compiler: cl
    Build flags:
    Id flags: -c

    The output was:
    Das System kann die angegebene Datei nicht finden

    Compiling the C compiler identification source file "CMakeCCompilerId.c" failed.
    Compiler: cl
    Build flags:
    Id flags: -Aa

    The output was:
    Das System kann die angegebene Datei nicht finden

    Checking whether the C compiler is IAR using "" did not match "IAR .+ Compiler":
    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
    Compiler: cl
    Build flags:
    Id flags:

    The output was:
    Das System kann die angegebene Datei nicht finden

    Compiling the CXX compiler identification source file "CMakeCXXCompilerId.cpp" failed.
    Compiler: cl
    Build flags:
    Id flags: -c

    The output was:
    Das System kann die angegebene Datei nicht finden

    Checking whether the CXX compiler is IAR using "" did not match "IAR .+ Compiler":


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Do you have Visual Studio installed ? If so, start a development command line from the Visual Studio sub-menu. That will setup the development environment that cmake is currently complaining about.



  • Hi and thanks,
    no I don't have Visual Studio. Do I need it?


  • Lifetime Qt Champion

    It depends on which version of Qt you are using. Which package did you install ?



  • Where can I find that Information? I just downloaded the community-license version. In Qt Creator->Help->About it says:
    Qt Creator 3.3.0
    Based on Qt 5.4.0 (MSVC 2010 32 bit)
    Built on Dec 08.2014 at 15:24:21
    Revision d36c4d87db

    Is that what you wanted to know?


  • Lifetime Qt Champion

    In part, the other is: which package exactly did you install ? There are severals available (the name of the file will be enough)



  • You mean the filename of the Qt installer? Sorry but I don't have that file anymore. I just took the suggested. When I download it again it suggests qt-opensource-windows-x86-online.exe so I guess that's the right one.


  • Lifetime Qt Champion

    So it's the online installer, then, in your Qt installation you should have a folder name Qt_something for the version you installed, can you tell me what the name looks like ?



  • Uhm unfortunatley I decided to call it just "Qt" during the installation process :/
    Inside that folder there are some folders called

    • 5.3
    • 5.4
    • Docs
    • Examples
    • Extas
    • Licenses
    • temp
    • Tools
    • vcredist

    There are also some files:

    • components.xml
    • InstallationLog.txt
    • MaintenanceTool.dat
    • MaintenanceTool.exe
    • MaintenanceTool.ini
    • network.xml
    • qt-project.org.html
    • README.txt
    • update.rcc


  • I can reinstall Qt if that helps.


  • Lifetime Qt Champion

    You should be able to get the information from the Maintenance tool



  • Ok, I found Qt ver. 1.0.8 with Qt 5.4 ver. 5.4.0-1 and Qt 5.3 ver. 5.3.2


  • Lifetime Qt Champion

    MSVC ? MinGW ?



  • Oh sorry I missed to open that stuff :/

    • Qt 5.4 MinGW 4.9.1 (32 bit) OpenGL ver. 5.4.0-1, Qt WebEngine ver. 5.4.0-1
    • Qt 5.3 MinGW 4.8.2 (32 bit) ver. 5.3.2-0
    • Tools: MinGW 4.8.2 ver. 4.8.2, MinGW 4.9.1 ver. 4.9.1-2
    • Qt Extras Qt Canvas and QtWebView (doesn't matter at this point I guess)

    No MSVC selected.


  • Lifetime Qt Champion

    No problem, then when calling cmake you should set the generator to "MinGW Makefiles"



  • Ok. make -G "MinGW Makefiles" c:\qca_2-1-0\ says

    CMake Error: Error: generator : MinGW Makefiles
    Does not match the generator used previously: NMake Makefiles Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory.

    Should I remove the suggested file?


  • Lifetime Qt Champion

    Yes, you can empty the folder you used



  • But this is the cmake folder c:\cmake.
    Do I only have to delete that file or can i specify a folder and how?


  • Lifetime Qt Champion

    Don't call cmake from there.

    Call it either in a build folder inside QCA's sources or at the same level as the sources



  • Ok I copied cmake into the qca folder and it said

    C:\qca_2-1-0>cmake -G "MinGW Makefiles" c:\qca_2-1-0\

    C:\qca_2-1-0>cmake -G "MinGW Makefiles" c:\qca_2-1-0
    CMake Error: Could not create named generator "MinGW CMake Error: The current CMakeCache.txt directory C:/qca_2-1-0/CMakeCache.txt is different than the directory c:/cmake/bin where CMakeCache.txt was created. This may result in binaries being created in the wrong place. If you are not sure,
    reedit the CMakeCache.txt

    Then I copied QCA into a folder inside of the cmake folder and it says

    C:\cmake\bin>cmake -G "MinGW MakeFiles" c:\cmake\bin\qca
    CMake Error: Could not create named generator MinGW MakeFiles


  • Lifetime Qt Champion

    Don't fiddle with these folders like that

    @
    cd C:\qca_2-1-0
    mkdir build
    cd build
    C:\cmake\bin\cmake .. -G "MinGW Makefiles"
    @

    And it should start setting things up.



  • I still get the error
    CMake Error: Could not create named generator MinGW MakeFiles


  • Lifetime Qt Champion

    You are writing "Makefiles" wrong the f is not uppercased



  • Oh sorry :/
    Now I get a new error. Inside the build folder there is a new file called CMakeCache.txt and a new folder called CMakeFiles in wich is also a new file called cmake.check_cache.

    C:\qca_2-1-0\build>c:\cmake\bin\cmake .. -G "MinGW Makefiles"
    CMake Error: CMake was unable to find a build program corresponding to "MinGW Ma
    kefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a differe
    nt build tool.
    CMake Error: CMake was unable to find a build program corresponding to "MinGW Ma
    kefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a differe
    nt build tool.
    CMake Error: Error required internal CMake variable not set, cmake may be not be
    built correctly.
    Missing variable is:
    CMAKE_C_COMPILER_ENV_VAR
    CMake Error: Error required internal CMake variable not set, cmake may be not be
    built correctly.
    Missing variable is:
    CMAKE_C_COMPILER
    CMake Error: Could not find cmake module file: C:/qca_2-1-0/build/CMakeFiles/3.1
    .1/CMakeCCompiler.cmake
    CMake Error: Error required internal CMake variable not set, cmake may be not be
    built correctly.
    Missing variable is:
    CMAKE_CXX_COMPILER_ENV_VAR
    CMake Error: Error required internal CMake variable not set, cmake may be not be
    built correctly.
    Missing variable is:
    CMAKE_CXX_COMPILER
    CMake Error: Could not find cmake module file: C:/qca_2-1-0/build/CMakeFiles/3.1
    .1/CMakeCXXCompiler.cmake
    CMake Error at CMakeLists.txt:9 (project):
    No CMAKE_C_COMPILER could be found.

    Tell CMake where to find the compiler by setting the CMake cache entry
    CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name
    if it is in the PATH.

    CMake Error at CMakeLists.txt:9 (project):
    No CMAKE_CXX_COMPILER could be found.

    Tell CMake where to find the compiler by setting the CMake cache entry
    CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler
    name if it is in the PATH.

    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
    -- Configuring incomplete, errors occurred!

    Edit: Maybe it helps to know that MinGW is in c:\MinGW\ with mingw-get.exe in the bin folder.


  • Lifetime Qt Champion

    Are you using a self installed MinGW or the one provided with Qt ?



  • I'm not sure but I think I installed MinGW before or after Qt by myself for some reasons. In the Tools folder of Qt are the MinGW versions I mentioned before. So I installed it at least 2 times I guess.

    Edit: I think c:\MinGW\ is the rest of an old installation. Because the folder has way less files than c:\Qt\Tools\mingw491_32\ or c:\Qt\Tools\mingw482_32\


  • Lifetime Qt Champion

    Then just remove it completely (however I don't remember if there's an entry for it in Windows Control Panel)

    IIRC, you should also have shortcut in Start Menu -> Qt that starts a command line with MinGW setup, use that one and you should be good to go.



  • I can't find any hints how to uninstall it (if even possible) so I just renamed c:\MinGW to c:\MinGW_OLD just in case I need it for something I forgot.

    In Start Menu -> Qt are only these entries

    • Qt Creator (Community)
    • Qt Maintenance Tool
    • qt-project.org
    • README
    • Unistall Qt

  • Lifetime Qt Champion

    Ok then, take a look in your Qt folder and search for a file called qtenv2.bat

    Once you have found it you can create a shortcut containing:

    @C:\Windows\System32\cmd.exe /A /Q /K C:\Qt\Qt5.4.1\5.4.1\mingw49_32\bin\qtenv2.bat@

    Adapt the path to yours

    Then start the command line using that shortcut and you should have mingw at your disposition



  • Ok, I did so. Thank you! When I run C:\qca_2-1-0\build>c:\cmake\bin\cmake .. -G "MinGW Makefiles" now, I'm getting the same error again.

    C:\qca_2-1-0\build>c:\cmake\bin\cmake .. -G "MinGW Makefiles"
    CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
    CMake Error: CMake was unable to find a build program corresponding to "MinGW Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_C_COMPILER_ENV_VAR
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_C_COMPILER
    CMake Error: Could not find cmake module file: C:/qca_2-1-0/build/CMakeFiles/3.1.2/CMakeCCompiler.cmake
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_CXX_COMPILER_ENV_VAR
    CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
    Missing variable is:
    CMAKE_CXX_COMPILER
    CMake Error: Could not find cmake module file: C:/qca_2-1-0/build/CMakeFiles/3.1.2/CMakeCXXCompiler.cmake
    CMake Error at CMakeLists.txt:9 (project): No CMAKE_C_COMPILER could be found.

    Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_C_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

    CMake Error at CMakeLists.txt:9 (project): No CMAKE_CXX_COMPILER could be found.

    Tell CMake where to find the compiler by setting the CMake cache entry CMAKE_CXX_COMPILER to the full path to the compiler, or to the compiler name if it is in the PATH.

    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
    -- Configuring incomplete, errors occurred!

    C:\qca_2-1-0\build>


  • Lifetime Qt Champion

    Did you start from a clean folder ?



  • I tried again from a clean folder and running the shortcut as admin before.
    Somehow it worked. :)
    Now I have some folders and files in c:\qca_2-1-0\build
    Thank you very much!
    How to move on from here?


  • Lifetime Qt Champion

    Admin ? Strangeā€¦

    "Here":https://github.com/JPNaude/dev_notes/wiki/Using-the-Qt-Cryptographic-Architecture-with-Qt5 you have a nice explanation on how to check that everything is fine



  • So now I have to run make from inside the build folder?


  • Lifetime Qt Champion

    run make ?
    Can you be more specific ?



  • Sorry that I didn't reply. I couldn't use the computer for a while.

    Well I don't know where to start at the given link.


  • Lifetime Qt Champion

    You can run the qcatool.exe to check that everything is in place


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.