Iam diving into the world of COBOL and have written a simple program that compiles and runs as intended from my KDE Plasma command line using open-cobol (cobc). I have seen a few sites mention that COBOL is quite portable and does not require multiple compilations, but when I try to run the same output program on Windows 10 (ie 32-bit), the system states that the program is a 16-bit application and thus cannot run.
Your program is likely already a 64bit executable (depending on your actual OS, otherwise its 32bit), but it is definitely no Windows binary (and because Windows doesn't recognize it, it just guesses this is a 16bit executable).
COBOL itself is portable, even between different compilers (if you restrict yourself to "standard" COBOL or use only the extensions that the compilers used share), but you need "some" native parts in any case.As a well known example take Java or .NET: the "runtime" is a native binary, which executes the java (or msil) byte code.
The easiest option for your case: take a compatible compiler and recompile your COBOL source for this platform on this platform.I'd suggesting the successor of OpenCOBOL: GnuCOBOL, using the official windows binaries.
--------
Regards,
Ronald. RE: Why Are Cobol Compilers Sooo Expensive? gregsimpson (Programmer)15 May 02 05:43 _win_dev.html has a free compiler
or
; contains loads of links to cobol compile sites. Many of which are free.
RE: Why Are Cobol Compilers Sooo Expensive? k5tm (Programmer)15 May 02 10:52Taking a hint from Microsoft...
Visual Studio .NET (what Visual Basic has become)
Enterprise Architect
Full Packaged Product $2,499 US
Version Upgrade $1,799 US
Enterprise Developer
Full Packaged Product $1,799 US
Version Upgrade $1,079 US
(And note that this pricing is in the face of Microsoft's clear incentive to provide tools that support the company's mainline os and office suite products.)
...or Borland Delphi (what Turbo Pascal has become)
Delphi 6 Enterprise $2,999 US
Version Upgrade $1,899 US
What usually fuels this question/argument (enough times to warrant a FAQ? ) is the desire of an individual or small enterprise to acquire minimalist development tools. Most COBOL compiler vendors have tried at one time or another to respond to this aspect of the demand for COBOL development tools without compromising the support level demanded by the larger customers that have a "bet the business" investment/relationship with their chosen COBOL vendor. Tom Morrison RE: Why Are Cobol Compilers Sooo Expensive? StephenJSpiro (Programmer)17 May 02 00:04The COBOL Compilers are so expensive because COBOL, far and away, is the most feature-rich programming language in the entire industry. And with the new standard, it moves from being the most feature-rich, versatile business programming language, to being the most feature-rich, versatile all-around programming language in the world.
Stephen J Spiro
ANSI COBOL Standards Committee RE: Why Are Cobol Compilers Sooo Expensive? RonaldB (Programmer)17 May 02 09:14... and one of the very few (or even the only one?!!) with an internationally accepted industry standard behind it. --------
Regards,
Ronald. RE: Why Are Cobol Compilers Sooo Expensive? Guest (visitor)17 May 02 17:23Interesting timing. Our company (theKompany.com) just released today what we call KOBOL for $39.95 download and $49.95 CD. For that one price you get the application on both Linux and Windows, an IDE with a syntax highlighting text editor, and a native compiler. No run time costs and free updates. You can read all about it and get a free demo from
www.thekompany.com/products/kobol. RE: Why Are Cobol Compilers Sooo Expensive? AustinOne (Programmer)19 May 02 23:30Seems to me that there are one or two "almost free" Cobol compilers on CD's bundled with some of those teach-yourself COBOL books..., Learn Cobol in 24 Seconds/Minutes/Hours/ Days, Cobol Unleashed, etc. My mind goes numb after visiting the local Borders book store. Of course, $59.95 ain't free.
To combat the marketplace and all of its mixed signals, I believe the mainline COBOL companies such as AcuCobol, etc., should consider putting out a personal almost-free vanilla COBOL85 compiler for Windows and Linux that is otherwise dumbed down from the enterprise / commercial versions that have all the real bells and whistles.
RE: Why Are Cobol Compilers Sooo Expensive? Gerbelem (Programmer)21 May 02 06:22The beauty about the cobol platform for professional developers is that we are not tied up to a single development platform. With just a new runtime my programs will run on a just about every platform available from unix to IBM mainframes, Linux ( btw there is a pretty good Cobol runtime for Linux from AcuCobol ). Microsoft has stepped up prices almost to the other guys and they already talking of having runtimes in future...I just do not want to be tied up to any of the Microsoft products or to anybody else as a matter of fact ! RE: Why Are Cobol Compilers Sooo Expensive? k5tm (Programmer)21 May 02 10:08"Microsoft (is) already talking of having runtimes in future"
In the future? Microsoft gets a 'runtime fee' on just about every PC sold. Their marketing term for their current 'runtime' is Windows XP, the latest graphical version of their first runtime, MS-DOS.
Tom Morrison RE: Why Are Cobol Compilers Sooo Expensive? Guest (visitor)23 May 02 06:05Fujitsu have allowed people to download Version 3.0 of their PC COBOL compiler... and it has appeared on CDROMs bundled with COBOL books e.g. COBOL for Dummies. RE: Why Are Cobol Compilers Sooo Expensive? Dimandja (Programmer)(OP)27 Jun 02 09:24I just bought Visual Basic.NET for $100. I would be very happy to obtain a COBOL compiler for that price that packs the same "minimalistic" development tools and features. RE: Why Are Cobol Compilers Sooo Expensive? Dimandja (Programmer)(OP)28 Nov 02 12:46It looks like we have a winner here
Assuming that everything promised is delivered (it looks that way so far), KOBOL is definitely the winner in COBOL compiler prices (and performance).
Good:
1. No expensive run-time costs to worry about, just compile your program on the target platform (like C).
2. Integrated IDE for code development and project management (like many other IDEed compilers).
3. Fully Object Oriented (like C++).
4. It is fully ANSI COBOL.
5. And the price! $59.95 (Download Version). Not a 'bargain' $3,000 and up as we have been told by other manufacturers.
Bad:
1. The name KOBOL! Why not tastefully KOmpany COBOL?
Dimandja RE: Why Are Cobol Compilers Sooo Expensive? dallasdino (Programmer)28 Nov 02 20:17I did not see a debugger to step through code in the demo. Am I missing something? RE: Why Are Cobol Compilers Sooo Expensive? GoAS400 (IS/IT--Management)30 Nov 02 03:34I have purchased Fujitsu Cobol for Windows Standard Edition for $750. I love it. I don't do any GUI with it but the project manager is easy to use, and the debugging is actually understandable. Works like a champ.
It's a better investment than any Microsoft software I've every bought :o
John RE: Why Are Cobol Compilers Sooo Expensive? ShadowFox333 (Programmer)4 Dec 02 17:05Here is a case study that Rm did on our conversion
from mainframes to pc environment. We do a lot of printing
And I was able to do duplexing and print inverted on the second half of the duplexed page, all in cobol. (I swear).
I think we only paid about $2000.00 at the time, but what it saved us was much more.
I am the first case study for international Computer on the page.
Enjoy Bob googletag.cmd.push(function() googletag.display('div-gpt-ad-1406030581151-2'); ); Red Flag This PostPlease let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.
CancelRed Flag SubmittedThank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.
I need a program I wrote in a .cobc file to be compiled to a windows executable file.The file is called main.cobc
Compiling it with: cobc -x -free *.cobc -o main
makes it a linux executable which is ok, but can't be run directly on windows.
I have gnucobol (OpenCOBOL installed on my linux ubuntu VM.
Please help. Is there a way I could compile it in a way that it's windows compatible?
That's not the question that is in the title, so answering that first.
Can you do it from Ubuntu?
Yes, ... as cobc uses an underlying C compiler and you can do cross-compiling with C compilers (you'll likely use gcc-mingw-w64-i686 or gcc-mingw-w64-x86-64).
That's the "long question". Yes, and very easy.
When you do have a Windows environment and want to generate an executable for that - no need for doing this in a separate VM (or WSL) in the first place, just get the official ready-to-use MinGW packages for GnuCOBOL (available for both 32 and 64bit) and compile directly on the Windows machine.
An iconic figure of the early history of computing, Grace Hopper is the grandmother of the COBOL programming language. Of her many claims to fame, she invented the first compiler and helped spread the adoption of machine-independent programming languages. Today her legacy lives on in many ways, including the Grace Hopper Celebration of Women in Computing.
While Hopper contributions to computing are remembered, celebrated, and built upon by her successors, COBOL itself is often dismissed as a relic of earlier era of computing. To a certain extent, that is true. Most of the COBOL being written today is for maintaining legacy code, not starting new projects. However, the language is still being updated with COBOL 2014 being the most recent standard for the language, and there are still plenty of opportunities to apply for jobs that require COBOL experience.
3a8082e126