Compilation Issue


I have recently installed visual cobol 2.2 (visual studio 2012) on my machine. while i am trying to compile any COBOL code in the IDE i am facing issue compilation failure with below description:

Directives file _cobol.dir not found
Illegal command line
COBOL compile: 0 item succeeded or up-to-date, 1 failed.
Done building project "ConsoleApplication2.cblproj" -- FAILED.
I am facing same error while compiling with CMD.
Can anyone please help me with this as i am stuck and unable to identify the cause.

  • Hello,

    The answer is right in the error message, which says "Directives file _cobol.dir not found"

    It looks like you are compiling with either the directive USE or DIR, which instructs the compiler to read a specific directive file. In your case, you have either USE(_cobol.dir) or DIR(_cobol.dir), and the compiler cannot find _cobol.dir in the current folder.

    To resolve the problem, you simply need to make sure you have _cobol.dir in your current folder.


  • Actually the file _cobol.dir is generated by the Visual Studio IDE when the build process is done so it makes no sense that you would get this same error when trying to compile from the command line unless you are running under msbuild.

    The message about illegal command line is normally displayed if the product is not licensed properly.

    If you open up the Micro Focus License Manager from the start menu and look at installed licenses what is displayed?

    I would also suggest that you test the product by opening up one of the sample solutions in the Samples Browser and seeing if it compiles successfully. If it does then this tells us that the problem lies within your project file.