[Coco] CMOC linking error

James Ross jrosslist at outlook.com
Tue Aug 7 04:22:08 EDT 2018


Hi Pierre ... It was something to-do w/ Cygwin paths … I just don't know what.

If I modify readfiles.c in LWLINK just before line #105 --> f = fopen(tf, "rb");

f = fopen("/usr/local/share/cmoc/lib/libcmoc-crt-ecb.a", "rb"); --> FAILS (and stat does not find file either).  

f = fopen("C:\\Cygwin64\\usr\\local\\share\\cmoc\\lib\\libcmoc-crt-ecb.a", "rb"); --> SUCCESS

I thought it might had to do w/ Cygwin being on the C: drive and the test project being on the D: drive but that was NOT it … 

SO … I deleted and re-installed Cygwin. Rebuilt and installed LWASM and CMOC again. 

And now it’s working just like it should! 

jar at Win8 /cygdrive/d/FOS/cmoc-0.1.52
$ cd 'D:\Dev\Retro\CoCo\Projects\TestCMOC'

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'
Exit code from linker command: 0
Number of error messages from linker: 0 <---- yay NO errors. 

jar at Win8 /cygdrive/d/Dev/Retro/CoCo/Projects/TestCMOC
$ ls -la
total 184
drwxrwx---+ 1 jar None      0 Aug  7 02:11 .
drwxrwx---+ 1 jar None      0 Aug  6 00:35 ..
-rwxrwx---+ 1 jar None 161280 Aug  6 16:55 TESTCMOC.DSK
-rw-rw-r--+ 1 jar None   1441 Aug  7 02:11 tst1.bin <----- there it is!! 
-rwxrwx---+ 1 jar None     82 Aug  6 01:00 tst1.c

CMOC is cool, btw. 

Thanks for your help.

James
________________________________________
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