Code Comments
Programming Forum and web based access to our favorite programming groups.How does one compile static binaries with opencobol under FreeBSD? I don't see any options to do this in the literature, and the resulting binaries obviously will not function on other systems where the cobol libraries are not installed. Error below is from trying to excute the result of "cobc count.cbl" on a different system. [host]user:~/cobol$ ./count /usr/libexec/ld-elf.so.1: Shared object "libcob.so.1" not found, required by "count"
Post Follow-up to this messageOn 26/09/2005 9:11 AM, Cydrome Leader wrote: > How does one compile static binaries with opencobol under FreeBSD? I don't > see any options to do this in the literature, and the resulting binaries > obviously will not function on other systems where the cobol libraries are > not installed. Error below is from trying to excute the result of "cobc > count.cbl" on a different system. > > [host]user:~/cobol$ ./count > /usr/libexec/ld-elf.so.1: Shared object "libcob.so.1" not found, required > by "count" > That would be the run-time environment, I guess. The docs are thin, but did you try: <http://www.opencobol.org/modules/bw... /> ontent_1_1> The variable COB_LDFLAGS should accept the right options to make static libs, that you can then make into a library, or link to your app to make a FreeBSD ELF executable. If not, then perhaps the run-time environment does not support static linking. I'd expect this to be in the OpenCOBOL docs somewhere.
Post Follow-up to this message> How does one compile static binaries with opencobol > under FreeBSD? I don't see any options to do this in > the literature, I don't know that you can create a static binary at all. You can use -fstatic-call to incorporate your own called programs statically, but not the underlying runtime. > and the resulting binaries obviously will not function on > other systems where the cobol libraries are not > installed. What is the problem with installing the runtime libraries on the target machine ? Just install OpenCobol and then install your programs.
Post Follow-up to this messageRichard <riplin@azonic.co.nz> wrote: > > I don't know that you can create a static binary at all. You can use > -fstatic-call to incorporate your own called programs statically, but > not the underlying runtime. > > > What is the problem with installing the runtime libraries on the target > machine ? Just install OpenCobol and then install your programs. disk space is cheaper than the time it takes to install/remove/track/audit programming environments on various machines.
Post Follow-up to this message> disk space is cheaper than the time it takes to install/remove/track/audit > programming environments on various machines. Then build an RPM or PKG or whatever is used by the systems that you want to target and have this install the libcobc and everything else that is required as it installs your program. OpenCobol may also require libdb, libltdl, libgpm, ncurses and much else, and these will rely on libc and others and may require a specific version. You may include checks in the RPM or PKG for all the required libraries. You may even include RPM or PKG for these on your distribution media. Alternately you could purchase a Cobol implementation that takes care of all these fiddling details for you, or at least has existing solutions, but that will cost money. If you write in Perl you need to ensure that there is a Perl system installed, same with Python, Java, even C#, and these may need to be of a specific version and/or have additional modules or packages installed. OpenCobol is no different.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.