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?
Please read the rules and state your Compiler name and version!
http://forums.next.codeblocks.org/index.php/topic,9996.0.html (http://forums.next.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 (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.
Im on 32 bit OS andusing GNU compiler. There are no errors on building. but when tries to run, it stops working.
Quote from: stahta01 on August 09, 2017, 05:18:56 PM
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 (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.
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))
You need to work on following directions.
From git project https://github.com/stahta01/windows-games (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.
#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.
An example of a full build log.
-------------- 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.
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\.)
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 (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.
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.
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.