Graphics Program Help

Please support our C++ advertiser: Intel Parallel Studio Home
Reply

Join Date: Oct 2007
Posts: 1
Reputation: gaming_geek is an unknown quantity at this point 
Solved Threads: 0
gaming_geek gaming_geek is offline Offline
Newbie Poster

Graphics Program Help

 
0
  #1
Oct 8th, 2007
Just for notes, I'm using VisualStudio 2003.

I'm working on a program that's supposed to make the Muller-Lyer illusion. I've got all of the coding done, but now when I try to run it all I get is a load of errors. First, it starts to compile the program and pops up a box saying, "There were build errors. Continue?" I hit continue anyways, and then it says "Unable to start debugging. Unable to start program "[Blah blah]." The system cannot find the file specified. On top of that, once I close that window, down in the task list window it gives a list of 'error LNK2019: unresolved external symbol' things. I'm really new to C++ and I have no clue of what to do. I'm not asking for a handout, I just need to know what I'm doing wrong. Thanks in advance!

  1. // Program file: mullyer.cpp
  2.  
  3. // Displays the image that causes the Muller-Lyer illusion
  4.  
  5. #include "C:\Graphics\graphics.h"
  6.  
  7. int main()
  8. {
  9. initGraph();
  10. return 0;
  11. }
  12.  
  13. void renderScene()
  14. {
  15. // Draw the two-headed arrow
  16.  
  17. moveTo(30, 30);
  18. lineTo(180, 30);
  19. moveTo(30, 30);
  20. lineTo(60, 0);
  21. moveTo(30, 30);
  22. lineTo(60, 60);
  23. moveTo(180, 30);
  24. lineTo(150, 0);
  25. moveTo(180, 30);
  26. lineTo(150, 60);
  27.  
  28. // Draw the two-tailed arrow
  29.  
  30. moveTo(30, 100);
  31. lineTo(180, 100);
  32. moveTo(30, 100);
  33. lineTo(0, 70);
  34. moveTo(30, 100);
  35. lineTo(0, 130);
  36. moveTo(180, 100);
  37. lineTo(210, 70);
  38. moveTo(180, 100);
  39. lineTo(210, 130);
  40.  
  41. // Label the drawing
  42.  
  43. outText(0, 250, "The Muller-Lyer illusion");
  44.  
  45. }
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 1,873
Reputation: twomers has a spectacular aura about twomers has a spectacular aura about twomers has a spectacular aura about 
Solved Threads: 56
twomers's Avatar
twomers twomers is offline Offline
Posting Virtuoso

Re: Graphics Program Help

 
0
  #2
Oct 8th, 2007
Well most of us aren't mind readers here so provide some errors for us to look at.

>> #include "C:\Graphics\graphics.h"

replace \ with \\

Might/mightn't solve some of your problems.
Last edited by twomers; Oct 8th, 2007 at 4:07 pm.
I blag!?
"Mr Kitty, you have to live in the attic now. Here, write a diary."
I am the Walrus!
Reply With Quote Quick reply to this message  
Join Date: Dec 2005
Posts: 5,850
Reputation: Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute Salem has a reputation beyond repute 
Solved Threads: 751
Team Colleague
Salem's Avatar
Salem Salem is offline Offline
Void main'ers are DOOMed

Re: Graphics Program Help

 
0
  #3
Oct 8th, 2007
Well the short answer to the problem is that you're trying to use a graphics API for a long-dead DOS compiler, and you're using something rather more up to date.

What you do about it is rather more complicated however. For a start, there are many more graphic API's available to you.

API's like DirectX and OpenGL are highly featured, but take quite a lot of getting used to. At the other end of the scale, you can use simple Win32 GDI commands to draw simple 2D scenes like the one you're trying to draw.

Somewhere in the middle are things like LibSDL and allegro
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 1,066
Reputation: Sturm is on a distinguished road 
Solved Threads: 24
Sturm's Avatar
Sturm Sturm is offline Offline
Veteran Poster

Re: Graphics Program Help

 
0
  #4
Oct 8th, 2007
Let me guess: Your using visual c++ 6 and some subpar textbook that uses outdated headers. The class is taught by some loser who is too stupid to get a real job actually programming. In fact judging by the time of year, you are on Chapter 2 which is titled "Graphics" or something of the sort. My advice: get a real c++ book, one that wasn't published in 1992. Don't expect to get anything out of this class.
"Hey ass, don't hijack my thread. This is serious." -JoshSCH
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC