Author Topic: Stopped working on running and process gets terminated  (Read 384 times)

Offline xboyz

  • Single posting newcomer
  • *
  • Posts: 5
Stopped working on running and process gets terminated
« on: August 09, 2017, 04:17:56 pm »
Im using CB 16.01 and win 7 OS. I type the following program on CB and build  successfully. But when run the output window come and stops working.
#include<iostream>
#include<conio.h>
#include<graphics.h>
using namespace std;
int main()
{
   initwindow(200,200);
   return 0;
}
ON running process gets terminated with status  -1073741510.
What should I do?


Offline stahta01

  • Lives here!
  • ****
  • Posts: 5869
    • My Best Post
Re: Stopped working on running and process gets terminated
« Reply #1 on: August 09, 2017, 05:18:56 pm »
Please read the rules and state your Compiler name and version!
http://forums.codeblocks.org/index.php/topic,9996.0.html

And, if you think it is a valid Code::Blocks issue, Post a build log.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Edit: Since your code you posted is several decades old; whether you are on 32 bit or 64 bit windows operating system matters.
It will likely NOT work under 64 bit Windows. Edit2: This guess is based on the idea that your code is from the time when Compiler were 16 bit.

Tim S.
« Last Edit: August 09, 2017, 09:34:02 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline xboyz

  • Single posting newcomer
  • *
  • Posts: 5
Re: Stopped working on running and process gets terminated
« Reply #2 on: August 11, 2017, 11:36:51 pm »
Im on 32 bit OS andusing GNU compiler. There are no errors on building. but when tries to run, it stops working.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5869
    • My Best Post
Re: Stopped working on running and process gets terminated
« Reply #3 on: August 12, 2017, 02:31:13 am »

And, if you think it is a valid Code::Blocks issue, Post a build log.
http://wiki.codeblocks.org/index.php/FAQ-Compiling_(errors)#Q:_How_do_I_troubleshoot_a_compiler_problem.3F

Tim S.

So, you think it is NOT a valid CB Issue?
Edit: The above guess is based on the fact you decided NOT to post a build log.


I suggest you learn what Compiler you are using and then find a support site for it or for the graphic library you are using.

Tim S.
« Last Edit: August 12, 2017, 02:51:16 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline xboyz

  • Single posting newcomer
  • *
  • Posts: 5
Re: Stopped working on running and process gets terminated
« Reply #4 on: August 13, 2017, 12:01:47 am »
here is the build log;

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

Target is up to date.
Nothing to be done (all items are up-to-date).


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

Checking for existence: C:\Program Files\CodeBlocks\MinGW\bin\Examples\bin\Debug\Examples.exe
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "C:\Program Files\CodeBlocks\MinGW\bin\Examples\bin\Debug\Examples.exe"  (in C:\Program Files\CodeBlocks\MinGW\bin\Examples\.)
Process terminated with status -1073741510 (0 minute(s), 8 second(s))
 

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5869
    • My Best Post
Re: Stopped working on running and process gets terminated
« Reply #5 on: August 13, 2017, 12:29:39 am »
You need to work on following directions.

From git project https://github.com/stahta01/windows-games
Edit: I just redid that git repo; to more closely match the one I forked it from.

The code that is testing the Library; I suggest you delete the library you installed on your PC;
Note: You might need to deleted Code::Blocks and the Compiler and start over if you have no idea on what to delete.
Code: [Select]
#include <graphics.h>
#include <iostream>
using namespace std;

int main( )
{
    fillsettingstype f;
    initwindow(300,300);
    getfillsettings(&f);
    cout << f.pattern << endl;
    cout << f.color << endl;
    bgiout << "What's up?" << endl;
    bgiout << "Hello " << 42000;
    outstreamxy(30, 30);
    bgiout << "Bye." << endl;
    outstreamxy(150, 150);
    while (!kbhit())
delay(1000);
    return 0;
}

Please read and follow the FAQs I post in the future or I will just ignore you!

Tim S.
« Last Edit: August 13, 2017, 01:22:32 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5869
    • My Best Post
Re: Stopped working on running and process gets terminated
« Reply #6 on: August 13, 2017, 12:31:20 am »
An example of a full build log.

Code: [Select]
-------------- Clean: test-simple Debug in testbgi (compiler: GNU GCC Compiler)---------------

Cleaned "testbgi - test-simple Debug"

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

mingw32-g++.exe -Wall -fexceptions -g -I..\include -c C:\Users\stahta01\devel\open_source_code\version_control\windows-games-git\WinBGIm\all-tests\test-simple.cxx -o ..\.objs\Debug\all-tests\test-simple.o
mingw32-g++.exe -L..\lib -o ..\bin\Debug\test-simple.exe ..\.objs\Debug\all-tests\test-simple.o   -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 -mwindows
Output file is ..\bin\Debug\test-simple.exe with size 1.15 MB
Process terminated with status 0 (0 minute(s), 5 second(s))
0 error(s), 0 warning(s) (0 minute(s), 5 second(s))

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline xboyz

  • Single posting newcomer
  • *
  • Posts: 5
Re: Stopped working on running and process gets terminated
« Reply #7 on: August 13, 2017, 03:50:14 pm »
This is the build log after running the above code;

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

mingw32-g++.exe -Wall -fexceptions -g  -c "C:\Program Files\CodeBlocks\MinGW\bin\Example\main.cpp" -o obj\Debug\main.o
mingw32-g++.exe  -o bin\Debug\Example.exe obj\Debug\main.o  -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32  "C:\Program Files\CodeBlocks\MinGW\lib\libbgi.a"
Output file is bin\Debug\Example.exe with size 1.17 MB
Process terminated with status 0 (0 minute(s), 1 second(s))
0 error(s), 0 warning(s) (0 minute(s), 1 second(s))
 

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

Checking for existence: C:\Program Files\CodeBlocks\MinGW\bin\Example\bin\Debug\Example.exe
Executing: "C:\Program Files\CodeBlocks/cb_console_runner.exe" "C:\Program Files\CodeBlocks\MinGW\bin\Example\bin\Debug\Example.exe"  (in C:\Program Files\CodeBlocks\MinGW\bin\Example\.)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5869
    • My Best Post
Re: Stopped working on running and process gets terminated
« Reply #8 on: August 13, 2017, 06:57:09 pm »
So did you compile or did you download the bgi or libbgi.a library?

If you downloaded them then you likely have a bad library!

Edit: Please learn to use code tags in your posts
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28general%29#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

Tim S.
« Last Edit: August 13, 2017, 06:58:46 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5869
    • My Best Post
Re: Stopped working on running and process gets terminated
« Reply #9 on: August 13, 2017, 08:20:54 pm »
Code: [Select]
mingw32-g++.exe  -o bin\Debug\Example.exe obj\Debug\main.o  -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32  "C:\Program Files\CodeBlocks\MinGW\lib\libbgi.a"

You should be linking to only one bgi library!!
I would try removing "C:\Program Files\CodeBlocks\MinGW\lib\libbgi.a".

Note: This is NOT likely the cause of your problem; but, might be hiding the real cause.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 5869
    • My Best Post
Re: Stopped working on running and process gets terminated
« Reply #10 on: August 13, 2017, 08:30:31 pm »
I have decided this problem is user error.

I suggest in the future you do not add files to the compiler folder(s).

Till you understand what a compiler is; adding files to it is very dangerous and something you should not do!

Note: The files under the MinGW folder is the compiler files!

Tim S.
 
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org