[Coco] CMOC linking error

James Ross jrosslist at outlook.com
Mon Aug 6 23:56:34 EDT 2018


Hi Pierre!

this is a real head-scratcher since everything looks like it should be working.

here are some of the things you mentioned: 

jar at Win8 /cygdrive/d/Dev/Retro/CoCo/Projects/TestCMOC
$ cmoc -v
cmoc (cmoc 0.1.52)

jar at Win8 /cygdrive/d/Dev/Retro/CoCo/Projects/TestCMOC
$ which cmoc
/usr/local/bin/cmoc

jar at Win8 /cygdrive/d/Dev/Retro/CoCo/Projects/TestCMOC
$ lwasm --version
lwasm from lwtools 4.15

jar at Win8 /cygdrive/d/Dev/Retro/CoCo/Projects/TestCMOC
$ which lwasm
/usr/local/bin/lwasm

jar at Win8 /cygdrive/d/Dev/Retro/CoCo/Projects/TestCMOC
$ cmoc --verbose tst1.c
Target platform: CoCo Disk Basic
Preprocessing: tst1.c
Preprocessor command: cpp -xc++ -U__cplusplus -I'/usr/local/share/cmoc/include' -D_CMOC_VERSION_=1052 -D_COCO_BASIC_=1 -U__GNUC__ -nostdinc -undef tst1.c
Compiling...
Code address: $2800 (10240)
Data address: after the code
Assembly language filename: tst1.s
0 error(s), 0 warning(s).
Assembler command: lwasm -fobj --pragma=forwardrefmax -D_COCO_BASIC_ --output='tst1.o' 'tst1.s'
Exit code from assembler command: 0
Linker command: lwlink --format=decb --output='tst1.bin' --script='tst1.link' --map='tst1.map' -L/usr/local/share/cmoc/lib -lcmoc-crt-ecb -lcmoc-std-ecb -lcmoc-float-ecb 'tst1.o'
lwlink: error: Can't open library: -lcmoc-crt-ecb
Exit code from linker command: 1
Number of error messages from linker: 1

I'm totally stumped ... 
Don't worry about this too much Pierre -- unless you see something that is off. 

I might try placing some debug statements in the lwlink figure out why it's saying it can't open the library cmoc-crt-ecb -- I am guessing a lib is prepended before trying to open the lib?

OR I might go ahead and delete Cygwin and re-install it. 

here is the lib and bin folders ... 

jar at Win8 /cygdrive/d/Dev/Retro/CoCo/Projects/TestCMOC
$ ls -la /usr/local/share/cmoc/lib
total 176
drwxrwxr-x+ 1 jar None     0 Aug  6 14:19 .
drwxrwxr-x+ 1 jar None     0 Aug  6 14:19 ..
-rw-r--r--  1 jar None 14367 Aug  6 14:19 libcmoc-crt-ecb.a
-rw-r--r--  1 jar None 14875 Aug  6 14:19 libcmoc-crt-os9.a
-rw-r--r--  1 jar None 14423 Aug  6 14:19 libcmoc-crt-usim.a
-rw-r--r--  1 jar None 14336 Aug  6 14:19 libcmoc-crt-vec.a
-rw-r--r--  1 jar None 12611 Aug  6 14:19 libcmoc-float-ecb.a
-rw-r--r--  1 jar None 12678 Aug  6 14:19 libcmoc-float-usim.a
-rw-r--r--  1 jar None 26283 Aug  6 14:19 libcmoc-std-ecb.a
-rw-r--r--  1 jar None  9998 Aug  6 14:19 libcmoc-std-os9.a
-rw-r--r--  1 jar None 11205 Aug  6 14:19 libcmoc-std-usim.a
-rw-r--r--  1 jar None 16604 Aug  6 14:19 libcmoc-std-vec.a

jar at Win8 /cygdrive/d/Dev/Retro/CoCo/Projects/TestCMOC
$ ls -la /usr/local/bin
total 62686
drwxr-xr-x+ 1 jar None        0 Aug  6 14:19 .
drwxrwx---+ 1 jar None        0 Aug 14  2017 ..
-rwxrwx---+ 1 jar None    27648 Aug 13  2017 aspcud.exe
-rwxrwx---+ 1 jar None  1078272 Aug 13  2017 clasp.exe
-rwxr-xr-x  1 jar None 25878619 Aug  6 14:19 cmoc.exe
-rwxrwx---+ 1 jar None  1024512 Aug 13  2017 cudf2lp.exe
-rwxrwx---+ 1 jar None  1453568 Aug 13  2017 flexlink.exe
-rwxrwx---+ 1 jar None  2261504 Aug 13  2017 gringo.exe
lrwxrwxrwx  1 jar None       24 Aug 14  2017 haxe -> /usr/local/lib/haxe/haxe
lrwxrwxrwx  1 jar None       27 Aug 14  2017 haxelib -> /usr/local/lib/haxe/haxelib
-rwxr-xr-x  1 jar None     6549 Aug  6 14:19 install-coco-boot-loader
-rwxr-xr-x  1 jar None     3987 Aug  6 14:19 intelhex2cocobin
-rwxr-xr-x  1 jar None     2455 Aug  6 14:19 intelhex2srec
-rwxr-xr-x  1 jar None   426590 Aug  6 14:16 lwar.exe
-rwxr-xr-x  1 jar None   604722 Aug  6 14:16 lwasm.exe
-rwxr-xr-x  1 jar None   452605 Aug  6 14:16 lwlink.exe
-rwxr-xr-x  1 jar None   405846 Aug  6 14:16 lwobjdump.exe
-rwxrwx---+ 1 jar None    22496 Aug 13  2017 misc2012.lp
-rwxrwx---+ 1 jar None  3404800 Aug 13  2017 ocaml-env.exe
-rwxrwx---+ 1 jar None  3409408 Aug 13  2017 ocaml-env-win.exe
-rwxrwx---+ 1 jar None 23132884 Aug 13  2017 opam.exe
-rwxrwx---+ 1 jar None     1619 Aug 13  2017 specification.lp
-rwxr-xr-x  1 jar None   544631 Aug  6 14:19 writecocofile.exe


 
________________________________________
From: Coco <coco-bounces at maltedmedia.com> on behalf of Pierre Sarrazin <sarrazip at sarrazip.com>
Sent: Tuesday, August 7, 2018 2:30 AM
To: CoCoList for Color Computer Enthusiasts
Subject: Re: [Coco] CMOC linking error

Hi James,

Dixit James Ross (2018-08-06 20:45):
> jar at Win8 /cygdrive/d/Dev/Retro/CoCo/Projects/TestCMOC
> $ cmoc tst1.c
> lwlink: error: Can't open library: -lcmoc-crt-ecb
>
> Something from the environment variables?  surely deleting Cygwin and
> re-installing is not going to be necessary, is it?  I have a ton of
> other packages and stuff set that would be wiped out.

You could pass --verbose to cmoc to get more details.  In particular,
you should see a line like this:

    Linker command: lwlink --format=decb --output='tst1.bin'
    --script='tst1.link' --map='tst1.map'
    -L/usr/local/share/cmoc/lib -lcmoc-crt-ecb -lcmoc-std-ecb
    -lcmoc-float-ecb 'tst1.o'

The -L option specifies the directory where a bunch of lib*.a should
have been installed. A file named libcmoc-crt-ecb.a should appear there,
as well as libcmoc-std-ecb.a and libcmoc-float-ecb.a.

When you compiled and installed CMOC, did you pass any arguments to
"./configure", "make" or "make install"?

Could there be an old installation of CMOC in the executable path?
The "which cmoc" command would confirm the exact full path of the cmoc
command you are running.

Which versions of CMOC and LWTOOLS have you installed? (The latest CMOC
is 0.1.52. LWTOOLS >= 4.11 is required.)

Home page: http://sarrazip.com/dev/cmoc.html
Manual   : http://sarrazip.com/dev/cmoc-manual.html

--
Pierre Sarrazin <sarrazip @ sarrazip . com>

--
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list