I have already writtern some Turbo c++ graphics articles in two part series (1 & 2)this article will cover it up as creating stand alone for the programs we have written in previous articles.Update to this article will tell you how to achieve this within the software.So allow some time for the post update,till then you can read the rest.Creating standalone programs that will run on any machines is easy.
Check the installation video for Turbo C++ 3.0 on Modern Windows OS (64-bit)
There are three steps:
- First you insert it into source file certain functions to register the drivers and fonts you use.
- Second you convert any BGI or CHR files your programs needs to .OBJ files.
And third you need to link these .OBJ files to your programs using the Turbo C++ project facility.
Register Fonts & Drivers
In order to let your program run on any machine requires registering graphic driver.
Two functions are used for this purpose.The registerbgidriver() function registers drivers
like CGA.BGI and EGAVGA.BGI.
Here is the example of to register the BGI driver.
registerbgidriver(EGAVGA_driver); // register GRAPHICS driver
initgraph(&driver,&mode,” “);// inittialize graphics systems
Here initgraph() function doesn’t require pathname once graphics driver is registered.
Simmilarly you can even use function
registerbgifont(arial_font); //register BGI font
Now once you have written your .BGI file,you need to convert it into the .CHR file to be linked into application.Go into the DOS shell and then type “bgiobj”
Here egavga is the object file you created (EGAVGA.BGI].Now you are ready to build your project.After building the project,linking and loading will be carried out and then you can see the exe of your project.You can run the executable on any windows machine.
Turbo C++ Build/link procedures will be added later in the article.
Hope this helps.If you have any questions,post them.