User forums > General (but related to Code::Blocks)

Modification causes program to crash

(1/2) > >>

zachris:
I am running Code::Blocks version 13.12 rev 9501 on MyOperatingSystem
Windows7. The compiler I use is MinGW32 (the one that installed with Code::Blocks)

When I ...

I have a set of code that use to compile and run. But now, it compiles but does not run. I do not know why.

Description of problem.
I can copy a old (backup version) of the code to my programming directory. I load this project into Code::Blocks and it compiles and runs just fine. However, if I modify anything in the code (such as merely adding a comment) the code will compile, but the program will not run.

I am new to Code::Blocks (been using it for about 2 weeks without problems as I develop this program). The problem I describe started yesterday morning.

I accept that this is probably a problem with how I am using Code::Blocks, but I cannot think of anything that I am doing differently today from what I was doing last week. If there is something on the wiki, or this forum, that describes this problem I have not found it (perhaps because the description of the problem defies a simple title).

Build log for when  the program compiles and but does not run:

-------------- Clean: Debug in test (compiler: GNU GCC Compiler)---------------

Cleaned "test - Debug"

-------------- Build: Debug in test (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -O3 -Wfloat-equal -Wmissing-include-dirs -Wswitch-enum -std=c++11 -Wfatal-errors -Wall -IC:\GnuWin32\include -c "D:\__GNU analyze\biomechanics.cpp" -o obj\Debug\biomechanics.o
mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -O3 -Wfloat-equal -Wmissing-include-dirs -Wswitch-enum -std=c++11 -Wfatal-errors -Wall -IC:\GnuWin32\include -c "D:\__GNU analyze\CommonFunctions.cpp" -o obj\Debug\CommonFunctions.o
mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -O3 -Wfloat-equal -Wmissing-include-dirs -Wswitch-enum -std=c++11 -Wfatal-errors -Wall -IC:\GnuWin32\include -c "D:\__GNU analyze\InputOutput.cpp" -o obj\Debug\InputOutput.o
mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -O3 -Wfloat-equal -Wmissing-include-dirs -Wswitch-enum -std=c++11 -Wfatal-errors -Wall -IC:\GnuWin32\include -c "D:\__GNU analyze\LocalError.cpp" -o obj\Debug\LocalError.o
mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -O3 -Wfloat-equal -Wmissing-include-dirs -Wswitch-enum -std=c++11 -Wfatal-errors -Wall -IC:\GnuWin32\include -c "D:\__GNU analyze\main.cpp" -o obj\Debug\main.o
D:\__GNU analyze\main.cpp:54:1: warning: "/*" within comment [-Wcomment]
mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -O3 -Wfloat-equal -Wmissing-include-dirs -Wswitch-enum -std=c++11 -Wfatal-errors -Wall -IC:\GnuWin32\include -c "D:\__GNU analyze\mathvalues.cpp" -o obj\Debug\mathvalues.o
mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -O3 -Wfloat-equal -Wmissing-include-dirs -Wswitch-enum -std=c++11 -Wfatal-errors -Wall -IC:\GnuWin32\include -c "D:\__GNU analyze\Matrix.cpp" -o obj\Debug\Matrix.o
D:\__GNU analyze\Matrix.cpp: In function 'void SVD(const Matrix&, Matrix&, Matrix&, Matrix&)':
D:\__GNU analyze\Matrix.cpp:1988:36: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
D:\__GNU analyze\Matrix.cpp:2057:14: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]
mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -O3 -Wfloat-equal -Wmissing-include-dirs -Wswitch-enum -std=c++11 -Wfatal-errors -Wall -IC:\GnuWin32\include -c "D:\__GNU analyze\readwritedata.cpp" -o obj\Debug\readwritedata.o
mingw32-g++.exe -Wall -fexceptions -g -march=corei7-avx -O3 -Wfloat-equal -Wmissing-include-dirs -Wswitch-enum -std=c++11 -Wfatal-errors -Wall -IC:\GnuWin32\include -c "D:\__GNU analyze\Statistics.cpp" -o obj\Debug\Statistics.o
mingw32-g++.exe -LD:\GnuWin32\lib -o bin\Debug\test.exe obj\Debug\biomechanics.o obj\Debug\CommonFunctions.o obj\Debug\InputOutput.o obj\Debug\LocalError.o obj\Debug\main.o obj\Debug\mathvalues.o obj\Debug\Matrix.o obj\Debug\readwritedata.o obj\Debug\Statistics.o   C:\GnuWin32\lib\libgsl.a C:\GnuWin32\lib\libgsl.dll.a C:\GnuWin32\lib\libgslcblas.a C:\GnuWin32\lib\libgslcblas.dll.a
Output file is bin\Debug\test.exe with size 2.57 MB
Process terminated with status 0 (0 minute(s), 15 second(s))
0 error(s), 3 warning(s) (0 minute(s), 15 second(s))
 

-------------- Run: Debug in test (compiler: GNU GCC Compiler)---------------

Checking for existence: D:\__GNU analyze\test\bin\Debug\test.exe
Executing: "C:\CodeBlocks/cb_console_runner.exe" "D:\__GNU analyze\test\bin\Debug\test.exe"  (in D:\__GNU analyze\test\.)



Crash report:
The program fails to run, with the following statement:
Process returned -107374195 (0xC000001d)   execution time: 3.682 s

I have already tried ...
List of attempted solutions.
... but none of them worked.

I have an old version of the code that I copy entirely into my “programming” directory. This version of the code will compile and run just fine. However, if I modify anything – even adding a comment – the code will compile, but fail to run.

scarphin:
Did you try to run the compiled executable from the command line (cmd.exe)? Does it work when run from the command line?

zachris:
Yes, it compiles and runs from the command line.

This is the way I am progressing with the program. But having to go to the command line to compile and run defeats the purpose of an IDE.

stahta01:

--- Quote from: zachris on April 14, 2015, 04:58:46 pm ---Yes, it compiles and runs from the command line.

This is the way I am progressing with the program. But having to go to the command line to compile and run defeats the purpose of an IDE.

--- End quote ---

Did you use the exact some options?

EDIT: Most people never use these two options "-g"  "-O3" at the same time.

Tim S.

zachris:
I am not sure if I used the same options. I do not know how to set them in Code::Blocks.

However, since I do not know how to alter them I am fairly sure that I did not change options within Code::Blocks.

Still, this compiling and running from the command line does not explain why I was able to compile and run before, but now can seemingly compile but cannot run (or only run in a way that causes a crash).

Navigation

[0] Message Index

[#] Next page

Go to full version