CodeBlocks error: "File cannot be saved" -Win10 64 Bits- - c++

I'm a C++ beginner, and I recently ran into an issue where absolutely no changes to a file could be saved.
I attempted uninstalling and reinstalling Code::Blocks into the same folder and uninstalling and reinstalling into a new folder, but the error keeps coming.
The only thing I've done differently since this used to work for me was install Anaconda's SciPy suite. This may be irrelevant of course. The associated questions I could find were primarily for exotic-looking build setups, whereas I'm simply trying to get started with basic programs.
Thanks in advance for any efforts to help!

Create file and projets other than C directory . Do not create in C
They are protected folders.

Try to run CodeBlock with Administrator privilege.

Related

VSCode "go to definition" not working

I installed Visual Studio Code 1.1 with the C/C++ extension,
opened my C++ project and tried to use "Go to definition" in vain.
The "Go to definition" is not working at all.
Example, go to definition of a class member:
int i = m_myVar;
(I opened a simpler project with one file and it was working for this one)
In the end, what I want is good indexation of my big project, is there a way to install Intellisense?
I had a the same issue: F12 and Ctrl + Click and Right Click "Go To Definition" wasn't working.
The fix for me was:
Go to Extensions
Click "Disable All Installed Extensions"
Close and Reopen VS Code
Back to Extensions and "Enable All Extensions"
Essentially enable/disable all extensions fixed the issue.
I recently came across this same issue and after trying all of the suggested solutions I could find with no success, I found this article:
https://code.visualstudio.com/docs/setup/linux#_visual-studio-code-is-unable-to-watch-for-file-changes-in-this-large-workspace-error-enospc
Basically my project grew too large and VS code was no longer able to track all files, which messed up the "go to definition" functionality.
After following the steps on the link to increase the maximum number of files to be tracked, the issue was resolved.
The correction is pretty simple (tested on Ubuntu 18.04):
Add this line:
fs.inotify.max_user_watches=524288
to the end of the file /etc/sysctl.conf
After saving, run the following command:
sudo sysctl -p
Hopefully this will be useful to someone else, this has been bothering me for the last few days.
I had a similar problem except with Python and google searches for solutions kept bringing me back to this post so I figured I'd post my solution here in the hopes that it might help other people.
I was working on a remote cluster through VScode Remote and was getting similar errors to the original question(all 'go to ___' functionality was unavailable and was even getting a 'too large to track' error) and I thought I had to increase the number of watches, which didn't end up helping.
All I needed to do was install a python interpreter on the remote VScode server. This fixed my problem.
I believe vscode 1.1 (well, 1.1.1 actually) + the C++ extension (cpptools) is as much Intellisense as we can get for now.
You should load your big project with the "open folder" function to make vscode know about the other files.
https://blogs.msdn.microsoft.com/vcblog/2016/03/31/cc-extension-for-visual-studio-code/ warns about letting the indexing finish first (red icon in lower right corner during indexing) and mentions the current limitations on the source code parsing.
It wasn't working on my laptop as well after installing a few VSCode extensions. I decided to close and re-open VSCode with administrator permission and suddenly it sorted out.
I have been trying to fix this for a long time. In the end, what worked for me was simply reinstalling VSCode, then installing the latest C/C++ extension (v0.18.1). Then, in your .vscode/c_cpp_properties.json file, under includePath, add your include folder which has all your header files.
I tried the methods mentioned in this thread none of them seemed to work for me. A simple solution that worked for me is that I closed the current workspace and created a new workspace, added the folders which I required(same as the old workspace), and saved the new workspace. Waited for a couple of minutes to index and IntelliSense is able to find definitions now.
I am using VSCode 1.52.1 on Ubuntu 20.04.
In my case, for whatever reason,c_cpp_properties.json has become set to Disabled in ~/.config/Code/User/settings.json.
Manually changing it to Enabled solved the problem.
Fixed mine by UNCHECKING C_Cpp > Default > Limit Symbols To Included Headers
Your mileage may vary. Good luck!
Have you saved your workspace? Or did you just open a folder with File->Open Folder? This question already has many answers, but none of them address this case, which was my issue.
The question is not specific enough for me to know if you are having the exact same symptoms as my case.
If:
You have not saved your workspace. vscode doesn't say "(workspace)" at the top of the window.
None of the goto functions are working, but instead report: "No ___ found for ____"
The tag parser database icon in the bottom right is always there but only reports "Parsing open files", rather than telling you how many files have been parsed.
Then:
Try saving your workspace.
If you have multiple versions of a language on your PC, specify the exact language you are using in the VScode(in my case, I am using Python, so I must specify the version to the python Interpreter in VS Code)
If you could not do it whatsoever, then uninstall all the other versions that you don't use and then if you go to VS Code, it will ask the version to be used, and you would have only one version, so when you select the version, the "Go To Definition" will be activated.
I was having a similar issue with java on Ubuntu 20.04 using OpenJDK version 11 (openjdk-11-jdk in apt). At first I didn't have the JRE installed, so I installed it and it still didn't work.
Afterwards, I went to the CTRL + SHIFT + P menu and then to Java: Configure Java Runtime, there I saw in the Java Tooling Runtime tab that /usr/lib/jvm/java-11-openjdk-amd64 was selected, changed it to /usr/lib/jvm/java-1.11.0-openjdk-amd64 just to see if it would work, and after a restart it did. I'm not sure why this is, but I hope it may help somone else.
For python ensure your code analysis settings are correct. In my case the languageServer was accidentally set to 'None'. Reverting it to 'default' or 'pylance' did the trick.
Just to inform if none of above works then
In my case i was using Kite extension in my VS code, I just disabled it and it worked. I think kite extension is blocking this feature.
OS: Linux Ubuntu 22.04
if you encountered with following error:
"The .NET Core SDK cannot be located. .NET Core debugging will not be enabled. Make sure the .NET Core SDK is installed and is on the path."
Normally Vscode remains unable to locate .Net sdk. need to set path manually.
sudo ln -s /snap/dotnet-sdk/current/dotnet /usr/local/bin/dotnet
restart omnisharp & restart vscode
No need to do anything. Just close and re-open. It will work.
I also faced similar problem. In my mac os cmnd + 'click' is used to 'go to definition' then it suddenly stoped working. If that is the case then please follow these steps:
restart vs code
restart pc
uninstall all extensions and reinstall again followed by a pc restart.
I had a similar issue with the extension C/C++ installed. I solved it by downloading an older version of the extension and upgrading to the last version. Somehow it solved the problem...

Qt crashes when I try to execute any program

I've looked for an answer during a few days and I haven't found anything similar anywhere;
I downloaded Qt from the official website, installed it and apparently compiling is fine. But whenever I try to execute (Ctrl+R) any app, even the basic one which only displays a window or widget, QtCreator itself crashes. No error message, nothing, just crashing.
I've tried to redownload and reinstall it a few times with different settings, but nothing will do.
I'm running QtCreator on Windows 7 64 bits. I'll try on my laptop which is also running windows and will update if I find anything.
Any help would be appreciated, I need to start a project as soon as possible. I'm relatively new to QT and if you need info on anything just ask me. Thanks :)
Use dependency walker, http://www.dependencywalker.com/
and post any missing dependencies. It is possible some install targets or options are missing from when you installed QtCreator, which can be resolved with the maintenance tool in the same directory you installed Qt.
Also, are you using the Visual Studio compiler(must have Visual Studio installed separately, and mark the option during install), or the Ming compiler(2 options checked during install or maintenance)?
Check if your antivirus is locking it, I had a similar issue time ago and it was due to antivirus (Avast specifically). Disable antivirus' realtime shields and try to execute a basic app.
It is necessary to use QtCreator? I use QtDesigner snd VS2013 and things go very well. :)
check this thread Qt Creator Plain C++ Project won't run/debug... and this C++ - QtCreator doesn't show any output

Calling a OSX package from xcode c++ program terminal

im planning to build a c++ application based on another c++ package (aria2c) i found over the internet which acts as a ready made wheel for me. I have already installed the package on my machine, but the problem is when i run system("aria2c"); it outputs "command not found", whereas if i run system("git"); (which i have also installed) it will output the git's man page.
calling "brew" also doesnt work whereas git, ls and some other that i tried work.
So can someone explain to me why i cant access that package ? and if there is any solution to it ?
The most common mistake is that the pacakge might be installed for a particular user or at a particular path. Make sure that you have the library/application in your path list
To do that ,i would suggest first finding where the package is installed and then do echo $PATH in terminal to see if its in your path variable

Eclipse kepler can't install updates

After downloading updates it shows a error that can't install updates .
An error occurred while uninstalling
session context was:(profile=epp.package.cpp, phase=org.eclipse.equinox.internal.p2.engine.phases.Uninstall, operand=[R]org.eclipse.rcp.configuration_root.win32.win32.x86_64 1.0.0.v20130521-1847 --> null, action=org.eclipse.equinox.internal.p2.touchpoint.natives.actions.CleanupzipAction).
Backup of file D:\eclipse\eclipse.exe failed.
Can not remove : D:\eclipse\eclipse.exe
I'm running it under win7 and jdk1.7.0_21 64bit .
How fix it ?
Solution extracted from the forum linked in Anonymous answer:
Run eclipse
Rename eclipse exe to eclipse.exe.back
Run updates
Updates executed successfully
To match so guidelines:
Always quote the most relevant part of an important link, in case the target site is unreachable or goes permanently offline.
Refer this post: http://www.eclipse.org/forums/index.php/t/487240/. It helped in solving this problem for me.
Shown below for your convenience :
I had same issue with updating Kepler. W7 with admin.
How to solve:
Run eclipse Rename eclipse exe to eclipse.exe.back
Run updates
Updates executed successfully
Premysl Fiala
Create a new workspace. Eclipse Kepler does cause a problem if we work on the older workspace. Worked for me.

Installing QT addin for Visual Studio 2013

i spent a lot of time trying to get these to install properly, so here i am.
I've already googled my problem countless times in different forms and still can't resolve it.
It's just very confusing because there are so many versions out there, and i don't even know how to build the binaries, if even have to do that, and i couldn't find the configure.exe. I don't have it after i installed QT5.
I have python, perl, Visual Studio, QT5,QT addin, and openssl installed.
When going to QT5, QT Options, then Add, add: C:\Qt\5.2.1\mingw48_32 as the path and got an error about qmake not found or something.
So I deleted libqtmain.a and libqtmaind.a as suggested by some site and that solved the problem.
I've also tried this: http://blog.kikicode.com/2011/09/qt-version-uses-unsupported-makefile.html
but i couldn't find the Trolltech folder, so i stopped.
But now my problem is this
"This QT version uses an unsupported makefile generator (used: MINGW, supported: MSVN.NET, MSBUILD).
I don't even have a configure.exe file, and can't launch it from the visual studio command line.
I really have no idea what to do. I've been attacking this problem for all of yesterday, and i've ran out of steps today. Please help me.
I don't have the express version of VS. Just so you know.
I just solved this issue. It get me mad, but is easy.
The Add-in looks to $(QTDIR)\mkspecs\default to know which one to use. The "default" folder is not created after configure and build Qt.
So the way I solved is to copy&paste the "win32-msvc2013" folder as "default".
And now the Add-in recognised Qt.
BTW, after build the sources "nmake", I make an install of them in another folder so I have just the binaries and tools but not all the source that I don't need for develop software based on Qt.
Once the compilation is complete, then type:
Set the root where the installation will be, ex:
set INSTALL_ROOT=\Sw\Qt\qt-4.8.5-install
Execute in your source's root the command:
nmake install
So after trying everything i decided to run compile the binaries.
I think not a lot of people have this problem and there is no solution on the internet because the 2013 addin is very new. So here is what i did, and what worked for me, after countless hours of trying.
I downloaded the zip located under the main downloads on their webpage: http://qt-project.org/downloads
I uninstalled the old QT. (kept the addin)
I unzipped the zip it into a folder i named QT at C:\
Then i ran the configure.bat located inside.
On the Visual Studio cmd i cd to the C:\QT\qt-everywhere-opensource-src-5.2.1
directory where the configure file is,
Tried running the 'configure' file, there was no configure.exe. Then i ran 'nmake', that took like three hours.
The i went into C:\QT\qt-everywhere-opensource-src-5.2.1\qtbase\qmake
and made a folder bin where i copied the qmake.exe found in that same folder.
Finally i went into the VS addin, qt, qt options and i added that directory.
And it works!
I'm using Qt 5.6, msvc2014, but had the same issue at first. This issue was solved for me by updating to Add-in 1.2.5 without changing anything else.