rzvncj / xCHM

xCHM is a cross-platform GPL frontend for CHMLIB (http://www.jedrea.com/chmlib/) written with the wxWidgets framework.
GNU General Public License v2.0
126 stars 25 forks source link

Compiling error with chm_lib.c #34

Open chqzeng opened 5 months ago

chqzeng commented 5 months ago

Hello thank you for this great project! I am very new to compiling projects with make. I try to build this project on my macbook with Apple A2 chip, macos: 14.2.1 (23C71). I tried to installed the prerequest

but when I try to compile this xchm project , it failed with following error:.

1. ./configure, with error

checking for chm_lib.h... no
configure: error: Can't find the CHMLIB header.

2. ./configure --enable-builtin-chmlib && make, with following error:

gcc -DHAVE_CONFIG_H -I. -I..  -I../art -I/usr/local/lib/wx/include/osx_cocoa-unicode-3.2 -I/usr/local/include/wx-3.2 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMAC__ -D__WXOSX__ -D__WXOSX_COCOA__  -g -O2  -MT chm_lib.o -MD -MP -MF .deps/chm_lib.Tpo -c -o chm_lib.o chm_lib.c
chm_lib.c:179:2: error: "Please define the sized types for your platform in chm_lib.c"
#error "Please define the sized types for your platform in chm_lib.c"
 ^
chm_lib.c:185:9: warning: 'memcpy' macro redefined [-Wmacro-redefined]
#define memcpy __builtin_memcpy
        ^
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_string.h:62:9: note: previous definition is here
#define memcpy(dest, ...) \
        ^
chm_lib.c:260:29: error: unknown type name 'Int32'
                            Int32 *dest)
                            ^
chm_lib.c:272:30: error: unknown type name 'UInt32'
                             UInt32 *dest)
                             ^
chm_lib.c:284:29: error: unknown type name 'Int64'
                            Int64 *dest)
                            ^
chm_lib.c:286:5: error: use of undeclared identifier 'Int64'
    Int64 temp;
    ^
chm_lib.c:290:5: error: use of undeclared identifier 'temp'
    temp=0;
    ^
chm_lib.c:293:9: error: use of undeclared identifier 'temp'
        temp <<= 8;
        ^
chm_lib.c:294:9: error: use of undeclared identifier 'temp'
        temp |= (*pData)[i-1];
        ^
chm_lib.c:296:13: error: use of undeclared identifier 'temp'; did you mean 'bcmp'?
    *dest = temp;
            ^~~~

3. I tried to modified the above error file src/chm_lib.c

remove the two blocks of data type definition for 32bit machines. the make and make install can work, but the program xchm has no repsonse.

any clue?

thanks, CZ

rzvncj commented 5 months ago

It's been a while since I've had access to a macOS machine, but I do know that the MacPorts build is supposed to work: https://ports.macports.org/port/xchm/

Maybe check out what they do there and adapt the steps for the latest version of xCHM?