Starting debug from Visual Cobol command line results in error but working when starting from IDE

Application contains calls to subprograms (dll in my case).

Calls to Subprogram/dll work when you start debug from IDE.
Calls to Subprogram/dll do not work when you start debug from the Visual Studio command line.

When running programs without debug, it works if you put them all in the same folder.
You can have a common output folder for all exe and DLL files in settings (for each program).

I have not found a output folder setting at debug.

Do I have to manually copy dll:s to the output folder of the main program?

I use Windows 10, Visual Studio Profession 2017 and Visual Cobol 6.0.

/Regards

  • How are you starting the debugger from the command line, set COBSW=+A. call to CBL_DEBUGBREAK. other?

    If you start the main .exe from the command line then the project and solution settings will not be in effect so the main program will not know where to look for the .dlls. If prior to running the main program you add to the PATH environment variable the folder containing the .dlls then it should find them.

    Using a common output folder for all projects would be one way to alleviate this issue.

  • Thank you for answering.
    When starting from command line I just wrote the program name and hit enter. 
    When using COBSW=+A the debug starts from the beginning but same error occurs when calling the program.

    When adding path of dll to %PATH% it worked.


    Is there a setting for a common output folder at debug?

    /Regards

  • I am not sure what you are asking for here but in the project properties on the COBOL tab you can change the Output Path setting to be any folder that you like and that is where the .EXEs or .DLLs will end up. By default this is set to .\bin\x86\Debug\. You can set this differently per configuration. If you have your configuration set to release build then you can specify a different folder. By default the release build goes to .\bin\x86\Release\ or x64 if the configuration is set to x64.

    i.e if you set all projects to output to a folder named C:\LOADLIB  then all executables will be copied to that folder after the build.