can anyone guide me how to run a c++ program inclusive of graphics through notepad++ by using borland compiler
OR
plz guide me hw to compile n run a c++ graphics prog in vista..as it's not possible by normal tcpp

Dani AI

Generated

Short summary and practical options tied to the thread: was correct that Notepad++ is just an editor and does not compile code; the graphics.h/BGI API used in the posted program is Borland-specific and will not work with a modern compiler out of the box. Two realistic paths exist: (A) run the original Turbo/Borland toolchain inside an emulator or VM (DOSBox/XP VM) to keep legacy BGI behavior, or (B) move the source to a modern toolchain (MinGW/MinGW-w64 or Visual Studio) either by installing the WinBGIm port of BGI or by switching to a maintained graphics library (SDL2/SFML). (npp-user-manual.org)

Practical Notepad++ workflow for option (B): install a recent MinGW (or MinGW-w64) and add its bin folder to PATH. Use Notepad++ Run or the NppExec plugin to invoke the compiler from the editor; for example an NppExec script that saves, compiles and runs the current .cpp file might look like:

npp_save
cd "$(CURRENT_DIRECTORY)"
"C:\MinGW\bin\g++.exe" "$(FULL_CURRENT_PATH)" -o "$(NAME_PART).exe"
npp_run "$(NAME_PART).exe"

NppExec and the Run variables are supported by Notepad++; the plugin allows multi-step compile+link+run workflows. If keeping BGI calls, install WinBGIm headers/lib and link the BGI support library (copy headers into MinGW include and libbgi.a into MinGW lib, then add linker flags such as -lbgi -lgdi32 -lcomdlg32 -luuid -loleaut32 -lole32). Watch for 32-bit vs 64-bit mismatches when using prebuilt libbgi. (bjsam.github.io)

Longer-term recommendation: move away from legacy BGI for anything beyond classroom demos. Libraries like SDL2 or SFML provide modern, cross-platform 2D graphics, active documentation and community examples; they integrate cleanly with MinGW or Visual Studio and avoid the compatibility and tooling traps of 1990s Borland tools. (libsdl.org)

Recommended Answers

All 24 Replies

Well for graphic programming there are 2 major tools (well not exactly tool)

1. OpenGL
2.DirectX

Since u want windows oriented ,it would be prudent to go with DirectX .

This will get u started.

i meant c++ graphics..not other ones...

i meant c++ graphics..

No such thing, at least not in standard C++. What you have is a non-standard library which was created by Borland (and others). If you are still trying to use a ca. 1993 Turbo 3.X technology on a ca. 2006 operating system then you may be out of luck. What Rahul is trying to say is that there are libraries out there that are more current and supported by recent versions of Windows.

yaar i think u r nt getting my prblm...
i have windows vista in my laptop..it supports tcpp in small screen but does not run ny program hving graphics,i.e.,programs hving header file graphics.h...
thats y i need to use notepad++ as suggested by my lecturar..but m not able to compile n run my prog in it...n need to know where m i gng wrng...

commented: stop the chat room talk -5

well then u gotto to be a little specific here ,
AS far as i guess , ur saying ur not able to run graphic program
the possible reasons could be

1. there is no graphic lib
2. There exist graphic lib but , its not linked to

Notepad++ is a code editor thats all , its got nothing to do with ur graphics not running,

yaar i think u r nt getting my prblm...
i have windows vista in my laptop..it supports tcpp in small screen but does not run ny program hving graphics,i.e.,programs hving header file graphics.h...
thats y i need to use notepad++ as suggested by my lecturar..but m not able to compile n run my prog in it...n need to know where m i gng wrng...

I had the same problem with my new computer with Windows XP sp3.
bgi graphics (that is graphics.h) can't be run in some computers including laptops. so try changing your laptop or computer. there may be a problem with new CPUs. use an older computer.:)

these programs can b compiled using notepad++..theres no need to chage lappy...
jst that m not getting hw to compile it using notepad++

these programs can b compiled using notepad++..theres no need to chage lappy...
jst that m not getting hw to compile it using notepad++

As others have tried to tell you -- Notepad++ is not a compiler. I think you can tell notepad++ how to run a a compiler, but notepad++ doesn't compile anything itself.

i know tis not a compiler...
n m asking to tell me how to make notepad++ to compile c++ program

m not getting hw to compile it using notepad++

i know tis not a compiler...
n m asking to tell me how to make notepad++ to compile c++ program

No one can help you if you yourself don't know what you want. Maybe you are just having problems trying to explain it in English language??

dude i knw hw to speak/explain in english...
n also the prblm m facing...
may b u r not undersatanding

If you have a compiler already installed, and in your PATH environment variable, then just press F5 and type
gcc prog.c
where gcc is the name of your compiler, and prog.c is the current filename you're editing.

Then press F1 to figure out how to make the command automatically substitute the name of the current filename.

>dude i knw hw to speak/explain in english..
Lastly, drop the SMS chat speak.
http://www.catb.org/~esr/faqs/smart-questions.html#writewell

dude i knw hw to speak/explain in english...
n also the prblm m facing...
may b u r not undersatanding

obvsly nt sc y cnt wr a dcnt sntce.

commented: Nice +1

@ salem

ok..m sorry for that...
i wrote the following program

#include<graphics.h>
#include<conio.h>
using namespace std;
void main()
{
	int gdriver=DETECT,gmode;
	initgraph(&gdriver,&gmode,"");
	line(0,0,100,100);
	getch();
	closegraph();
}

by the name line.cpp
i tried the method you had told but it's not working

>>but it's not working
What exactly does that mean? Did you get compile error messages? Yes, then post a few of them

>>int gdriver=DETECT,gmode;
That looks very questionable -- why use the comma operator ?

no error message..nothing happens

>>int gdriver=DETECT,gmode;
this means
int gdriver=DETECT;
int gmode;

>>but it's not working
What exactly does that mean? Did you get compile error messages? Yes, then post a few of them

>>int gdriver=DETECT,gmode;
That looks very questionable -- why use the comma operator ?

Sorry, but I can not help you because TurboC can not be installed on Windows 7 os (I just tried it).

its ok sir..thank you for trying

just have a doubt..i read that all softwares of XP are supported by windows 7, unlike vista..is it not so?
i was planning to get windows 7..thats why asking you


Sorry, but I can not help you because TurboC can not be installed on Windows 7 os (I just tried it).

If that turboC compiler is working for you ok with xp than don't upgrade to Windows 7. There is supposed to be an XP compatability mode but it is not in the Home Prem version that I have (at least not that I know of). I also have 64-bit version of Windows 7 and the error message I got when I tried to install TurboC was that the installer was not compatible with 64-bit Win7.

the problem is clear. graphics.h can't be used in NON BORLAND compilers (in a normal way).

initgraph(&gdriver,&gmode,"");

instead of "" there MUST be the address of the BGI folder, wich can be found in old Borland compilers. (I think Borland C++ 5 1997 is the last version of Borland compilers which support BGI).

// I guess you found the cde & y want to compile it in er non borland cmplr.

tried to install TurboC was that the installer

don't run the installer, copy the installed folder. who runs the installer of a 16bit compiler?

an XP compatability mode

as long as I remember Vista can run programs with compatibility to previous versions of windows. Windows 7 can, for sure.


And forgot to say
try to run

#inlcude <stdio.h>
int main()
{
     printf("my compiler works");
}

if it works then try to run a graphics program. this program is a first step to chck the cmplr. you shouldn't overpass this step.

don't run the installer, copy the installed folder. who runs the installer of a 16bit compiler?

I don't have an install folder, just a bunch of *.zip and *.cab files. Attached is a list of the files

well this is not an installed folder. you'll get one after installing what u have on a third party computer.
any way, try uzipping Bin.zip. then try to run BC.exe or TC.exe. this is the compiler's IDE exe.
This is most probably my last post in this thread.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.