I'd love to ask someone to hint me what to do. I have installed Dev-C++ on my computer (the 5.11 ver.)
I don't know what happened to it, if it's Windows 8.1 problem or some other I really don't know, but when I start to debug, it simply stops working.
What exactly happens:
I open dev-c++, then I open my *.c file. I set a breakpoint in my source code, and when I hit debug, a pop-up windows shows:
You have not enabled debugging info (-g) and/or stripped it from executable (-s) in Compiler Options.
Do you want to correct this now?
And when I hit yes, it simply stops to respond, and crashes.
I have never occured such situation, because on every computer I have worked, I'd got no problem with debugging on Dev-C++. Even running it in compatibility mode didn't help.
I really don't know what to do. For any help, thanks in advance!
For me to fix by following as below
Go to Tools -> Compiler option
Change from TMD-GCC 4.9.2 64 bit Release to TMD-GCC 4.9.2 64 bit Debug
Put the option -g as in the picture
Then click OK and run again!
Hope it will help!
GO to Tools > Compiler Option >
On select Compiler Set to Configure >> TDM-GCC 4.9.2 64 bit Debug
Now in general tap space put -g
Most Important : Rebuild All (F12) **
Open File -> New -> Project -> Console Application or Empty project
Write a project_name and select OK button
write your code and Save as main.c in the same folder you saved you .dev file
add watcher any line you want and debug it.
Thats all. You don't need to add any parameter to anywhere.
You have to first set up your compiler property by adding -g to both commands fields. Here is a YouTube video shows you how to do that.
https://www.youtube.com/watch?v=EOnl-Ojd66Q
I'm also using window 8, and after following the video, I still got the same pop up widow with the same message. I found out if you click no for "Do you want to correct this now" the debugger will start working. I don't know why, but it works for me. Good luck!
Go to Tools => Compiler options.
Then select TDM-GCC 4.9.2 64-BIT DEBUG
Worked for me.
first you have to create a project; then copy your code into the project; set the following compiler option: settings tab -> code generation : disable all optimizations and finally settings tab -> linker: set to yes the generating debugging information and the strip executable choices. good luck
Follow these steps:
a) Tools -> Compiler Options.
b) Put -g in both boxes of the compiler tab.
c) Make sure both the boxes with "Add the following...." are checked and then hit ok.
adding the -g manually did not work for me.
This is what worked for me :
As other said, you have to create a new PROJECT, then paste your old code into it.
after that, just press the debugger button as you would, it will ask to put the -g for you, and this time when you say YES, it will not crash. It will work as a charm.
Watch this video to clarify :
https://www.youtube.com/watch?v=xFpShi0yAc4
I also got the same problem when I ran my Program without compiling.
That was only the reason for this crashes and errors for me.
Dev-C++ IDE requires compilation first then after it allows to run the program unlike other IDE like C-Free which automatically compiles first and run the program for you.
Use F11 shortcut key for compile and run the program for Dev-C++ IDE.
It works for me.
Related
Today I wanted to compile some C-Code when VsCode gave me an include-path error. I thought that was odd, since I didn't remember changing anything there. So I tried to compile my code with C-Lion, but right after opening C-Lion, there was another error-message telling me, that it wasn't able to compile a small test-programm and gave me a usr/bin/cc - broken error message.
After trying to figure out where the problem was I remebered that I was cleaning up my Mac the other day and deleted folders that I thought would belong to the RiotClient, that I just uninstalled. My guess is that I deleted some folders that I shouldn't have deleted ...
And of course I already emptied my trash bin.
As I am using clang to compile (Vs-Code) I tried to check for my clang version (using clang --version in the terminal), which again ended in a usr/bin - error message (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun)
Is there any way to get out of this mess or do I need to reset my mac completely.
Thanks for any help in advance!
Solved!
As #JonathanLeffler suggested, the solution is to reinstall the XCode Command Line Tools. It seems like the latest MacOS update mixed something up, which seems to be a common thing to happen (see comments).
I followed this guide to reinstall it :)
It doesn't seem to be necessary to download the XCode IDE as I thought haha.
I'm using Matlab to generate some C code and MinGW is the compiler. This is how the toolchain is configured:
Once the build process is finished I get an executable file that I can run, and it works fine (it's just a simple Windows console program).
However, I can't find the options to run it automatically right after compilation. I've seen some code where they added ($PRODUCT) to the "Execute" option, but it didn't work for me. Any help is much appreciated!
Following the advice from here:
https://www.reddit.com/r/vim/comments/r6dthv/make_with_makefile_and_run_exe_from_same_command/
I added && start C:\...\test.exe (where ... is the full path) to the "Make Tool" option (bottom line) and it worked.
I am new to C programming. I downloaded Code::Blocks to try. I had already installed the gcc compiler and so that's what codeblocks is set to use. I wrote a simple program and compile and ran it. It ran fine when I ran it from inside Code::Blocks but when I tried to double click the .exe it said
"The program can't start because libgcc_s_dw2-1.dll is missing from your
computer. Try reinstalling the program to fix this problem."
Why is it that it works when I run it in Code::Blocks but not when I click on the file?
BTW, here are my #includes.
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
I think author already solved his problem, but I just want to add my solution.
To use your executable file you need to follow these steps, to configure your project:
Project -> Build Options
Select correct target or project in left hand panel
Tab: Linker Settings
Box: Other linker settings
Enter follow linker options one per line:
-static
-static-libgcc
-static-libstdc++
Also,it could be helpful to add (..\mingw\bin) path to the project search directories.
Did you try and run you're program from the terminal? If not, do so, because then you won't have the problem that you compiler won't be found.
In your home directory in the terminal call to compile:
gcc yourprogram.c -o yourprogram.exe
./yourprogram.exe arg1 arg2
Second one is to run; arg1 and arg2 would be command line arguments you pass to the program. (This works on Mac and Linux, I have 0 experience on Windowsterminal)
Anyway, if you really want to learn how to program, then you should learn how to work with the terminal; then you'll never have to worry about GUI-Problems ever again, which is what you're now doing.
I had the same problem: running the exe inside CodeBlocks it was working, but running it inside cmd terminal gave the error.
I solved copying MinGW libs inside c://windows/SysWOW64(for 64bit windows).
I attach the zip with libs
https://3.sharebylink.com/1/?wjiteTTdXR8k or
https://files.fm/u/b6wqqwdy
Hope this helps!
I had the same problem and after about 4 hours of fighting with it, I finally got it figured out.
All you have to do is click project at the top of the screen, then build options, then checkmark Static libgcc, Static libstdc++, and static linking. click ok and then rebuild your project.
Hope that helps.
I just installed Dev C++ and I am learning C programming.
the code i used was
#include <stdio.h>
int main()
{
printf("Hello world");
getch();
}
I saved it as a .c file. When I compile it works fine, but when I compile and run it says source file not compiled. So I googled buncha things and came across this video on youtube which shows you how to fix it. I also saw other forums on google which suggest the same thing... However, after doing whats asked, Now I can't even compile my code. I get this error
Compiler: Default compiler
Executing C:\Dev-Cpp\bin\gcc.exe...
C:\Dev-Cpp\bin\gcc.exe "C:\Users\ubaid\Documents\C\Untitled1.c" -o "C:\Users\ubaid\Documents\C\Untitled1.exe" -I"C:\Dev-Cpp\include" -L"C:\Dev-Cpp\lib"
gcc.exe: Internal error: Aborted (program collect2)
Please submit a full bug report.
See <URL:http://www.mingw.org/bugs.shtml> for instructions.
Execution terminated
I have also used what is asked on this link, and still no luck..
http://learntogeek.com/miscellaneous/solved-source-file-not-compiled-error-in-dev-cpp/
I am using windows 8
I was having this issue and fixed it by going to:
C:\Dev-Cpp\libexec\gcc\mingw32\3.4.2
, then deleting collect2.exe
Install new version of Dev c++. It works fine in Windows 8. It also supports 64 bit version.
Download link is http://sourceforge.net/projects/orwelldevcpp/ .
I guess you're using windows 7 with the Orwell Dev CPP
This version of Dev CPP is good for windows 8 only. However on Windows 7 you need the older version of it which is devcpp-4.9.9.2_setup.exe
Download it from the link and use it.
(Don't forget to uninstall any other version already installed on your pc)
Also note that the older version does not work with windows 8.
This maybe because the c compiler is designed to work in linux.I had this problem too and to fix it go to tools and select compiler options.In the box click on programs
Now you will see a tab with gcc and make and the respective path to it.Edit the gcc and make path to use mingw32-c++.exe and mingw32-make.exe respectively.Now it will work.
The reason was that you were using compilers built for linux.
You can always try doing it manually from the command prompt. Navigate to the path of the file and type:
gcc filename.c -o filename
I found a solution. Please follow the following steps:
Right Click the My comp. Icon
Click Advanced Setting.
CLick Environment Variable. On the top part of Environment Variable Click New
Set Variable name as: PATH then
Set Variable Value as: (" the location of g++ .exe" )
For ex. C:\Program Files (x86)\Dev-Cpp\MinGW64\bin
Click OK
This error occurred because your settings are not correct.
For example I receive
cannot open output file Project1.exe: Permission denied
collect2.exe: error: ld returned 1 exit status
mingw32-make.exe: *** [Project1.exe] Error 1
Because I have no permission to write on my exe file.
After some investigation, and with Dr.Topaz's help, I have learned that you will want to confirm that the program set for g++ in the Compiler Options really does compile the source code. In my case, the C:\Dev-Cpp\bin\g++.exe program did not create an exe, but the C:\Dev-Cpp\bin\c++.exe program did. Either program appears to be intended to take the same arguments and options as GNU g++. I would love to find an actual doc on the Dev-C++ compiler programs, but I have not so far.
You can test the compiler program with a simple example like this:
C:\Dev-Cpp\bin\c++.exe hello.cpp -o hello.exe
Currently in 2021, the Dev-C++ site invites you to download either original Dev-C++ or a newer fork by a group named Embarcadero.
I decided to try the Embarcadero version and the experience was slightly better. The UI is still a tad dated, but the g++.exe program it came with was able to compile programs without issue. Again, take note of where the program is being installed, but in my case, the Embarcadero compiler programs were in C:\Program Files (x86)\Embarcadero\Dev-Cpp\TDM-GCC-64\bin.
Both original Dev-C++ and Embarcadero come with mingw-32 versions of the compiler programs that from what I see do work in a Git Bash console, with slight differences such as not recognizing a default locale when using the command std::cout.imbue(std::locale("")).
I faced this similar error, and none of the solutions worked.
so I tried to download the latest version from here, https://www.bloodshed.net/
I rerun the program.
and everything is now working correctly.
I was facing the same issue as described above.
It can be resolved by creating a new project and creating a new file in that project.
Save the file and then try to build and run.
Hope that helps. :)
C.Vim works, as evidenced by the commands I've been using, syntax highlighting, and template. But I use \rc and nothing happens. \rr tells me that there is no .exe, and an Everything search tells me that it's not a directory issue.
In all the resources I've read, I don't see anything that says I need to point it to a specific compiler, though I've installed Visual Studio 2010.
How do I get C.vim to compile my code? I'm a relative beginner with Vim and C.
Edit: I've set the Windows Environment Variable to C:/cygwin/bin where I've downloaded and installed the GCC packages, but am still getting the same error.
Edit2: I've downloaded Msys and Mingw as well. I tried setting up Eclipse as well, following the instructions here. Running make from the command line tells me that GNU Make 3.81 is running. Running :make in Vim tells me:
shell returned 2
(1 of 1) : make *** No targets specified and no makefile found
Trying Eclipse, I get another make error:
make: *** No rule to make target `all'; Stop.
Edit3: I got Code::Blocks running, which is what I used to run. (It's been a while since I programmed, and even then I was a beginner.) I didn't really have to configure it at all, though I would still prefer to use Vim, so help is still much appreciated.
Edit4: running make vimFirst (vimFirst.c is my file) compiles! Running the program with :! vimFirst.exe works as expected. Now returning to the original question, how to do it with C.vim? It would be so much more convinient to type \rc and have the program compile and run, which is about 1/10 of the typing of the other method.
Edit4: running make vimFirst (vimFirst.c is my file) compiles! Running the program with :! vimFirst.exe works as expected. Now returning to the original question, ... type \rc and have the program compile and run...
Check your maps for \rc and \rr:
:map \rc
:map \rr
If no mapping exists, you might have no_plugin_maps or something similar set in your vimrc.
I think you'll get what you want if you set them up like this:
nmap \rc :make %<<CR>
nmap \rr :! %<.exe<CR>
If you're really familiar with Visual Studio and want to use nmake to build your code, you should check out the :compiler option. :compiler msvc will setup your makeprg and errorformat for nmake and Visual Studio's compiler.
I'm not sure what make is currently using to build your code, so I don't know what compiler setting you'd want.