I'm trying to use Qt Creator for the first time, but I can't manage to get Hello World running. This is what my kit looks like:
Name: MyKit
File system name: MyKitFileSystemName
Device type: Desktop
Device: Local PC
Sysroot: (blank)
Compiler: (long path leading to mingw32\bin\g++.exe)
Environment: No changes.
Debugger: (long path leading to mingw32\bin\gdb.exe)
Qt version: 5.7.0 MSVC2015 64bit
Qt mkspec: (blank)
CMake Tool: (long path leading to cmake\bin\cmake.exe)
CMake Generator: CodeBlocks - MinGW Maketiles
CMake Configuration: (left this as default)
There are some things I should note about the kit. If I use an auto-detected kit, I can't select my compiler. There's also a red octagon next to the kit, I'm not really sure what that means.
When I try to run the Hello World program(from https://wiki.qt.io/Qt_for_Beginners), I get the following issue:
[debug] Error 258
And here's the output:
15:08:56: Running steps for project myProject...
15:08:56: Configuration unchanged, skipping qmake step.
15:08:56: Starting: "C:\Program Files (x86)\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin\mingw32-make.exe"
C:/Program Files (x86)/mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0/mingw32/bin/mingw32-make -f Makefile.Debug
/usr/bin/sh: -c: line 0: syntax error near unexpected token `('
/usr/bin/sh: -c: line 0: `C:/Program Files (x86)/mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0/mingw32/bin/mingw32-make -f Makefile.Debug'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 258
15:08:58: The process "C:\Program Files (x86)\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project myProject (kit: MyKit)
When executing step "Make"
After a quick search, I found this piece of advice: "remove c:/Program Files (x86)/Git/bin from %PATH% environment variable, and make sure QT installation and your project directory not locate at any directory with space or any special characters".
Git was not in my PATH, and there were no spaces or special characters in the QT installation directory or project directory(although there are spaces in the compiler's path).
What am I doing wrong? My best guess is that it's a problem with the compiler. The path has both "mingw-w64" and "mingw32" so I'm not really sure if it's 32-bit or 64-bit. I'm guessing that it would not work if it was 32-bit.
I hope that I'm missing something obvious so that this can be easily resolved!
Related
I'm trying to compile Qt Creator from source on MacOS 10.13 from the following repository:
https://github.com/qt-creator/qt-creator
I followed the instructions in README.md but had no success.
Most likely I missed out something.
Steps that I've done:
Installed latest Xcode
Installed LLVM using brew install --with-toolchain llvm
Installed QBS using brew install qbs
(that also brew-installed qt 5.11.1 as a dependency to /usr/local/opt/qt)
Installed precompiled Qt 5.11.1 with QtWebEngine (without sources)
Cloned Qt Creator repository into /Users/username/builds/qtcreator_src
Created directory for out-of-source build: /Users/username/builds/qtc_build
From that directory ran following commands:
export LLVM_INSTALL_DIR=/usr/local/opt/llvm
export QBS_INSTALL_DIR=/usr/local/opt/qbs
PATH=/usr/local/opt/qt/bin:/usr/local/opt/llvm/bin:$PATH
qmake -r /Users/username/builds/qtcreator_src/4.7
make
After approximately 40 minutes of compilation I get following error:
../../../../qtcreator_src/4.7/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp:29:10: fatal error: 'qbs.h' file not found
#include <qbs.h>
(I checked that the file is present in /usr/local/opt/qbs/include/qbs directory).
One more question. If I use make -j8, that boosts the build process, but then
I end up with following obscure error:
mv -f libDebugger.dylib ../../../bin/Qt\ Creator.app/Contents/PlugIns/
make[1]: *** [sub-plugins-make_first-ordered] Error 2
I could find neither additional error messages in the console output above, nor
any error.log files.
P.S. Here are original build instructions from github README.md:
# Optional, needed for the Clang Code Model if llvm-config is not in PATH:
export LLVM_INSTALL_DIR=/path/to/llvm (or "set" on Windows)
# Optional, needed to let the QbsProjectManager plugin use system Qbs:
export QBS_INSTALL_DIR=/path/to/qbs
# Optional, needed for the Python enabled dumper on Windows
set PYTHON_INSTALL_DIR=C:\path\to\python
cd $SOURCE_DIRECTORY
qmake -r
make (or mingw32-make or nmake or jom, depending on your platform)
Installation ("make install") is not needed. It is however possible, using
make install INSTALL_ROOT=$INSTALL_DIRECTORY
Update 2:
after excluding Qt from PATH I receive another error:
In file included from ../../../../qtcreator_src/4.7/src/plugins/qbsprojectmanager/customqbspropertiesdialog.cpp:29:
/usr/local/Cellar/qbs/1.12.0/include/qbs/qbs.h:63:10: fatal error:
'tools/settingsrepresentation.h' file not found
#include "tools/settingsrepresentation.h"
Update 3: I managed to build Qt Creator with the following commands issued from the build directory:
export LLVM_INSTALL_DIR=/usr/local/opt/llvm
/usr/local/opt/qt/bin/qmake /Users/username/builds/qtcreator_src/4.7
make
But even though build process completed without errors, the application doesn't run:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: EXC_I386_GPFLT
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Segmentation fault: 11
Termination Reason: Namespace SIGNAL, Code 0xb
Terminating Process: exc handler [0]
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 libBookmarks.dylib 0x0000000115166cb0 Bookmarks::Internal::BookmarksPlugin::~BookmarksPlugin() + 32
1 libExtensionSystem.4.7.0.dylib 0x000000010b58b3eb ExtensionSystem::Internal::PluginSpecPrivate::kill() + 27
2 libExtensionSystem.4.7.0.dylib 0x000000010b576778 ExtensionSystem::Internal::PluginManagerPrivate::loadPlugins() + 888
3 org.qt-project.qtcreator 0x000000010b558159 main + 13353
4 libdyld.dylib 0x00007fff7e352115 start + 1
Qt for sure shouldn’t be in the path — it’s superfluous. You can have multiple Qt versions coexisting and they are selected by invoking their respective qmake’s. Whether LLVM should be — not sure. qmake’s -r option is for the project mode and unnecessary.
cd build_dir
/qt/bin/qmake /path/to/sources
make
The whole point of using qbs would be that you replace qmake+make with just qbs. First tell qbs about the Qt version you want to use (do this just once):
qbs setup-qt /qt/bin/qmake myqt
qbs config defaultProfile myqt
Of course myqt can be whatever you want it to be.
Then build creator:
cd build_dir
qbs -f /path/to/sources
I've just installed CLion and i needed compiler. I installed Cygwin.
But there was an error:
CMake Error: Could not find CMAKE_ROOT !!!
CMake has most likely not been installed correctly.
Modules directory not found in
CMake Error: Error executing cmake::LoadCache(). Aborting.
Error code: 1
So, CMake was "bundled" and i tried to install it from site. But there was the next error:
Selected CMake might be incompatible with the Cygwin environment.
In order to run on Cygwin, CMake needs to be specially compiled.
Please select either CMake bundled with CLion or CMake from the Cygwin installation.
CMake Error: The source directory "/cygdrive/c/Users/Пользователь/AppData/Local/Temp/cmake_check_environment" does not exist.
Specify --help for usage, or press the help button on the CMake GUI.
Error code: 1
Then i've tried to install MinGW - this time it was the following problem:
-- The C compiler identification is GNU 8.1.0
-- The CXX compiler identification is GNU 8.1.0
-- Check for working C compiler: D:/MinGW/mingw64/bin/gcc.exe
-- Check for working C compiler: D:/MinGW/mingw64/bin/gcc.exe -- broken
CMake Error at D:/CLion 182.2574.4/bin/cmake/share/cmake-3.11/Modules/CMakeTestCCompiler.cmake:52 (message):
The C compiler
"D:/MinGW/mingw64/bin/gcc.exe"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: C:/Users/Пользователь/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp
Run Build Command:"D:/MinGW/mingw64/bin/mingw32-make.exe" "cmTC_a4ce5/fast"
D:/MinGW/mingw64/bin/mingw32-make.exe -f CMakeFiles\cmTC_a4ce5.dir\build.make CMakeFiles/cmTC_a4ce5.dir/build
mingw32-make.exe[1]: Entering directory 'C:/Users/╧юы№чютрЄхы№/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_a4ce5.dir/testCCompiler.c.obj
D:\MinGW\mingw64\bin\gcc.exe -o CMakeFiles\cmTC_a4ce5.dir\testCCompiler.c.obj -c C:\Users\╨Я╨╛╨╗╤М╨╖╨╛╨▓╨░╤В╨╡╨╗╤М\AppData\Local\Temp\cmake_check_environment\_build\CMakeFiles\CMakeTmp\testCCompiler.c
gcc.exe: error: C:\Users\╨Я╨╛╨╗╤М╨╖╨╛╨▓╨░╤В╨╡╨╗╤М\AppData\Local\Temp\cmake_check_environment\_build\CMakeFiles\CMakeTmp\testCCompiler.c: No such file or directory
gcc.exe: fatal error: no input files
compilation terminated.
mingw32-make.exe[1]: *** [CMakeFiles\cmTC_a4ce5.dir\build.make:65: CMakeFiles/cmTC_a4ce5.dir/testCCompiler.c.obj] Error 1
mingw32-make.exe[1]: Leaving directory 'C:/Users/╧юы№чютрЄхы№/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeTmp'
mingw32-make.exe: *** [Makefile:125: cmTC_a4ce5/fast] Error 2
CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
CMakeLists.txt:1 (project)
-- Configuring incomplete, errors occurred!
See also "C:/Users/Пользователь/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/Пользователь/AppData/Local/Temp/cmake_check_environment/_build/CMakeFiles/CMakeError.log".
Error code: 1
In both cases it's problems with paths, i think. I tried to give root to CLion, gcc, etc. - nothing.
I've tried to find logs or just way to this path - but all was worthless - path doesn't exist.I just can't find out, why that's happening.
Help me, please
Looks like there is a problem with encodings somewhere between windows/cygwin/clion/cmake (I assume you user name is non-ascii).
As a quick workaround try:
installing CLion in the location without non-latin symbols
changing CLion's system and config folders to the location without non-latin symbols. instructions
And to troubleshoot the problem, could you please check if the cygwin's console shows the user home path correctly? (e.g. use ls /cygdrive/c/Users/, then cd to the user home path).
If Cygwin can correctly work with the user home, could you please file a bug report and attach CLion's log files? (Help | Show Log in Explorer)
I'm trying to build the Iron hello world example, but have a problem with OpenSSL.
My OS is Windows 1 and I have tried Rust stable (1.7) and nightly (1.9).
I've installed OpenSSL with mingw and set the environment variables OPENSSL_LIB_DIR and OPENSSL_INCLUDE_DIR. Just in case, I've added the paths to the PATH variable. None of these changes fix the problem.
Cargo's output like in this question: compilation of openssl-sys fails with `openssl/hmac.h: No such file or directory`
failed to run custom build command for `openssl-sys-extras v0.7.6`
Process didn't exit successfully: `C:\Users\sharp_000\Dropbox\Код\Rust\MTFQ\target\release\build\openssl-sys-extras-52d5315fb71d3c6d\build-script-build` (exit code: 101)
--- stderr
thread '<main>' panicked at 'explicit panic', C:\Users\sharp_000\.cargo\registry\src\githubcom-88ac128001ac3a9a\gcc-0.3.25\src\lib.rs:818
I copied the include/openssl directory, libssl32.dll, and libeay32.dll to the Cargo directory and output changes to:
cc1.exe: fatal error: Files/mingw/include: No such file or directory compilation terminated.
thread '<main>' panicked at 'explicit panic', C:\Users\sharp_000\.cargo\registry\src\github.com-88ac128001ac3a9a\gcc-0.3.25\src\lib.rs:818
note: Run with `RUST_BACKTRACE=1` for a backtrace.
Deleting the target directory before building doesn't help.
Which Rust edition are you using? I had the same problem with the Rust MSVC edition.
I installed GCC with MSYS2 and changed Rust to the GNU edition, added gcc to my PATH and everything was OK.
I haven't used a .rc file yet. I was looking for how to set the filename/version/product name etc of a Qt assembly file, found this. I created an empty file named resources.rc and the version.h header and added in the .pro file RC_FILE = resources.rc. But when I went to build the application I get this error:
gcc: error: Message\: No such file or directory
gcc: error: Kernel: No such file or directory
windres: preprocessing failed.
Makefile.Release:158: recipe for target 'release/resources_res.o' failed
mingw32-make[1]: *** [release/resources_res.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/jack/Desktop/foo/build-Message Kernel-Desktop_Qt_5_5_0_MinGW_32bit-Release'
mingw32-make: *** [release] Error 2
makefile:34: recipe for target 'release' failed
00:43:58: The process "C:\Qt2\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project Message Kernel (kit: Desktop Qt 5.5.0 MinGW 32bit)
When executing step "Make"
How do I fix this?
Found the error! Hope this is useful to anyone!
My project name contains white spaces, by looking carefully at compiler output tab (in Qt creator) I noticied that the path passed to windres utility wasn't surrounded by quotes (as a path with spaces in name should be) causing the error:
gcc: error: Message: No such file or directory
So I just removed the spaces from project name and this worked just fine.
Here's the Qt version this is happening:
I am compiling the QCA Library for windows and using the steps from INSTALL File for for configure I am using the following command in windows console:
configure.exe --qtdir=C:\QtSDK\Desktop\Qt\4.7.3\mingw
The response is:
Configuring Qt Cryptographic Architecture (QCA) ...
Reason: There was an error compiling 'conf'. See conf.log for details.
I am trying to compile using Qt in windows directly and shows the following error:
-I"c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\ActiveQt" -I"release" -I"." -I"c:\QtSDK\Desktop\Qt\4.7.3\mingw\mkspecs\win32-g++" -o release\mlock.o ..\..\Encryption-QCA\src\botantools\botan\ml_win32\mlock.cpp
In file included from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/objbase.h:73,
from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/ole2.h:9,
from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/windows.h:114,
from ..\..\Encryption-QCA\src\botantools\botan\ml_win32\mlock.cpp:37:
c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/objidl.h:95: error: expected unqualified-id before string constant
mingw32-make[2]: Leaving directory `C:/Users/AlejoLina/Documents/Alejandro/Compacta/SE-HA_Tool/Encryption-QCA-build-desktop/src'
mingw32-make[1]: Leaving directory `C:/Users/AlejoLina/Documents/Alejandro/Compacta/SE-HA_Tool/Encryption-QCA-build-desktop/src'
mingw32-make[2]: *** [release/mlock.o] Error 1
mingw32-make[1]: *** [release] Error 2
mingw32-make: *** [sub-src-make_default] Error 2
The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project qca (target: Desktop)
When executing build step 'Make'
Thanks in advance for the help
I can't say for sure that this is your problem but you may want to try using the make that is available with MSYS. I've always had better success with it. From MinGW's own FAQ..
The "native" (i.e.: MSVCRT dependent)
port of make is lacking in some
functionality and has modified
functionality due to the lack of POSIX
on Win32.
The problem in the configure was that the executable doesnt find the windows make (mingw-make).
The solution is to put the right path to the envinronment variables (qt and mingw bin path).