![]() |
|
|
#1 | ||
|
Grizzled Veteran
Join Date: Dec 2002
Location: Little Rock, AR
|
Visual Studio Problem
Hey guys -
I am having troubling compiling a program in Visual C++. I am having to do it for a class and I am getting the following error when I try to run the program. The screen flickers then kicks back to this... Loaded 'ntdll.dll', no matching symbolic information found. Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found. The thread 0x9E8 has exited with code 0 (0x0). The program 'C:\Program Files\Microsoft Visual Studio\MyProjects\Learning\Debug\Learning.exe' has exited with code 0 (0x0) I am doing it in a Win32 console enviorment. The complier was issued you to me under the liscense of the school. Anyone know what could be wrong? |
||
|
|
|
|
|
#2 |
|
High School JV
Join Date: Jan 2002
Location: New Zealand
|
It's been awhile since I've used Visual Studio, but isn't code 0 = success? Is it possible that your program is running successfully, but since it is a console app it just runs and completes and then sends you back to the debugger? Does the program wait for any sort of user input? What happens when you run it outside of Visual Studio from the command line?
|
|
|
|
|
|
#3 |
|
General Manager
Join Date: Oct 2000
Location: The Satellite of Love
|
Taco sounds correct. You say it flickers. That's probably the console window opening and closing.
EDIT: Just throw a little bit of code to get input from the user somewhere in the code just to see if it is actually running. Last edited by sabotai : 04-29-2004 at 05:25 PM. |
|
|
|
|
|
#4 |
|
Grizzled Veteran
Join Date: Dec 2002
Location: Little Rock, AR
|
The code does not ask for user input...
How can I get it to where it stays up? PS I hate the console. |
|
|
|
|
|
#5 |
|
General Manager
Join Date: Oct 2000
Location: The Satellite of Love
|
Actually, on second thought, why not just create a text file and output lines to it. Like everytime the code does something, you output "Attempting to..." before that section of code and than "Success" after it (or say what went wrong if it didn't work).
I had to learn several times to make this a habit. Welcome to the real world of computer programming. ![]() |
|
|
|
|
|
#6 |
|
General Manager
Join Date: Oct 2000
Location: The Satellite of Love
|
example, everytime I add a fighter to the database for my boxing dynasty, I see this in my browser
Attempting to add fighter... Connected DB selected Variables copied over slashes added and integers made query made INSERT INTO tblFighters VALUES (NULL, 'John', 'Ferguson', 'Sandy', 0, 0, 0, 0, 0, 0, '1898', 'np.jpg', 1898, 1916, 0.0) query sent 1 fighters added. Where "1 fighters added" (shut up grammer cops, this is code. ), if something goes wrong with the query attempt, it'll post it there. |
|
|
|
|
|
#7 | |
|
Grizzled Veteran
Join Date: Dec 2002
Location: Little Rock, AR
|
Quote:
How would I exaclty do this? You misspelled grammar... ![]() |
|
|
|
|
|
|
#8 |
|
High School JV
Join Date: Jan 2002
Location: New Zealand
|
Like I said, it's been awhile since I have done Visual Studio (and C++), but I believe if you put Readln(); as the last line of your program that it will keep the console window open until you hit enter.
|
|
|
|
|
|
#9 | |
|
Grizzled Veteran
Join Date: Dec 2002
Location: Little Rock, AR
|
Quote:
That didn't work. Here is the code: #include int main() { int x = 5; int y = 7; cout << "\n"; cout << x + y << " " << x * y; cout << "\n"; return 0; } Readln(); |
|
|
|
|
|
|
#10 |
|
General Manager
Join Date: Oct 2000
Location: The Satellite of Love
|
No, put the Readln(); before the return 0;
The return 0; line is what closes the program. |
|
|
|
|
|
#11 | |
|
Grizzled Veteran
Join Date: Dec 2002
Location: Little Rock, AR
|
Quote:
That gives an undeclared idenitifier error. |
|
|
|
|
|
|
#12 |
|
General Manager
Join Date: Oct 2000
Location: The Satellite of Love
|
Here's how it would be done using the text file output:
Code:
Then check the file in the directory where your program is and make sure all of the lines have been outputed. If they have, then your program ran fine. For the Readln(); I don't know the exact use of the that line anymore...in fact, I think that's PASCAL, not C++. ![]() Last edited by sabotai : 04-29-2004 at 08:21 PM. |
|
|
|
|
|
#13 |
|
General Manager
Join Date: Oct 2000
Location: The Satellite of Love
|
Instead of Readln(); use getch();
Last edited by sabotai : 04-29-2004 at 08:22 PM. |
|
|
|
|
|
#14 |
|
Awaiting Further Instructions...
Join Date: Nov 2001
Location: Macungie, PA
|
when you run a console program (assuming VS 6) it will auto-pause waiting for a key press.
|
|
|
|
|
|
#15 | |
|
Grizzled Veteran
Join Date: Dec 2002
Location: Little Rock, AR
|
Quote:
Nope. The code does not show up either. Just a blank screen flickers. |
|
|
|
|
|
|
#16 |
|
High School JV
Join Date: Jan 2002
Location: New Zealand
|
Pascal, C++, I can't keep them all straight anymore!
Isn't it "cin" that I was thinking of... Anyway, I should stop giving advice about this. Good luck GE! |
|
|
|
|
|
#17 | |
|
Grizzled Veteran
Join Date: Dec 2002
Location: Little Rock, AR
|
Quote:
I figured it out. I was hitting F5 to excute the program instead of Ctrl F5. I have no idea what F5 does. |
|
|
|
|
|
|
#18 |
|
General Manager
Join Date: Oct 2000
Location: The Satellite of Love
|
F5 runs the program in Debug mode, which now makes a lot more sense for what you originall posted.
|
|
|
|
|
|
#19 |
|
Awaiting Further Instructions...
Join Date: Nov 2001
Location: Macungie, PA
|
GE,
You have an inlcude statement, but aren't including anything. Isn't there something like: #include <library.h> that you must add? [edit - ah, when you insert greater than and less than brackets in this editor the browser interprets them as html- you have to you ampersand-gt; and lt for that to show up. - what are you including?] Last edited by Bonegavel : 04-30-2004 at 07:48 AM. |
|
|
|
|
|
#20 |
|
Awaiting Further Instructions...
Join Date: Nov 2001
Location: Macungie, PA
|
dola, oh, i see you found your solution.
GE, when you run the program in debug mode (sorry, assumed you were doing that) do you get the "press any key to continue" message? |
|
|
|
|
|
#21 | |
|
Grizzled Veteran
Join Date: Dec 2002
Location: Little Rock, AR
|
Quote:
No, I do not. While we are on the topic of Visual C++, does anyone know how can I turn on line numbers? |
|
|
|
|
|
|
#22 | |
|
Pro Starter
Join Date: Oct 2000
Location: Cary, NC
|
Quote:
What? Why? C++ doesn't have line numbers, but there is a status display in the lower-right of Visual C++ that shows the current line. What version of Visual C++ are you using? That's going to make a difference in some of these UI questions.
__________________
-- Greg -- Author of various FOF utilities |
|
|
|
|
|
|
#23 | |
|
Pro Starter
Join Date: Jul 2003
Location: South Bend, IN
|
Quote:
F5 will run the program in debug mode, whereas Ctrl-F5 will execute the program outside the debugger. You'll only notice the difference if you have errors (if it's in the debugger, by default it will break on exceptions rather than killing the program) or if you've set breakpoints. |
|
|
|
|
|
|
#24 |
|
Pro Starter
Join Date: Jul 2003
Location: South Bend, IN
|
Dola, the way I'd handle convincing the console window to stay open is thusly:
Code:
Last edited by Mr. Wednesday : 05-01-2004 at 12:01 AM. |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|