Hello, sorry it's my first time creating topics in sourceforge, I recently installed GnuCOBOL through chocolatey (choco install gnucobol) and everything works, except the actual compiling of COBOL programs, I tried with a simple hello world I had laying around, and whenever I try to compile (cobc PGMTEST.cbl -o PGMTEST.exe or cobc -x PGMTEST.cbl) I get the error message: gcc: error: /LIBPATH:C:\ProgramData\chocolatey\lib\gnucobol\tools\lib\libcob.lib: Invalid argument
Which going deeper (or checking the actual LIBPATH given), I found out there's no libcob.lib in that same folder, theres a libcob.a, a libcob.dll.a and a libcob.la, but no libcob.lib, so is there something wrong with the package I installed? Or did I configure the compiler wrongly?
Thanks in advance
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Sorry to bother again, but it hasn't really fixed the thing, it's still throwing the same error, I'm attaching a screenshot of all: The test program, the lib folder and the command I use.
oh so you mean something like cobc ./PGMTEST.cbl -xv? Sorry I didn't know, I'm really new to posting errors and stuff hahahah, the other environment variables SHOULD come from the choco installation, as I've tried installing the MSYS2 version (mingw-x64-x86_64-gnucobol) but that gave me some configuration errors so I opted to go with chocolatey, but I should have erased all of the files from the MSYS2 version.
I suggest to report to the choco repo that this package is broken.
Then find out where the environment variables are set and adjust similar to the following
Sorry to bother again, will do the report, but it still quite doesn't work, I've tried changing the variable a lil more trying with:
- /L"C:\ProgramData\chocolatey\lib\gnucobol\tools\lib"
- /L"C:\ProgramData\chocolatey\lib\gnucobol\tools\lib\libcob.lib"
- "C:\ProgramData\chocolatey\lib\gnucobol\tools\lib\libcob.lib"
- /LIBPATH"C:\ProgramData\chocolatey\lib\gnucobol\tools\lib"
and only the third option let me compile (although no program I compiled with that showed any message (the hello world wouldn't show up)), so I'm still at a loss as to what to do...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What runtime owns the .EXE ?
If it is not the GnuCOBOL RTS the displays in a GnuCOBOL program are never to be seen - the STDIN, STDOUT handles are owned by the controlling .EXE (I think)
Here is a wee bit of a test to ascertain whether the above is the case.
Replace the "Hello World" with a call to ZMSGBOX2
ZMSGBOX2 uses WinApi MessageBoxA iinstead of console services.
See syntax and code below:
Rechecked: you want /L"C:\ProgramData\chocolatey\lib\gnucobol\tools\lib" -lcob.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
Anonymous
-
2024-05-08
Hi guys, i'm having this exact same issue. Just installed GnuCobol with Chocolatey and it fails. I have set COB_LIBS=C:\ProgramData\chocolatey\lib\gnucobol\tools\lib but now ld.exe complains with:
cobc -x testfunc.cob
C:\ProgramData\chocolatey\lib\gnucobol\tools\bin/ld.exe: cannot find C:\ProgramData\chocolatey\lib\gnucobol\tools\lib: Permission denied
collect2.exe: error: ld returned 1 exit status
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, sorry it's my first time creating topics in sourceforge, I recently installed GnuCOBOL through chocolatey (
choco install gnucobol) and everything works, except the actual compiling of COBOL programs, I tried with a simple hello world I had laying around, and whenever I try to compile (cobc PGMTEST.cbl -o PGMTEST.exeorcobc -x PGMTEST.cbl) I get the error message:gcc: error: /LIBPATH:C:\ProgramData\chocolatey\lib\gnucobol\tools\lib\libcob.lib: Invalid argumentWhich going deeper (or checking the actual LIBPATH given), I found out there's no libcob.lib in that same folder, theres a libcob.a, a libcob.dll.a and a libcob.la, but no libcob.lib, so is there something wrong with the package I installed? Or did I configure the compiler wrongly?
Thanks in advance
If you did not set anything and just use that package, then the package ah be broken. Your fix is to copy libcob.dll.a to libcob.lib.
mod edit to remove some reply-to
Last edit: Brian Tiffin 2022-05-26
Oh ok thanks! that seems like an easy solution heh thanks a bunch.
Sorry to bother again, but it hasn't really fixed the thing, it's still throwing the same error, I'm attaching a screenshot of all: The test program, the lib folder and the command I use.
add
-vto cobc and post the output as text, should be fixableMaybe also add the output of
Last edit: Simon Sobisch 2022-05-27
and:
Last edit: enð 2022-05-27
Sorry for not being specific enough. We'd need the output of "cobc all your options -v".
But I've question already: where do all these environment variables come from, that are visible in "cobc --info"?
oh so you mean something like
cobc ./PGMTEST.cbl -xv? Sorry I didn't know, I'm really new to posting errors and stuff hahahah, the other environment variables SHOULD come from the choco installation, as I've tried installing the MSYS2 version (mingw-x64-x86_64-gnucobol) but that gave me some configuration errors so I opted to go with chocolatey, but I should have erased all of the files from the MSYS2 version.For the command you ask it sends me this:
I suggest to report to the choco repo that this package is broken.
Then find out where the environment variables are set and adjust similar to the following
Sorry to bother again, will do the report, but it still quite doesn't work, I've tried changing the variable a lil more trying with:
- /L"C:\ProgramData\chocolatey\lib\gnucobol\tools\lib"
- /L"C:\ProgramData\chocolatey\lib\gnucobol\tools\lib\libcob.lib"
- "C:\ProgramData\chocolatey\lib\gnucobol\tools\lib\libcob.lib"
- /LIBPATH"C:\ProgramData\chocolatey\lib\gnucobol\tools\lib"
and only the third option let me compile (although no program I compiled with that showed any message (the hello world wouldn't show up)), so I'm still at a loss as to what to do...
What runtime owns the .EXE ?
If it is not the GnuCOBOL RTS the displays in a GnuCOBOL program are never to be seen - the STDIN, STDOUT handles are owned by the controlling .EXE (I think)
Here is a wee bit of a test to ascertain whether the above is the case.
Replace the "Hello World" with a call to ZMSGBOX2
ZMSGBOX2 uses WinApi MessageBoxA iinstead of console services.
See syntax and code below:
Last edit: Ralph Linkletter 2022-05-28
Rechecked: you want
/L"C:\ProgramData\chocolatey\lib\gnucobol\tools\lib" -lcob.Hi guys, i'm having this exact same issue. Just installed GnuCobol with Chocolatey and it fails. I have set COB_LIBS=C:\ProgramData\chocolatey\lib\gnucobol\tools\lib but now ld.exe complains with:
cobc -x testfunc.cob
C:\ProgramData\chocolatey\lib\gnucobol\tools\bin/ld.exe: cannot find C:\ProgramData\chocolatey\lib\gnucobol\tools\lib: Permission denied
collect2.exe: error: ld returned 1 exit status
as noted directly above:
And once this is solved, I suggest to bring this to the attention of the maintainer of the choco package you use.