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

new-b

<< < (2/2)

AmR EiSa:
in frist i can't help u with unknow code , but did u c/c++ book work with ansii ?

and graphics don't work

TDragon:
This program is written using outdated console functions which are not directly available from the MinGW/GCC compiler. You should consider dropping them for newer functionality.

Ceniza:
The problem is not "outdated console functions", but more like "trying to use Borland extensions". I also started programming in Turbo C++ (version 3.0, though), and when I switched to DJGPP (yeah, I started using DJGPP, then MinGW) I missed those Borland extensions provided in conio.h. However, I got used to not using them. If you really want to see your programs working again, I recommend you checking this site for a conio implementation for MinGW. I'm not sure if it implements every single thing you used in your programs, but you could give it a try (I've never used myself, so be sure to read the documentation first).

Think about reading a good and recent C++ book, so you can learn what's really used today and how it's used. Trying to convert your programs to use standard C++ would be a good exercise.

PsYhLo:

--- Quote from: BMB on October 05, 2007, 12:04:15 am ---I tried that on one of the programs (one without graphics. I assume graphics won't work. Am I right?). It came up with a lot of errors.

:: === Tic, Debug ===
D:\My Documents\CB\Tic\main.cpp:: In function `int main()':
D:\My Documents\CB\Tic\main.cpp:23: error: `clrscr' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:23: error: (Each undeclared identifier is reported only once for each function it appears in.)
D:\My Documents\CB\Tic\main.cpp:24: error: `_NOCURSOR' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:24: error: `_setcursortype' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:: In function `int posswin(int)':
D:\My Documents\CB\Tic\main.cpp:92: warning: unused variable 'pos'
D:\My Documents\CB\Tic\main.cpp:: In function `void player_first()':
D:\My Documents\CB\Tic\main.cpp:166: error: `gotoxy' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:178: error: `RED' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:178: error: `textcolor' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:179: error: `cprintf' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:: In function `void start_game()':
D:\My Documents\CB\Tic\main.cpp:209: error: `gotoxy' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:210: error: `RED' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:210: error: `textcolor' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:211: error: `cprintf' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:: In function `void check_draw()':
D:\My Documents\CB\Tic\main.cpp:222: error: `gotoxy' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:223: error: `RED' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:223: error: `textcolor' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:224: error: `cprintf' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:: In function `void draw_board()':
D:\My Documents\CB\Tic\main.cpp:236: error: `gotoxy' undeclared (first use this function)
D:\My Documents\CB\Tic\main.cpp:: In function `void put_X_O(char, int)':
D:\My Documents\CB\Tic\main.cpp:281: error: `gotoxy' undeclared (first use this function)
:: === Build finished: 18 errors, 1 warnings ===


--- End quote ---
from these errors i thing you need this http://conio.sourceforge.net/ this is a library for

* gotoxy
* textcolor
* _setcursortype
* clrscr
* _NOCURSORthese are functions you use in your code :)

BMB:
Thanks for the info. I might try that conio.h thing, but I get the impression that I am better off re-writing these. What libraries can I use? How do I know which are only TC specific and which are standard?

Navigation

[0] Message Index

[*] Previous page

Go to full version