Visual Studio 2008 (C++) additional directories for debugging?

扶醉桌前 提交于 2019-12-13 03:43:17

问题


In prior versions of Visual Studio one could specify paths for DLL files when debugging an application. I do not see a way to do this in version (2008). Is this due to the move toward deployment of applications with all DLL files, etc. in the application's directory(ies)?

Am I missing something, or is there no way to do this?


It was in Visual C++ 6. I think it was menu Tools -> Options -> Directories -> executable files.

Perhaps now this was not what I thought it was - this may be the same as what I have found in Visual Studio 2008.

Basically I am looking for a way to "append" to the PATH environment variable - just for running the EXE file project open in Visual Studio (without actually editing the path environment variable).

The workaround is for me to copy all the dependencies to the working directory. That will work - it just involves some changes to other projects - and gathering third-party stuff (this was a huge migration from Visual C++ 6).


回答1:


It doens't work that way anymore (since VS 6.0). Today, once a DLL file is loaded by the process, the DLL file gets a notification and search for the DLL debug symbols.

First it looks inside the DLL file (the DLL can keep the path for the debug symbols). If not, it searches the symbol path (menu Tool -> Options -> Debugging -> Symbols) then it looks inside the window directory.

It tries to load the debug symbol only if needed (to resolve a breakpoint for example) or if you manually ask the symbols to be loaded (in the case if the symbols were not found, it will prompt you for them).

You can see where the debugger have tried to look for the symbols by openning the modules pane (menu Debug -> Window -> Modules) right clicking on the module and selecting show debug information (it doesn't have Visual Studio here, so it might be called by a different name).

Thanks God(s) that we no longer need to configure the path for each DLL file.




回答2:


Use menu Tools -> Options -> *Project and Solutions, where you can specify all the search paths for your project.



来源:https://stackoverflow.com/questions/719896/visual-studio-2008-c-additional-directories-for-debugging

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!