While debugging linker can't open *.exe file because it still is in use
-
Hello I'm debugging code created using another programming environment (called AD model builder or ADMB) that generates C++ code. To do this, I have to make the following changes in the project settings: - Add program_name.tpl to your project. Where program_name.tpl is some sort of template (not in the sense of C++ templates) that has the original code that is then translated to C++. - Click on program_name.tpl then on the Project menu, choose settings, in the Custom Build tab, Commands window, add: C:\ADMB\BIN\TPL2CPP.EXE $(InputName) move $(InputName).htp $(WkspDir) In the Output window put: $(InputName).cpp TPL2CPP.EXE is the aplication that translates the ADMB template into C++. (a) When creating the new project create a blank 32 bit Windows console application in the folder where the source files are. (b) In Project/Settings/C++/Code generation, ensure that the runtime library is Debug single-threaded. (c) In Project/Settings/C++/Preprocessor/Preprocessor definitions add __MSVC32__ to the list so the list is: WIN32,_DEBUG,_CONSOLE,_MBCS,__MSVC32__ (d) In Project/Settings/ C++/Preprocessor/Additional include directories add the folder where the ADM include files are, as well as the source folder for the current program e.g. c:\admodel\include,c:\admodel\examples\kalman-filter (e) In Project/Settings/Link/General delete the Object/library models shown and add the ADM ones: admod32.lib adt32.lib ads32.lib (f) In Project/Settings/Link/Input add the ADM library folder - e.g. c:\admodel\lib Then, while debugging the code, if I have to make changes to the program_name.tpl file and try to recompile the resulting C++ it compiles OK but the linker can't access the exe file for modification because apparently is still in use even when I stop debugging clicking on the "stop debugging" button.... Then I tried deleting the exe file but got a message that it is in use by another application but it doesn't show up neither in the applications or processes running in the system... pretty weird... Any ideas about why this is happening and how to solve it? Thanks