I did a disk partition to get Linux to be able to practise with c++ and it is impossible because I don't find the error I did install code blocks.
I tried to use the xterminal but it's a bit annoying just for practice!
Every time I try to run my program in codeblocks appears this message "Can't create output directory bin/Debug/" and I cant see my program... do I have to install anything else?
my program doesn't appear after build
I think you don't have permission to the directory to build.
Change the build or output directory from settings of CodeBlocks then try...
Related
I'm setting up the Netbeans IDE, and i downloaded Cygwin for the compiler, make and debugger (Windows 8.1). The problem is that when i try to debug or run, this error happens.
C:\\cygwin64\\bin\\bash: exec /cygdrive/C/Users/MyName/Documents/NetBeansProjects/Pi_1/dist/Serial/Cygwin-Windows/pi_1.exe: No such file or directory
RUN FAILED (exit value 127, total time: 90ms)
I don't know if i'm missing something to install or if i used wrong versions of g++, make, etc...
I had experienced a similar problem on other IDEs (haven't used Netbeans). It turned that the anti-virus was quarantining the executable generated after compilation. I just "whitelisted" (prevent anti-virus from scanning in future) the directory where i saved my programs, and that solved the problem.
I had such error. In my case the folder name in the project path was the reason. Try to change location of your project to something simple, like "c:\NetBeansProjects\prj1".
Happened to me as well. The reason, as already mentioned, was that the build folder contained characters as () and spaces.
C / Windows 10
Just to add, I had the same problem when saving my projects in a different folder than the predefined one. Example: C:\Users\username\Desktop\C_Programs\new12. This was fixed using the predefined project folder: C:\Users\username\Documents\ NetBeansProjects\new12.(Windows 10)
I'm using Eclipse Helios in Windows7 for C/C++ programming. I wrote a basic C++ code and tried to compile. The output is:
**** Incremental Build of configuration Release for project Programming Project **** Info: Internal Builder is used for build g++
-o "Programming Project.exe" "src\ch_3_excercises.o" c:/mingw/bin/../lib/gcc/mingw32/4.6.2/../../../../mingw32/bin/ld.exe:
cannot open output file Programming Project.exe: Permission denied
collect2: ld returned 1 exit status
How can I fix this error?
All you have to do is go to project on the menu bar and then click clean project. Clean all of your projects and then it should work.
The same problem with me while editing my code.the easy way i used is ::::::::
press the red button(Terminate) before editing your code then run your code
it is tested and works
I know this is an old question, but it probably does that because you are interrupting the flow of your program, for instance using scanf(), and not actually giving the input it requires, so when you use the command Build the project, then eclipse is waiting a stream from your keyboard (for instance, maybe it's a different type of program, but follow me here).
Once you know than that is the problem, then you might wanna keep an eye in what is that you are not giving to the project and that it is expecting you to; and the way to stop this annoying error the next time you get it, is that in your console view you press the red button.
That will happen if the program is still running in another window. The .exe file stays open until the program finishes execution, and you can't delete a file while any processes have it open.
I don't use Eclipse for C/C++ development, and the problem almost can't happen with Code::Blocks, but this happens very often with Visual C++. Just close the other window and rebuild.
Check your quarantine folder of your antivirus. If you see the executable file, then add it to the Trust list or White list. Your problem should be solved.
It means the same .exe file is running in your system.
A program cannot be build when its already running.
So the simple and most obvious thing to do is:-
Open task manager
Find <yourfilename.exe> under processes
Right click and end task
This stops it from running in background.
So you can build your program anew and run.
I have been trying to find a solution for this problem but I haven't been able to see/find any answer that correctly solves it.
I coded a program (Qt + OpenCV) that works fine when I run it with Visual Studio, but trying to run the executable it simply does not execute anything. The program doesn't give any error: it just never starts.
I am not sure where to start checking what is happening and why it is not even starting (I could understand lack of libraries, some other error..).
I am basically interested on what are the best way of checking why a program runs when executed from the IDE and not from the executable created. As I said, I was expecting an error message if something was wrong. Any ideas? Any good programming advice regarding how to avoid this problem in the future?
Edit: I forgot to mention that I am coding with a Windows XP machine. It doesn't work in this machine when I try to execute the file. It executes normally on a W7 machine but not in other W7 machine.
The executable will need the QT libraries on the computer that you are running it on. On linux there is command (I think ldd) that will show you what libraries your executable needs. I am not sure about Windows but there should be something similar. At least on a linux computer it will not necessarily give you an error if the QT libraries are missing. The executable just seems to do nothing.
Try copying the executable into the same directory as the .dll files in the Qt 'bin' directory.
If that works then you just need to put the Qt bin directory into your path, or copy the dlls into the windows\system directory
You need not only the correct dlls in your path (best in the application directory), but also the plugins in the correct location. See my answer to the question: Qt dll deployment on windows.
I've been programming on windows for about three months now and when my computer finally died I bought a mac. I'm really happy with it except I can't figure out how to run my c++ programs.
On windows it would open up in command prompt so I figured it would do the same thing except with terminal.
After I write my programs (in Xcode) I can compile them and it'll tell me if there are syntax errors but the run and run related buttons are all Grey and unusable.
It's incredibly annoying that I can't see how the program that I put 4 hours into runs and even more annoying that I don't know if I've made a runtime error. Someone please help.
Thank you very much, James
Assuming that you're trying to write a program that you interact with on the command line, you want to create a "Command Line Tool" project, found under "Application" in the Mac OS X section of the New Project dialog. Choose "C++ stdc++" from the "Type" dropdown, as well. This will give you a main.cpp that should look familiar to you, with a "Hello, World!" sample.
Note that when you Run this program, it might appear to do nothing - You need to open the Console (from the Run menu, or shift+command+R) to see your output.
Xcode deals in projects. If you're just opening the source file, there is no project. Create a project with the files in it and Xcode should let you run it.
Alternately, you can just use G++ on the command line to compile your files and run the resulting executable there.
Try compiling from the terminal as stated above. The a.out file should be created, and should run as long as Xcode has been installed. It should work fine from the terminal, and point out any errors in the compiler's output.
To runs the a.out file, ensure you are in the files directory in terminal and type ./a.out
I recently started learning C++ and I installed Netbeans IDE 6.9.1 and also the Cygwin compiler packages and configured them, and added Cygwin to my environment variable PATH like the instructions told me to.
I wrote a basic "Hello World" program and when I press Ctrl+F5 to "Debug Main Project" it seems to build fine but the black console/command prompt window flashes then disappears.
Then when I go to Run > Run Main Project, it builds and then a command prompt window pops up with the directory to "sh.exe" in its title.
I took a screenshot of the error message:
Does anyone know why this is happening and why I can't get the program to run properly even in debug?
Notice that in the screenshot I switched over to the MinGW tools because I thought maybe Cygwin was the problem, but the same error still occurs.
Any help would be greatly appreciated. Thank you.
"No such file or directory" in the error message is the key. When you run the project, it wants to access a file which is not there. Make sure that the paths are set up correctly.