pelrun / dsk2cdt2disc

Convert CPC DSK files to a tape image that will rebuild the disc when loaded.
13 stars 3 forks source link

Build failure, '_binary_rsx_bin_start' undeclared #5

Closed cpcitor closed 7 years ago

cpcitor commented 7 years ago

Hello.

Summary

Building dsk2cdt2disc fails with several undeclared identifiers.

Observed on Ubuntu 16.04 AMD64.

First error :

./dsk2cdt-src/loader.h:43:28: error: '_binary_rsx_bin_start' undeclared (first use in this function)

How to reproduce

Run the attached straightforward script build_dsk2cdt2disc.sh.txt

Expected

Produces something executable, no error.

Observed

(... lines showing fetching dependencies and launching compilation ...)
make 2CDT_PATH=../../2cdt EXOMIZER_PATH=../../exomizer209
+ make 2CDT_PATH=../../2cdt EXOMIZER_PATH=../../exomizer209
Compiling ./dsk2cdt-src/dsk2cdt.c
In file included from ./dsk2cdt-src/dsk2cdt.c:16:0:
./dsk2cdt-src/dsk2cdt.c: In function 'main':
./dsk2cdt-src/loader.h:43:28: error: '_binary_rsx_bin_start' undeclared (first use in this function)
 #define rsx_bin_start      _binary_rsx_bin_start
                            ^
./dsk2cdt-src/dsk2cdt.c:194:28: note: in expansion of macro 'rsx_bin_start'
     CDT_add_file(pCDTFile, rsx_bin_start, (size_t)rsx_bin_size, BAUDRATE_NORMAL, &header);
                            ^
./dsk2cdt-src/loader.h:43:28: note: each undeclared identifier is reported only once for each function it appears in
 #define rsx_bin_start      _binary_rsx_bin_start
                            ^
./dsk2cdt-src/dsk2cdt.c:194:28: note: in expansion of macro 'rsx_bin_start'
     CDT_add_file(pCDTFile, rsx_bin_start, (size_t)rsx_bin_size, BAUDRATE_NORMAL, &header);
                            ^
./dsk2cdt-src/loader.h:45:28: error: '_binary_rsx_bin_size' undeclared (first use in this function)
 #define rsx_bin_size       _binary_rsx_bin_size
                            ^
./dsk2cdt-src/dsk2cdt.c:194:51: note: in expansion of macro 'rsx_bin_size'
     CDT_add_file(pCDTFile, rsx_bin_start, (size_t)rsx_bin_size, BAUDRATE_NORMAL, &header);
                                                   ^
./dsk2cdt-src/dsk2cdt.c:122:3: warning: ignoring return value of 'fread', declared with attribute warn_unused_result [-Wunused-result]
   fread(dib, 0x100, 1, fin);
   ^
./dsk2cdt-src/dsk2cdt.c:144:7: warning: ignoring return value of 'fread', declared with attribute warn_unused_result [-Wunused-result]
       fread(track, tracksize, 1, fin);
       ^
Makefile:31: recipe for target 'dsk2cdt.o' failed
make: *** [dsk2cdt.o] Error 1

Additional information

Script content:

#!/bin/bash

set -euxv
export LC_ALL=C

rm -rf temp_build_area
mkdir temp_build_area
cd temp_build_area

wget -S http://cpctech.cpc-live.com/download/2cdt.zip || curl -O http://cpctech.cpc-live.com/download/2cdt.zip
unzip 2cdt.zip

wget -S http://csdb.dk/getinternalfile.php/141751/exomizer209.zip || curl -O http://csdb.dk/getinternalfile.php/141751/exomizer209.zip
( mkdir exomizer209 ; cd exomizer209 ; unzip ../exomizer209.zip ; )

git clone https://github.com/pelrun/dsk2cdt2disc

cd dsk2cdt2disc/src/

make 2CDT_PATH=../../2cdt EXOMIZER_PATH=../../exomizer209
cpcitor commented 7 years ago

Hmm, that first try is wrong. Testing another fix.

cpcitor commented 7 years ago

The program actually proceeded to load itself, load machine code, load disk data and write it to actual disk. So, the better fix https://github.com/pelrun/dsk2cdt2disc/pull/10 definitely works!

pelrun commented 7 years ago

Latest commit completely reworks how the binary blobs are included, and the exported symbols are explicitly defined and sensible.