I got a source code from the internet about a simple paint program.
The program works fine,but when i try to compile the source code,it cant find the header file(user defined).I did get the header file together with the source code & program, but i dont how to include it in the directory.I use Bloodshed Dev C++ version 2.Can anyone help me solve this problem?
Problem with header
Started by BINNY88, Oct 06 2008 12:47 AM
25 replies to this topic
#1
Posted 06 October 2008 - 12:47 AM
Forging ahead
|
|
|
#2
Posted 06 October 2008 - 01:49 AM
If you don't want to work with the compiler yourself and want Dev-C++ to do the job, then create a project, add both files, and compile.
#3
Posted 06 October 2008 - 03:46 AM
I dont understand what you are trying to say.How do i add the files??
Thanks
Forging ahead
#4
Posted 06 October 2008 - 03:51 AM
I haven't used Dev-C++ for a long, long time, so I don't remember exactly. But you could try looking in the "Files..." menu, and see if you can find something like "New..." > "Project," or alike. When you've created the project you can see some kind of tree hierachy of files out on the left side. There you can add the files you have, the source and the header.
Actually, I thought Dev-C++ would find the header automatically, also when you're just compiling one file, but now that it doesn't, you can always compile by hand. Start the commandprompt, cd to the folder where your files are, and write: g++ source.cpp -o executable, where source.cpp shall be the source file you have, and executable the name of the executable you want to be generated.
Actually, I thought Dev-C++ would find the header automatically, also when you're just compiling one file, but now that it doesn't, you can always compile by hand. Start the commandprompt, cd to the folder where your files are, and write: g++ source.cpp -o executable, where source.cpp shall be the source file you have, and executable the name of the executable you want to be generated.
#5
Posted 06 October 2008 - 08:49 AM
Thanks for the suggestions but I am still not getting the hang of it & besides I dont think dev c++ supports graphics.h since the error msg says cant find such file or directory.I do have a screen shot of the problem
Attached Files
Forging ahead
#6
Posted 06 October 2008 - 08:54 AM
It looks like you're trying to compile ancient nonstandard code with a modern standard compiler. What you see is what you get.
You'd need more than just the header, you also need the library code -- but I believe that is Borland's BGI interface.
You might be better served by trying to use something more up-to-date, rather than trying to learn decade-old all-but-dead technology.
You'd need more than just the header, you also need the library code -- but I believe that is Borland's BGI interface.
You might be better served by trying to use something more up-to-date, rather than trying to learn decade-old all-but-dead technology.
#7
Posted 06 October 2008 - 06:01 PM
Use GDI, GDI+, or DirectX, since they're more up-to-date. I'm assuming that you're writing this for Windows because of the presence of dos.h in your includes. That, by the way, is also outdated.
#8
Posted 06 October 2008 - 08:34 PM
rewrite, use opengl
#9
Posted 06 October 2008 - 08:47 PM
Actually that's probably a better idea since it's retargetable. Unless you're developing specifically for Windows and have no intention of porting to other systems, ignore my previous suggestion. I can't help you with OpenGL because I have no experience, but I do have some with GDI+.
#10
Posted 07 October 2008 - 07:46 AM
Yes i know its outdated but my university still uses the old turbo c++ ide(1990),you know the one with the blue screen which is now available for free(the colege doesnt need to pay for license) & here i am trying to compile in a modern compiler.By the way its for my miniproject though,the simpler it is,the less questions i have to answer & the simplest program is a console application & the examiners are more used to the old console applications
Thanks
Thanks
Forging ahead
#11
Posted 07 October 2008 - 08:39 AM
BINNY88 said:
Yes i know its outdated but my university still uses the old turbo c++ ide(1990),you know the one with the blue screen which is now available for free(the colege doesnt need to pay for license) & here i am trying to compile in a modern compiler.
It also bothers me that the students pay for an education and are taught things that have been officially dead for 10 years. And at the same time, freely available on the web are plenty of resources that one can use to be pretty much up to speed with the times.[/rant]
BINNY88 said:
By the way its for my miniproject though,the simpler it is,the less questions i have to answer & the simplest program is a console application & the examiners are more used to the old console applications
But if you must use these libraries for API handling such as mouse events and what not, perhaps I can take another shot at answering this.
#12
Posted 07 October 2008 - 09:33 AM
Thanks for your advice dcs.Most universities in India still use those old compilers,but the good thing is there are many private computer centers offering courses in the latest computer breakthroughs & the mainproject is usually done using ASP.net technologies(I dont know what they are yet)and other languages.I heard the words library,API,only when i joined this forum.We didnt care about such stuff until now.I have made a few attempts to study visual c++ & c# but progress is still slow,since i have to study other subjects in the syllabus.I did solve the problem when i compiled the code using the old compiler.
p.s I am really interested in your mentioning of mouse events.Do mention more if u have the time.Just mentioning resources will be more than enough.
Best regards
Forging ahead


Sign In
Create Account


Back to top










