Thread: MSvc++ isn't compiling hello world program

  1. #1
    NotSoAvgProgrammer
    Join Date
    Jul 2007
    Location
    Virginia, U.S.
    Posts
    57

    MSvc++ isn't compiling hello world program

    I have tried and tried to get a program to work on msvc++, but to no avail. I have gotten a successfully build, but when I go to run it I get:
    'tester.exe': Loaded 'C:\Documents and Settings\Owner.YOUR-99DDF15D27\My Documents\Visual Studio 2005\Projects\tester\debug\tester.exe', Symbols loaded.
    'tester.exe': Loaded 'C:\WINDOWS\system32\ntdll.dll', No symbols loaded.
    'tester.exe': Loaded 'C:\WINDOWS\system32\kernel32.dll', No symbols loaded.
    'tester.exe': Loaded 'C:\WINDOWS\WinSxS\x86_Microsoft.VC80.DebugCRT_1fc 8b3b9a1e18e3b_8.0.50727.762_x-ww_5490cd9f\msvcr80d.dll', No symbols loaded.
    'tester.exe': Loaded 'C:\WINDOWS\system32\msvcrt.dll', No symbols loaded.
    I have tried to reinstall it, and i still get this same problem.

    What does "No symbols loaded" mean?
    Is there a way I can get it to work, or a way I can provide more information to help you help me?
    Am I missing files?
    Is it a simple matter of configuration?

    Any help would be greatly appreciated.

    Thank you for your time and effort,

    Joe

    P.S. If you're wondering what the code is, it's the default hello world console program that you get when you set up a console template.

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    It's harmless, and I suspect your code works just fine.

    To explain: It means that when the debugger loaded your application and the DLL's that it uses, it could not find the symbol files that you'd need if you wanted to debug for example Kernel32.dll. The symbols are available on MS symbol server - and if you really want to, you can probably set the debugger up to download those [I've only ever used this on the Windows Kernel debugger, where it's really much more useful than in a user-mode application] - but I doubt that you'll need that for any near-time projects if you just started programming in C.

    What you may find is that you need to add something to stop your program from "quitting" immediately, such as
    Code:
       getchar();
    somewhere just before the return in main().

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    NotSoAvgProgrammer
    Join Date
    Jul 2007
    Location
    Virginia, U.S.
    Posts
    57
    LOL
    I feel like an idiot, I've been avoiding msvc++ for a while as I couldn't figure out why it wouldn't work on a simple hello world program, so I have stuck with code::blocks.
    Anyways I'm an hobbiest who is just starting 3d programing(simple boxes and stuff), I'm leaning towards opengl, but I might use directX. Should I look into downloading the dll for the debugger. I have heard wonders about the msvc++ debugger.


    Joe

    P.S. Thanks for the speedy reply, your the only one who has actually been able to help me with that

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    You don't need to debug those dlls, so don't worry about that. You can still debug your own program.

    If you use Ctrl-F5 to execute your program VC++ will add a pause automatically. Using F5 to run your program runs it through the debugger which is an excellent tool. You can add a breakpoint to stop execution before it ends by putting the cursor on the closing brace of the main function and hitting F9. Then if you run the program it will stop there and you can switch to the console window to see the output.

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Short answer: No need for you to do anything.

    Long answer:
    Those DLL's are on your machine already. The SYMBOLS[1] for the dll's aren't - and I'm 99% sure that you will not need them for quite some time. If you are doing 3D graphics (OpenGL, DirectX or any other form), you will most likely be debugging what YOUR code does, not what the OS or it's "helper" functions does.

    The debugger in MSVC is definitely competent and useful, and you don't (generally) need symbols for the DLL's you use in your application, unless there is a bug in those DLL's.

    [1] Symbols are essentially a list of function names, variable names and the address those "live at" within a executable or DLL. You get a sort a file called "hello.pdb" when you build a debug version of your application. This is the symbol file for your application. If you use the symbol server from Microsoft, you can automatically download the symbols for (almost) all microsoft DLL's [I only know this to work in the WinDBG debugger - but I suspect there's a way to make the MSVC debugger do the same thing - although a 5 minute look for it didn't find such a setting]. But it's only really helpfull if you are tracing bugs in that code (or for some other reason decide to step through the OS/library code on your system - some people have more spare time than others - note however that you will be doing this at the assembly code level, as you still don't get any source-code). By the way, the MS symbol files are reduced to "essentials", meaning that only some of the more important components are in the symbol file, not the "whole shebang" like you get when you build your own application.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Just to add to this thread, in case someone actually uses the search button to find this:
    Here's How Microsoft reccons that you should use Symbol Server with Visual studio.
    http://support.microsoft.com/kb/319037

    I still think there's no need to do this for 98% of all users of this forum.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Registered User
    Join Date
    Sep 2007
    Posts
    9
    Use GCC. 'nuff said.

  8. #8
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Stop your pointless attacks on VS already ...
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  9. #9
    Registered User
    Join Date
    Jan 2005
    Posts
    7,366
    >> Use GCC. 'nuff said.

    BTW, gcc has no support for a solution to this user's problem, while VC++ has some.

  10. #10
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    The problem here is in the IDE, not the compiler. Dev-C++ doesn't solve the problem, while VC++ and Code::Blocks do.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  11. #11
    Registered User
    Join Date
    Sep 2007
    Posts
    9
    Stop your pointless attacks on VS already ...
    not once did i *attack* VS.

    The problem here is in the IDE, not the compiler. Dev-C++ doesn't solve the problem, while VC++ and Code::Blocks do.
    neither did i mention devc++...

    if the problem is with DLL's, that's an MS specific problem, and i certainly didn't claim that the gcc or devc++ would solve these issues. i was just offering my two cents... without *attacking* anyone which is more than I can say for some of you...

    now, these are my personal opinions about things: i'm not a huge MS fan (obviously), but it has its merits, mainly bringing a point & click interface (and therefore computers) into the homes of millions of people who otherwise wouldn't know how to navigate a command prompt. This is a very GOOD thing, and i solute MS for their efforts.

    My gripes are such: ms goes against everything in the GPL (and understandably so), it's not that I don't think people shouldn't pay for software (we all want to make money) it's that it goes against *standards*. MS won't adhere to any standards that aren't in their best interest. while that's good for them and their already deep pocket books, i don't think it's the best thing for the end-user.

    So if i can persuade enough people to follow suit, MS might not forever be the OS champion, therefore kernels/files-systems/etc. might one day be standardized, allowing us to move on with our lives, and code better programs without worrying about corrupted dll's, or which compiler compiles what.

    Now, do you see how it's possible to give your opinions without getting hostile.

    Thank You.

  12. #12
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    if the problem is with DLL's, that's an MS specific problem, and i certainly didn't claim that the gcc or devc++ would solve these issues.
    You implied that GCC would solve the issue at hand.

    I suggest that you cease your evangelisation attempts unless they are on topic.

    EDIT:
    Ah well, the OP replied with an off topic post too, so I guess I will leave them to be.
    Last edited by laserlight; 09-23-2007 at 11:37 AM.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  13. #13
    NotSoAvgProgrammer
    Join Date
    Jul 2007
    Location
    Virginia, U.S.
    Posts
    57
    Before now I used code::blocks, which is a great open source IDE. I highly support it(mentally I'm young and, therefore unable to use credit cards over the net, so I have to stick with free software. You are absolutely right that microsoft is horrible with going along with standards, ex. IE. The problem is that most people that use the computer, could care less what it means to validate a web page, nor how extremely bulky and ugly IE is. It comes with microsoft, and does what they need, why should they change(in their minds). I see this everyday as I look at my parents computer downstairs.
    Also Microsoft keeps me from switching to linux simply because it's not very standard. If most games where not directX based, and where compatible with linux, Linux would definitely be my (main)operating system. I have an old computer that I installed linux on.

    My personal goal in programming is to make a game that is played on the same server, via linux, mac, and windows computers(years from now lol).
    openGL 3!!!!!!!!!!!! yay

    Anyways I got vc++ set up with opengl.
    Thanks for all of your help,

    Joe

  14. #14
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Quote Originally Posted by entropyrexor View Post
    if the problem is with DLL's, that's an MS specific problem, and i certainly didn't claim that the gcc or devc++ would solve these issues. i was just offering my two cents...
    Actually, the originally posted problem was about symbol support for DLL's, and if we for the moment ignore Linux/*BSD and other Open Source OS's, I'd say that MS has as good support as any other for "getting" the symbols you need if you ARE interested in debugging the system DLL's. And unless you are willing to rebuild your .so's in Linux, I'm not sure they have much in the way of symbols in a standard distribution - although it is something I haven't looked at (because almost all of my Linux work has been inside the kernel, and with MY kernel build, so I've never had to try that out).

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Program Plan
    By Programmer_P in forum C++ Programming
    Replies: 0
    Last Post: 05-11-2009, 01:42 AM
  2. beginning C Programmer - Need Help Compiling Program
    By fisguts in forum C Programming
    Replies: 2
    Last Post: 07-30-2008, 02:14 PM
  3. Problem Running Program After Compiling
    By kristentx in forum C++ Programming
    Replies: 13
    Last Post: 09-12-2007, 10:46 AM
  4. newbie : compiling a C++ program in linux
    By gemini_shooter in forum C++ Programming
    Replies: 5
    Last Post: 06-23-2005, 02:45 PM
  5. Help compiling a program
    By jjj93421 in forum C++ Programming
    Replies: 1
    Last Post: 03-08-2004, 06:38 PM