Jump to content
  • Advertisement
Sign in to follow this  
v0dKA

"No symbols are loaded for any call stack frame. The source code cannot be displayed"

This topic is 4335 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm getting an odd message box when I try to debug my application is VS 2005 (standard). The message box reads: "No symbols are loaded for any call stack frame. The source code cannot be displayed." The options given are "OK" and "Show Disassembly". The program appears to run as usual if I choose OK, but of course, no source code is displayed. If I choose "Show Disassembly", the debugger points to a line that reads "004114AB jmp mainCRTStartup (41E420h)". Essentially, the debugger refuses to show anything useful. I can't "step into" the project, or "run to cursor", or even examine any variables. I've googled this problem, but didn't find anything that solved the problem. Others tend to have this problem on different platforms (I'm using WinXP here), or different languages (using unmanaged C++ here). As for what I did find, I made sure of this: debugging mode under project properties is set to "mixed" (doubt this will help, as I'm not using managed code), and "just my code" option (under tools->options->debugging) is turned off. I have not tried these yet: Set the debugger to stop on all exceptions (where do I find this option?). Enable symbol server support (seems like a drastic step, but I will be trying this now). The project is a C++ project. The only thing special about it is that it uses networking with the SDL library (particularly SDL_net). SDL_net requires that I set "Runtime library" (under project->properties->code generation) to "Multi-threaded debug DLL". Lastly, the debug database file (.pdb) does exist under the project folder (in the Debug sub-folder). Perhaps I should mention that I am getting a linker warning: "warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library". I'm not sure if it may have something to do with it. I have no clue what to do here. I'll be trying to use the Microsoft symbol server for now, but if anyone encountered this before or knows what to do about it, please help!

Share this post


Link to post
Share on other sites
Advertisement
The application is crashing in the standard library initialization code and you don't have source or symbols for that code. There is probably nothing you can do to get source or symbols.

Anyway, the crash is probably related to the message "warning LNK4098: defaultlib 'msvcrt.lib' conflicts ...".

All projects and libraries must be compiled with the same CRT library. Since SDL uses 'Multi-threaded DLL", all projects and libraries must use "Multi-threaded DLL". Go through all your projects in your solution and make sure they all are set to "Multi-threaded DLL". Look at the project properties under Properties->Configuration Properties->Code Generation->Runtime Library. You should use "Multi-threaded Debug DLL" for the Debug configuration and "Multi-threaded DLL" for the Release configuration. It is usually ok to mix the Debug and non-Debug versions, but you can't mix DLL and non-DLL.

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnBolton
The application is crashing in the standard library initialization code and you don't have source or symbols for that code. There is probably nothing you can do to get source or symbols.

Anyway, the crash is probably related to the message "warning LNK4098: defaultlib 'msvcrt.lib' conflicts ...".

All projects and libraries must be compiled with the same CRT library. Since SDL uses 'Multi-threaded DLL", all projects and libraries must use "Multi-threaded DLL". Go through all your projects in your solution and make sure they all are set to "Multi-threaded DLL". Look at the project properties under Properties->Configuration Properties->Code Generation->Runtime Library. You should use "Multi-threaded Debug DLL" for the Debug configuration and "Multi-threaded DLL" for the Release configuration. It is usually ok to mix the Debug and non-Debug versions, but you can't mix DLL and non-DLL.


I double checked that all the projects in the solution use multi-threaded debug DLL, and all the individual source and header files do too. Unfortunately, that didn't solve it.

However, since you pointed out that the linker warning is related to the problem, I tried using /NODEFAULTLIB, which I think ignores all standard libraries. Basically, does this mean that all the libraries that are automatically linked in for every new project get un-linked? If so, then I know why I'm getting 100 new linker errors [smile].

Is there anything else I can check? This project used to work fine, but I made major code changes to it since. I don't think I linked in any new library or changed any major project settings, though.

This is probably stupid, but I tried to add msvcrt.lib to the library ignore list. I only get 1 unresolved external now, but it's a bit odd:
unresolved external symbol "int __cdecl readInfo(char *)" (?readInfo@@YAHPAD@Z) referenced in function _SDL_main
The readInfo() function is mine, by why is it referenced in a function I did not write? o_O

Share this post


Link to post
Share on other sites
Quote:
Original post by v0dKA
I double checked that all the projects in the solution use multi-threaded debug DLL, and all the individual source and header files do too. Unfortunately, that didn't solve it.


If they all used the same setting, then you wouldn't get the warning. Some library or project that you are linking in is using a different setting. Take a look at this and see if it helps: Linker Tools Warning LNK4098. Also, keep in mind that this could be unrelated to your problem.

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnBolton
Quote:
Original post by v0dKA
I double checked that all the projects in the solution use multi-threaded debug DLL, and all the individual source and header files do too. Unfortunately, that didn't solve it.


If they all used the same setting, then you wouldn't get the warning. Some library or project that you are linking in is using a different setting. Take a look at this and see if it helps: Linker Tools Warning LNK4098. Also, keep in mind that this could be unrelated to your problem.


Yep, you ended up being right. All the files in my project did use the same runtime library, but some of the libraries I linked to (namely, the SDL libraries) actually used Multi-threaded DLL (not debug). This caused the problem.

Just for reference in case anyone else has this problem: I downloaded SDL from the binary, which simply gave me the .lib and .dll files. After researching a bit more about SDL, I found that people generally recommend the following: 1) compile SDL yourself from the sources; 2) use the DLLs instead of the .lib files when linking SDL to your project; 3) generally, stay away from the debug versions of *anything* when it comes to SDL.

I had to do #1 in order to fix the problem. When compiling SDL myself, I simply switched the "multi-threaded DLL" option to "multi-threaded debug DLL", and used the library files that I got after compiling with that option set.

Even though the problem is solved, I would still like to do #2, since I found that people recommend it. I'm not sure how to do it, though. How do I link to a .dll instead of a .lib? Under the project->properties->config options->linker->input->additional library files, I have "SDL.lib SDLMain.lib SDL_net.lib". If I switch .lib to .dll, I get this (the solution to which I could not find): "fatal error LNK1107: invalid or corrupt file: cannot read at 0x2B0". So I guess that's not the correct way to link a .dll.

In any case, it works fine with the .lib files. Thanks for the help, John!

Share this post


Link to post
Share on other sites
Quote:
Original post by v0dKA
Yep, you ended up being right. All the files in my project did use the same runtime library, but some of the libraries I linked to (namely, the SDL libraries) actually used Multi-threaded DLL (not debug). This caused the problem.

That's strange because I have no problem linking the SDL libraries (which use the MT DLL) with my projects that use MT Debug DLL. I get the warning, but I have no problems running. I'm using VS 2003. Are you using VS 2005? If so, maybe that has something to do with the problem.

Share this post


Link to post
Share on other sites
Quote:
Original post by JohnBolton
Quote:
Original post by v0dKA
Yep, you ended up being right. All the files in my project did use the same runtime library, but some of the libraries I linked to (namely, the SDL libraries) actually used Multi-threaded DLL (not debug). This caused the problem.

That's strange because I have no problem linking the SDL libraries (which use the MT DLL) with my projects that use MT Debug DLL. I get the warning, but I have no problems running. I'm using VS 2003. Are you using VS 2005? If so, maybe that has something to do with the problem.


Yes, I'm running VS 2005. But I've been having even more odd problems with the linker lately, some of which were solved just by placing the definition of a particular function from one file to another (while noting that both places are essentially the same - I checked that both files were included in the project and set to compile). Hardly anything can surprise me at this point.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!