Getting graphics.h to work on mingw32 gnu C++ compiler

Some schools and colleges still use the old Turbo C++ IDE (with compiler) for C/C++ programming. It does not seem surprising. But problems arise if the student has a modern PC running 64-bit(x64) windows operating system. The OS simply refuses to run old 16-bit dos programs (one of them being Turbo C++ IDE whose product line was put on hold after 1994).

Since the Turbo C++ IDE cannot be run on 64-bit(x64) windows OS, the user may choose to use a modern IDE like Microsoft Visual C++, Netbeans (Yes, even for C/C++), Bloodshed Dev C++ (outdated), Eclipse or Codeblocks. However, the problem is still not solved. The header graphics.h and its library are not available with other compilers (not even Borland 5.5). For the purpose of compatibility, a free utility called WinBGIm is available. Follow these steps to get graphics.h working with mingw32 gnu C++ compiler (which is very popular).

  1. Get an IDE. Some of them are mentioned above. (I use Codeblocks, Netbeans as examples here).
  2. Get mingw32 GNU C++ compiler from here. OR it is optionally available with Codeblocks IDE here (be sure to check whether the file has mingw in it).
  3. Install the compiler and the IDE (in this order). Configure your IDE to work with the mingw GNU C++ compiler. Codeblocks if downloaded with mingw automatically sets it as default so that Codeblocks users just have to download and install the setup file. If you use Netbeans (with C/C++ plugin), go to Tools menu > Options > C/C++. Click on Add and paste the address of the bin folder of your compiler (in my case it was C:\MinGW\bin). Additionally you need to install MSYS for netbeans from here. Version 1.0.11 is enough. Configuration is explained in the netbeans community release.
  4. Download WinBGIm and extract the files.
  5. Copy the header files (with extension .h) in WinBGIm to the include directory of your compiler. In my case it was C:\MinGW\include.
  6. Copy the library files in WinBGIm (with extensions like .a, .o) to the lib directory of your compiler. In my case it was C:\MinGW\lib.
  7. If your IDE can add link libraries (like Codeblocks, Netbeans), add these files which are found in the lib directory mentioned in step 6 to your linker libraries (in same order) :
    libbgi, libgdi32, libcomdlg32, libuuid, liboleaut32, libole32. If they are not found, try l instead of lib (it is the letter ‘l’ not one). For Codeblocks, use Project menu > Build Options > Linker Settings tab > Add to add each library one by one. For Netbeans (right click on Project) > Properties > Linker > Libraries entry > …(button) and add the above libraries. If your IDE does not support that, you can add these to your linker command (try the l letter instead of lib if it does not work) -libbgi -libgdi32 -libcomdlg32 -libuuid -liboleaut32 -libole32. An example of a command : g++ bgidemo0.cpp -libbgi -libgdi32 -libcomdlg32 -libuuid -liboleaut32 -libole32 -o bgidemo0.exe
  8. Write and execute the program as you normally would, including graphics.h header file in your program.

netbeans and rails 3.0.x

I just found out that netbeans 6.8 has a bug.

It does not support rails 3.x

The bug is probably fixed in 6.9.1

The error is while creating the project, one gets error as rake file not found…

This error is due to the fact that the command to create a new app in rails 3.x is ‘rails new app_name’

but in older version it was rails app_name’

The bug is due to this difference.

However this is solved in netbeans 6.9.1

MYSQL error in rails

Recently I encountered a error in rails while using rake db:migrate

When i use rake db:migrate , i got the following error,

rake aborted!
Mysql::Error: query: not connected: CREATE TABLE `schema_migrations` (`version`varchar(255) NOT NULL) ENGINE=InnoDB

(See full trace by running task with –trace)

Doing some googling i found out a solution which worked for me.

the solution is :

Step -1 To get rid of the issue copyt the libmySQL.dll from this link … bmySQL.dll

Step -2 Paste iit in C:\Ruby\bin of yours

Reply to me ! If u get rid off :)

btw-: i m using rails 2.2.2 on windows …

no laughs please ;)