User forums > Using Code::Blocks
Work with winBGIm in C::B
herosz:
Hy!
I'm trying to run the simple graphic program, but no chance..
--- Quote ---#include <iostream>
#include<graphics.h>
#include<string>
using namespace std;
int main()
{
int gdriver = DETECT, gmode;
initgraph (&gdriver, &gmode,""); // initialize graphics mode
cout << "Hello world!" << endl;
return 0;
}
--- End quote ---
I receive segmentation fault ???
--- Quote ----------------- Build: Debug in ata6 (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -g -fexceptions -g -Wall -g -c E:\C++\ata6\main.cpp -o obj\Debug\main.o
E:\C++\ata6\main.cpp: In function 'int main()':
E:\C++\ata6\main.cpp:14:35: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
mingw32-g++.exe -o bin\Debug\ata6.exe obj\Debug\main.o -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32 -lbgi -lbgi
Output file is bin\Debug\ata6.exe with size 1.03 MB
Process terminated with status 0 (0 minute(s), 1 second(s))
0 error(s), 1 warning(s) (0 minute(s), 1 second(s))
--- End quote ---
--- Quote ---[debug]Command-line: E:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args E:/C++/ata6/bin/Debug/ata6.exe
[debug]Working dir : E:\C++\ata6
Starting debugger: E:\Program Files\CodeBlocks\MINGW\bin\gdb.exe -nx -fullname -quiet -args E:/C++/ata6/bin/Debug/ata6.exe
done
[debug]> set prompt >>>>>>cb_gdb:
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
[debug]Reading symbols from E:\C++\ata6\bin\Debug\ata6.exe...done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.5
[debug]Copyright (C) 2012 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law. Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "i686-pc-mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off
Debugger name and version: GNU gdb (GDB) 7.5
[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source E:\Program Files\CodeBlocks\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory E:/C++/ata6/
[debug]Source directories searched: E:/C++/ata6;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: E:\C++\ata6\bin\Debug\ata6.exe
Child process PID: 3092
[debug][New Thread 3092.0xf24]
[debug]Program received signal SIGSEGV, Segmentation fault.
[debug]0x0045549f in std::string::assign(char const*, unsigned int) ()
[debug]>>>>>>cb_gdb:
Program received signal SIGSEGV, Segmentation fault.
In std::string::assign(char const*, unsigned int) () ()
[debug]> info locals
[debug]No symbol table info available.
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No symbol table info available.
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]#0 0x0045549f in std::string::assign(char const*, unsigned int) ()
[debug]#1 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
Continuing...
[debug]> cont
[debug]Continuing.
[debug]Program received signal SIGSEGV, Segmentation fault.
[debug]0x0045549f in std::string::assign(char const*, unsigned int) ()
[debug]>>>>>>cb_gdb:
Program received signal SIGSEGV, Segmentation fault.
In std::string::assign(char const*, unsigned int) () ()
[debug]> info locals
[debug]No symbol table info available.
[debug]>>>>>>cb_gdb:
[debug]> info args
[debug]No symbol table info available.
[debug]>>>>>>cb_gdb:
[debug]> bt 30
[debug]#0 0x0045549f in std::string::assign(char const*, unsigned int) ()
[debug]#1 0x00000000 in ?? ()
[debug]>>>>>>cb_gdb:
Continuing...
[debug]> cont
[debug]Continuing.
[debug][Inferior 1 (process 3092) exited with code 030000000005]
[debug]>>>>>>cb_gdb:
[Inferior 1 (process 3092) exited with code 030000000005]
[debug]> quit
Debugger finished with status 0
--- End quote ---
Any help appreciated, thank's
stahta01:
Compiler name and version?
Source of Library? Self Compiled?
Version of Library?
OS Name and Version?
NOTE: The winBGIm lib may NOT be 64 Bit compatible.
While looking at winBGIm; I accidentally forked a git project.
I decided to do something with the fork to test how well git reorders project structure.
https://github.com/stahta01/windows-games
I created a CB Project to build a static winBGIm lib.
I also got the tetris code from the site I forked to build and run using Code::Blocks with MinGW GCC.
Still have lots of warnings.
I suggest downloading the zip to help you use winBGIm if you are a Windows 32 bit user.
Link to zip; NOTE, I am a Git newbie so I might be doing a lot of Git Stuff wrong.
https://github.com/stahta01/windows-games/archive/master.zip
Edit: I am a advanced beginner to using the CB Debugger; so, I am NOT able to help you with that.
Tim S.
herosz:
I use code blocks 13.12 under XP but I don't have to connection with any games (see your links)
stahta01:
--- Quote from: herosz on January 20, 2014, 10:13:44 pm ---I use code blocks 13.12 under XP but I don't have to connection with any games (see your links)
--- End quote ---
One [are] you are saying you are NOT on the Internet on the Internet?
You have no idea what a Compiler is?
You have no idea where you got the library from?
Tim S.
herosz:
I left all at default as debugger log show:
>>compiler mingw32-g++.exe 4.8.1
link library >> libbgi.a -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32
Navigation
[0] Message Index
[#] Next page
Go to full version