Cannot configure QtCreator using CMake on Ubuntu 18.04 - cmake

I am trying to setup a project based on CMake with QtCreator.
In Projects I defined the Build Steps I need.
In the Build setting I get constantly the error message:
Failed to activate protocol version: "CMAKE_GENERATOR" is set but incompatible with configured generator value
I tried to browse on the Internet for this problem but I could not get rid of this error.
If now I however try to build my project specifying a target, my compile steps are not executed, instead, I get the following message:
Running "/usr/local/bin/cmake -E server --pipe=/tmp/cmake-W2VOXm/socket --experimental" in xxxx/.Build/release.
CMake Project parsing failed.
Parsing of CMake project failed: Connection to CMake server lost.
Restarting QtCreator does not help, each time the project is opened the message happens again.

Make sure the build directory it's in the same directory than your projects is, like this:

I got a similar error and have fixed it.
Try to reinstall cmake in Ubuntu by follwing https://cgold.readthedocs.io/en/latest/first-step/installation.html#ubuntu.
Configurate Tools - Options - build & run regarding "cmake" and "kits". Make sure that one of the configurations (auto-detected or maunal) is corrected.
restart qt creator, open project and "run cmake" again.

I have seen and resolved this issue previously by just deleting the build folder, reloading qtcreator and rerunning cmake.

Related

Running software build in MSYS2 MINGW32 shell

I'm trying to run a piece of software I built in MSYS2 MINGW32 shell. The software is 32bits (don't have time to port it to 64bits) and there is one statically linked executable. Here is how I setup the build environment:
Installed a fresh copy of MSYS2;
$ pacman -Syu
Installed the following packages: git mingw-w64-i686-gcc mingw-w64-i686-cmake mingw-w64-i686-SDL mingw-w64-i686-SDL_mixer mingw-w64-i686-zlib mingw-w64-i686-libpng mingw-w64-i686-make
Git checkout the repo
Run the build in CMake
Build runs fine and the exe is generated.
Now the problem starts: the executable can't run and displays an error message about missing DLLs. I copied the missing DLLs to the same folder of the executable, and them another error message pops up complaining about error 0xC000007B, which I tracked down to be missing dependencies. After a while I figured out that the problem was that some of the DLLs is missing a dependency itself. Copied this last dependency to the folder.
Now, the big question: I can run the exe perfectly fine in the MINGW32 shell but I can't run it neither in cmd.exe nor by double-clicking in Windows Explorer and this is a problem (I can't ship a software this way). Is there any way to produce a binary that is able to run from explorer and from cmd.exe? What is the cause of this problem? Can it be mitigated?
I solved my problem!
After a lot of research, I realized that nothing was wrong with my MSYS2 build/setup/dependencies. The real problem was that CMake hide one parameter for the linker: -mwindows. Actually, the CMake find_package routine from one of the libraries I'm using (SDL) added this parameter to the linker command line parameters.
Adding a -mconsole to the linker parameters (using add_link_options("-mconsole")) solved the problem. The CLI now works as expected.
Thank you all for your help.

impossible to install a intellij idea

I downloaded the ultimate version of IntelliJ from the official website and when I do ./idea.sh in the .. /bin directory of the file I get this error message in the terminal:
OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.Error opening zip file or JAR manifest missing : /root/.jetbrains/jetbrains-agent-v3.2.0.de72.619 Error occurred during initialization of VM agent library failed to init: instrument
I don't know if I am supposed to have a .jetbrains file in my repersonel if so why I don't have it and if not how to get it?
Cordially...
What's the environment of your machine and I do not think you need to care about how to get .jetbrains manually by yourself. I've installed a IntelliJ idea on Ubuntu18.04, it works well. You can try run it as an administrative, also you can go to ./bin folder and then run ./idea.sh rather than ../bin folder
btw, as I said install, it does not indicate we need to compile it and get some executable binary file to run it. It's a green software that contains anything you need, you can run it directly
The Error opening zip file or JAR manifest missing : /root/.jetbrains/jetbrains-agent-v3.2.0.de72.619 error indicate that there is a problem with the distribution you have downloaded. It was corrupted or modified improperly.
Re-download it from https://www.jetbrains.com/idea/download and install into a new empty directory.
You can also try deleting the IDE's config and system directories.

VS Code + CMake : cmake.build not found

I have CMake working perfectly fine with Visual Studio 2015. I wanted to try VS Code with C++ and CMake extensions, but when I try to call the build command (configured to F7 by default with the CMake extension for VSCode), I only get the message:
command 'cmake.build' not found
Is it trying to tell me it can't find CMake ? Because Cmake is installed and working so... I also tried changing in the settings to the full path to cmake with no success. I installed both CMake and CMake Tools from Extensions. Also the toolbar for CMake doesn't appear on the blue VSCode toolbar as shown in CMake Tools extension doc.
Edit:
The author of that extension believes they've resolved this issue in the latest version 0.9.7.
https://github.com/vector-of-bool/vscode-cmake-tools/issues/157#issuecomment-307005140
So, I've just pushed 0.9.7:
No more dependency on twxs.cmake, so that shouldn't be causing any
issues anymore
#ytimenkov fixed some version parsing code that was
lying about what version of CMake was installed. Should fix issues
people are seeing with pre-3.7 versions.
#ytimenkov added better
errors when initialization failed. This should help create future
tickets!
As such, I'm going to close this issue and ask that anyone
with any further issues open a new ticket using the new error messages
that appear during a failed initialization.
I too had this issue and was given a solution here in my ticket.
For some people, one of their dependencies isn't getting installed correctly on our system. So you need to install another additional extension to get it to work.
It's called "CMake" or "twxs.cmake" (actual package name) and can be found here: https://marketplace.visualstudio.com/items?itemName=twxs.cmake
If it still isn't working, some have reported that they needed to uninstall both extensions then reinstall them both to get it to work--making sure to restart VSCode.
try this:
create a new copy of "mingw32-make.exe".
rename the copy to "make.exe".
restart your vscode.

Build using TeamCity: Failed to start MSBuild; please specify a nuspec or project file to use

I'm trying to build a website in Teamcity, but the first build step "starting MSBuild" is failing.It seems that the command is trying to install nuget, but it is complaining that there is no nuspec or project file specified.
I have a "nuget.targets" file and the code compiles fine outside of teamcity , so I think it must be a setting I am missing, and not a file I actually need to add but maybe I do need to add a nuspec or project file? Assuming I do, how would I go about doing that?
[Exec] C:\TeamCity\buildAgent\work\61cf1fbc18b86c6f\.nuget\NuGet.targets
(109, 9): Please specify a nuspec or project file to use.
I am completely new to Teamcity (~3hrs); how do I resolve this problem?
If a build fails or behaves differntly in TeamCity than locally, then it is recommended to run the build in the working folder on agent machine under the same user that the agent is running. Find more details here.

Building C# (Mono) Solution from GitHub with TeamCity on CentOS

I am trying to get TeamCity to do automated builds for me on CentOS, however if I create a runner type of 'MSBuild' I get the following error
Failed to start MSBuild.exe. Failed to find msbuild.exe at path: /usr/lib/mono/4.0/xbuild.exe
I tried a runner type of 'Visual Studio (sln)' setting Visual Studio to be 2012 and got the following error
No enabled compatible agents for this build configuration.
When I look at my Agent Requirements, I see:
Unmet requirements: DotNetFramework4.5_x86 exists
I honestly have no idea what could be wrong. Mono is up and running on this machine, as it is hosting a website built with Mono. Could somebody with a bit more experience let me know what I have done wrong please?
[EDIT]
I have just tried creating a symbolic link of where xbuild actually lives to where TeamCity wants it.
ln -s /usr/bin/xbuild /usr/lib/mono/4.0/xbuild.exe
I now am getting the following error in the Build log, so I am thinking it doesn't like symbolic links.
[MSBuild output] Cannot open assembly '/usr/lib/mono/4.0/xbuild.exe': File does not contain a valid CIL image.
I was able to get around this by adding an environment variable to the buildAgent.properties file on the build agent. Once you find that file add something like this in the Environment Variables section:
env.MSBuild=/usr/local/lib/mono/xbuild/12.0/bin/
I was doing this with ubuntu so that path might not be the same as what you were looking for.