After installing Xcode 6, my Xcode 5 seems to have stopped performing static analysis on my main app target. I can run Build & Analyze and it turns up static analysis issues in sub projects, but not my main target.
I've tried reinstalling Xcode 5, but it has not helped. I have also tried installing the clang-checker separately and following the instructions for incorporating it into Xcode. After installing the clang-checker I'm seeing analysis for some of the files in my app target, but not all of them. It looks like any C++ or Objective-C++ files in my project are not being analyzed.
If I run scan-build from the command line to try to analyze my project outside of Xcode, I get "analyzer issues" with all of the .mm files.
Has anybody got any suggestions for fixes for this behavior? Thanks!
Related
I am trying to build a large C++ framework in VSCode using CMakeTools and C/C++ Extensions in Visual Studio Code. I am browsing stackoverflow/github issues/any google suggestion and it looks like I am not the first person to encounter this, but I can not figure out for the life of me what am I doing wrong.
Here is the problem. I want to setup VSCode in a way to be able to build the framework (it is C++) right from VSCode using the built-in tools/extensions. Here is the process I was using up until now (in standard terminal in linux) and it also works in terminal run in VSCode:
cd /path-to-project-main-folder
source scripts/env.sh
cmake .
make -j 10
Now the problem is that when I set up VSCode, open the folder where the framework is, VSCode recognizes it is cmake project and gives me the opportunity to build it. Problem is that when I try to build it, it does not set up the environment first and therefore uses wrong cmake (not the sourced one but the default one build in server) and also wrong libraries and some of them are not even recognized.
The problem is in the first line:
source scripts/env.sh
where the environment variables are set and also PATHs to some libraries and programs. This line is not ran by VSCode before cmake and build.
Does anyone know a solution on how to configure CMakeTools extension to run:
source scripts/env.sh
line before running cmake and then make?
Thank you
I was looking into some solutions using tasks.json, settings.json files or creating my own kit. But no solution worked for me or I did not completely undestood the solution:
https://github.com/microsoft/vscode-cmake-tools/blob/HEAD/docs/tasks.md
https://github.com/microsoft/vscode-cmake-tools/issues/2243
https://github.com/microsoft/vscode-cmake-tools/pull/995
VSCode: Set environment variables via script
and man pages of CMakeTools, VSCode,...
VScode remote development: How can I run a build task to source environment variables before running the real build task? ---> but I use cmake
VSCode, how to source environment variable files like setup.bash?
I ran into a strange issue testing Metal cpp. The following project is almost the same as Apple's official Metal Cpp example project.
https://github.com/shi-yan/testmetal
The apple official example contains an Xcode project, whereas my modified version tries to use cmake.
My cmake project builds and runs, but the window is empty. I debugged it, the root cause is that the drawInMTKView function never gets called.
If I generate an Xcode project using cmake, then build and run my code in Xcode, the resulting app can render to its window just fine.
However, if I run the same app binary through the terminal, it will show an empty window again.
Any idea what might cause this? Thanks.
Thanks to an Apple engineer, the issue is resolved.
My CMakeLists.txt doesn't load MetalKit. XCode can load MetalKit automatically, hence there was no issue running it via xcode.
Adding MetalKit to my CMakeList.txt solved the issue.
I have been unsuccessfully trying to compile a c++/blueprint project using Plugins like SocketIO-for-UE or VA-REST. And now that i realize any C++ fails. creating C++ in Source folder also leads to the same error.
Cannot even start a new C++ Project. It Fails to compile and ask me to build through an IDE.
Starts with:
"Rebuild Now" gives:
I tried few approaches but nothing seems to work.
GenerateProjectFiles.sh /path/to/.uproject
the above generated a Makefile in the project root, Having that imported to Kdevelop, build seems to work fine but doesn't seem to compile or do any thing with the Plugins folder.
Any help would be much appreciated and will generate lot of good karma for you.
I'm Using:
UE4 4.26.1 (Crashes regularly) & 4.26.2
Ubuntu 20
Kdevelop 5.5
I'm trying to compile an existing c++ project, originally developed on linux with gcc. The only external library is GSL (GNU Scientific Library). I have created an external build tool project to use xcode's debugger, but I currently have two issues.
1) When I try to build in xcode it fails with the error 'gsl/gsl_matrix.h' file not found. I have added /usr/local/include to the HEADER_SEARCH_PATHS and confirmed that there is a gsl folder in that location, which contains all of the header files (installed with brew). However, if I type make in the CL then the project compiles without any errors, so I know there isn't an issue with my GSL, the makefile or the switch from gcc to clang.
I've looked at Xcode 6.3.2 unable to build or run projects, and updated my xcode CL tools just in base, but I was already on the latest (2339).
2) While it would be nice to build from within xcode, it's not the end of the world if I have to build from the CL everytime. Once I've compiled everything I can run it from xcode, however, none of my breakpoints are hit. I have set the executable and the custom working directory in my debug scheme (as indicated by Run C program in Xcode 4 using makefile). I've also looked through Why aren't my breakpoints working? and haven't found anything that works.
I thought it might be operator error since I'm running the target with Product->Run, but I don't see any option to specifically start debug mode like intellij. I'm also able to pause the code and the debugger view comes up, but when I pause it just shows me the assembly instructions.
Well I've figured out both of my issues.
1) In the external build tool configuration I had to uncheck 'Pass build settings in environment'.
2) I'm a bit of an idiot here...I'd tried adding -g to my $(FLAGS) variable, but realized that was only applying to my executable. I modified the makefile to compile every single source file with -g and then breakpoints stopped on the source code (as opposed to disassembly).
Running or debugging anything gives me an extremely frustrating "Launch failed. Binary not found" error. I'm using Eclipse with a CDT plugin installed (specifically, I have the MinGW package installed).
I already tried setting both the user and system PATH variables to include my (MinGW directory)/bin
I also tried building the program before running it.
I also made sure that PE Windows Parser under the project's settings was enabled.
I went to Project Properties > Run/Debug Settings > New > C/C++ Application > Environment > Select > and I selected the Path
I also tried setting the C/C++ Application in the Main tab to the executable file that is made from building the program, but no such file is made when I do build my program. I seriously doubt that this is what's causing the problem, though.
I'm running out of options, and the problem still persists. What else needs to be done? What am I doing wrong?
When I was looking through the install instructions for MinGW, the tutorial referenced the mingw base package as the package to install after installing MinGW. But mingw base was not available to me. Instead, I saw mingw32 base. Could it be that Eclipse, a 64 bit program, is trying to run 32 bit code? Is that what's going on? If that's the problem, how do I fix it?
Build
Refresh the project. A new folder named Binaries will appear now in project explorer.
Now Run :)
It took me 3 days to figure out my problem. My Hello World C program would compile in eclipse using the Windows PE Parser, but there was NO EXE FILE!!!! AVAST Antivirus was identifying the exe file as a false positive and removing it....grrrrr. The solution was to add the eclipse workspace folder to the exclusions list. Voila!! Eclipse generated my test.exe file.
save the file first before you build and run... it works with me
Check the compiler you set while you created the project . If that is MINGW or Visual Studio ; check whether they are downloaded or not . If not do so and start a new project by closing the old one . Build the new project by pressing Ctrl + B and a new file 'Binaries' is created in the package explorer . Now you can use the run option to run the project .
First the solution: install "make"
I had the same issue.
I also tried the steps you did with no luck.
After some time i found a the solution!
The problem was that i did not have the application "make".
Apparently its not installed by default on Cygwin and eclipse doesn't give any indication for that...