[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] OpenCobol setup troubles (error: libcob.h: No such

From: Michael Anderson
Subject: Re: [open-cobol-list] OpenCobol setup troubles (error: libcob.h: No such file or directory)
Date: Fri, 14 Sep 2012 09:23:25 -0500
User-agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0

Just makin a comment about my experience with OC on MS.

I developed a Window software product using OpenCOBOL, although it wasn't a big hit, there are a handful of people using it everyday at one particular company. I built a "setup.exe" for my product and included the MS Re-distributable C  run-time, as well as other dependencies. From Download to "up and running" is about 7 clicks. It links to SP2.dll for the GUI, and Tcl85.dll, SQLite3.dll for the database, and my own vue3.dll library for my V/Plus-View3000 emulation. It consisted of about 18,000 lines of COBOL code, and the vue3.dll was also written using OpenCOBOL and about 5000 lines of code. None of the COBOL in this product was ported from somewhere else, it was all written from scratch for Windows & COBOL SP2, using a simple editor called Programmer Studio. My point is that I'm not talking about some little test program, this is a full-blown application evolving multiple dependencies -- with user base.

I didn't use Visual Studio at all, I agree that VS is unusable, however I chose cl.exe over gcc. Even on Windows you can still use the compile and link commands on the command-line, no need for Visual Studio, notepad will work in a pinch. For me, I used the cobc -c option to gen the C code, and ran that through the cl.exe, and then the linker. If more detail is needed I could boot-up the Windows box and get more detail syntax for you. Or look at how I used OC on Windows XP, Vista, and Window7.

This was not an easy lesson to learn, it involved much MS confusion, and debugging, debugging, debugging. At one point I download all the Windows XP symbols and put the entire OS into debug mode. I had a similar experience with OpenCOBOL on HPUX and gcc, and the moral of the story is: Use the C compiler that was designed for the platform that you are developing on. I understand the Gnu development environment is exceptionally good, much better than MS development environment. 

 I went though all the various COBOL compilers Tiny Cobol, Kobol, Fujitsu Student Version, all of them failures. For Production I've always user MF and Acu, or Fujitsu. My first shot at OC was using CygWin, and MinGW, and what I learned from writing a real application and debugging -- Windows Development Environment is a train-wreck! And cl.exe was designed for just such a train-wreck!

One of the strength of OpenCOBOL is that it doesn't require gcc, you can use the C compiler for what ever platform that you are running on. Therefore, it is really multi-platform.


On 09/14/2012 12:38 AM, Andrew Pennebaker wrote:
I followed Gary Cutler's instructions for installing OpenCobol 1.1 binaries for Windows, including setting the environment variables, but I can't compile Hello World. Somehow Cobol has trouble finding its own include files.

C:\> cobc -x hello.cob
error: libcob.h: No such file or directory

Is there an environment variable I can set that will inform Cobol to look for libcob.h in its include directory?

I also tried using Sergey's prebuilt binaries, but they require cl.exe. In other words, they expect every OpenCobol user is already knee deep in VisualStudio. I'm not sure I want to commit to such a large prerequisite; I rather like GCC and MinGW, and I really like Cutler's idea of bundling whatever compilers are necessary with the OpenCobol distribution, to save users the trouble of looking up compiler information. It looks like Cutler's distribution just needs a few more tweaks in order to be fully operational.

I'm preparing a one-click installer for OpenCobol that sets the proper environment variables and everything, I just need to get cobc -x hello.cob working based on your submitted binaries. If we can resolve this, I'll be sure to reply with a link to a one-click MSI Windows installer, as well as the install source for building it.


Andrew Pennebaker

Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.;262219671;13503038;y?

open-cobol-list mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]