I'm trying to build Qt6 from Sources that i downloaded with Open Source Installer.
Starting from "C:\Qt\6.2.3\Src" folder I opened Command Prompt and entered:
configure.bat -static
Configured successfully. then i builded with :
cmake --build . --parallel
Then it crashed for no enough space. but I cant find builded Sources to delete them. and undo building.
Related
I am Developing a GUI using QT framework; QT-Creator for front-end development and building the app. I am cross-compiling the code that will be running on RaspberryPi and host machine Ubuntu20.04. I am able to build the application through QT-Creator but I want to compile the code through terminal i.e. write CMakeLists.txt that will detect the cross-compiler and build the source-code. Because I need to integrate my GUI code into my other source-code and have to compile from Source-code makefile.
Can anyone help me in this?
Once I have created a screen and compiled through command line. I have tried to compile from terminal through command:
cmake .
to configure the cmake into the current directory. But I am getting error into this
cmake --build . --target clean
(to clean the directory and remove the object files), and
cmake --build . --target all
(to build the executable into the current directory)
Ideally, this should run and binary file should be generated into the current directory that will be running on target board after copying to the board.
so I just downloaded wslusing the wsl --install command using PowerShell
now I'm trying to connect it to Clion which works
i cant add images so here is a link to it
but when i'm tying to build the project i get this error
"CMake Error at CMakeLists.txt:1 (cmake_minimum_required):
CMake 3.20 or higher is required. You are running version 3.16.3"
my cmake file:
cmake_minimum_required(VERSION 3.20)
project(ex2 C)
set(CMAKE_C_STANDARD 99)
add_executable(ex2
ex2.c ex2.h
main1.c
main2.c)
i tried updating wsl using wsl --update (in powershell)
The CMake installation inside the WSL is used. Unfortunately currently snap doesn't seem to be available in WSL, but installing the latest CMake version isn't too complicated nonetheless:
(optional) uninstall the old cmake installation in WSL; personally I don't see any benefit in multiple CMake installations, but there may be valid reasons for this. Most likely this will just makes the use of cmake more complex, since you need to remember which cmake version is used.
Download the appropriate cmake version from the cmake website ( https://cmake.org/download/ ). The version to choose is the tar.gz file under binary distributions for the x86_64 target. To get version 3.21.4 (currently the latest release), you can download the file from https://github.com/Kitware/CMake/releases/download/v3.21.4/cmake-3.21.4-linux-x86_64.tar.gz (Identical to the link on the CMake download page).
Unpack the archive from WSL. Navigate to the directory where you want the cmake installation to recide. This will add the cmake-3.21.4-linux-x86_64 directory containing all the files required to work with cmake to the current working directory. Let's assume you want to add the cmake files to the /opt directory. Furthermore let's assume the windows user name to be fabian, C: to be the primary hard drive and the download to be saved to the Downloads directory in the user directory:
cd /opt
tar -xf /mnt/c/Users/fabian/Downloads/cmake-3.21.4-linux-x86_64.tar.gz
(optional) make CMake available without specifying the path; this could be done as described here: https://unix.stackexchange.com/questions/3809/how-can-i-make-a-program-executable-from-everywhere ; don't do this, if an existing cmake installation is already available in the command line assuming you did install cmake to /opt, the cmake binary recides at /opt/cmake-3.21.4-linux-x86_64/bin
You should now be able to use cmake specifying either the full path to the executable (/opt/cmake-3.21.4-linux-x86_64/bin/cmake assuming you used the /opt directory) or directly via a command after opening the WLS commandline again (provided you followed step 4).
Now the only thing left to do should be telling CLion about the location of the cmake executable. Note that I haven't tested this, since I don't use this IDE. It's working fine using Visual Studio Code though...
I try to build the gmock library from google under windows, avialable on github from here:
https://github.com/google/googletest/tree/master/googlemock
I tried to use cmake in the cygwin console, but I could not build it.
cmake C:\Users\Username\Downloads\googlemock-master\googlemock-master\googlemock
"CMake Error: The source directory "C:UsersSETDownloadsgooglemock-mastergooglemock-mastergooglemock" does not exist.
Specify --help for usage, or press the help button on the CMake GUI."
Then I installed visual studio 2017 and opened the gmock.sln file, but also this build failed.
"Error C1083: "gtest/internal/gtest-linked_ptr.h": No such file or directory gmock C:\Users\Username\Downloads\googlemock-master\googlemock-master\googlemock\include\gmock\internal\gmock-port.h"
Does anyone have an idea how I could build this library under windows 10?
Edit: Ok, for cmake the path needs to have /../ and not ..\, but i still don't get which path I need to include in cmake
Very simple:
Under the googlemock folder, create a new folder, named build (for example);
cd build && cmake ..
Basically, you're creating a new folder for the build (preferably inside the project tree, but not necessary), cd into it, and run cmake <dir>, where <dir> is the path to CMakeLists.txt, which contains the recipe for generating the build.
That's it. Now you'll have a generated gmock.sln, which you could build with Visual Studio.
For CMake to generate Visual Studio projects, you should have the Visual Studio binaries and Windows SDK reachable from your PATH.
Finally, you need to specify a generator, using CMake's -G parameter, for telling CMake which Visual Studio version you'd like projects to be generated for.
Example of putting this together:
set PATH="C:\Program Files\Microsoft Visual Studio 14.0\VC\bin";"c:\Program Files\Windows Kits\8.1\bin\x86";%PATH%
cd build
cmake -G "Visual Studio 14 2015" ..
For additional instructions, you may refer to googletest github page:
https://github.com/google/googletest/blob/master/googletest/README.md#using-cmake
I used https://github.com/open-source-parsers/jsoncpp and downloaded cmake, python, scons. Followed everything that was in build guide and cmake doesn't put what is generated in the bin directory, anyone have an idea?
Using windows 7 if that helps
The instructions are very Linux-centric. I'm guessing if you're on Windows you might be using Visual Studio, in which case the following should work (I didn't use SCONS or Python):
git clone git#github.com:open-source-parsers/jsoncpp.git
mkdir build
cd build
cmake -G"Visual Studio 12 2013 Win64" ..\jsoncpp
cmake --build . --config Debug
cmake --build . --config Release
Line 4 is specifying VS 2013 as the generator targeting a 64-bit build. To create a 32-bit build, simply omit the Win64. To see all available generators, just run cmake with no args.
Once line 4 has completed, you should have a VS solution called "jsoncpp.sln" in the root of your build folder. You can either open this and build from VS, or just use CMake to invoke the compiler by running lines 5 & 6.
Building the project also causes the tests to run, some of which fail. This makes it appear that the build has failed, but in fact you should have the test exes in the bin folder (e.g. build\bin\Debug\jsoncpp_test.exe) and the library in the lib folder (e.g. build\lib\Release\jsoncpp.lib).
I'm not sure how significant the test failures are - I'd be worried if I were you :-)
I've created the eclipse project with cmake. I use vtk with qt. Dir structure is as follows:
parent_dir:
source - source.h, source.cpp
build - this is where the .project resides
I've fired up the eclipse with workspace dir /path/parent .
I have followed the instructions described in
http://www.cmake.org/Wiki/Eclipse_CDT4_Generator .
Everything builds fine, but navigation is not working. That is, the eclipse gives me the warning that the source.h is not indexed yet.
Furthermore, autocompletion doesn't work with qt and vtk related classes. I had checked with Project|Properties, where the qt and vtk includes are included. What am I doing wrong? I would really like to have autocompletion nd navigation in eclipse working with my project. I'm using eclipse ganymede on ubuntu 8.04 64-bit.
thx in advance
According to the Wiki, you should have your build tree outside the source tree.
This linked resource isn't created if
the build directory is a subdirectory
of the source directory because
Eclipse doesn't allow to load projects
which have linked resources pointing
to a parent directory. So we recommend
to create your build directories not
as children, but as siblings to the
source directory.
You'll need to do something like this:
mkdir /home/user/parent_dir_build
cd /home/user/parent_dir_build
cmake /home/user/parent_dir
This took me quite a while to figure out.
You should make sure that the "Build" directory is really NOT part of the project directory, which means, the most high-level directory that contains the "CMakeLists.txt".
So in my case, I have "dir/tree/project_dir" and "dir/tree/project_dir/src", then I should create the build directories "dir/tree/build_dir".
Then, I created a small script that creates both Debug and Release projects:
#!/bin/sh
mkdir -p $1_build/Release
mkdir -p $1_build/Debug
cmake -E chdir $1_build/Release cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Release ../../$1
cmake -E chdir $1_build/Debug cmake -G"Eclipse CDT4 - Unix Makefiles" -DCMAKE_BUILD_TYPE=Debug ../../$1
Call the script from "dir/tree" with argument "project_dir".
Then, in Eclipse, click "File" --> "Import" --> "General" --> "Existing Projects into Workspace".
Specify the directory "dir/tree/$1_build", it will automatically recognize both projects.
Now, both Release and Debug projects are loaded into Eclipse, and you have all nice options like Code Assiste (code completion), and quick debugging by double-clicking on errors.
Note that you can add some file-filters in Eclipse to remove the CMake files from the project tree.