[Ohrrpgce] OPENFILE compile problem on Windows

Ralph Versteegen teeemcee at gmail.com
Wed May 4 19:30:23 PDT 2016


On 5 May 2016 at 05:18, James Paige <Bob at hamsterrepublic.com> wrote:
> Regarding that error from earlier:
>
> fbc -c os_windows.bas -o build\os_windows.o -mt -exx -g -O 2 -arch 686
> C:\Users\James\src\ohr\wip\lumpfile.bi(228) error 4: Duplicated definition
> in 'd
> eclare function OPENFILE(filename as string, open_bits as OPENBits, byref fh
> as
> integer) as integer'
> scons: *** [build\os_windows.o] Error 1
> scons: building terminated because of errors.
>
> I followed your suggestion to add #undef openfile to include_windows_bi in
> config.bi but then I got a different failure:
>
> c:\Users\James\src\ohr\wip>scons
> scons: Reading SConscript files ...
> scons: done reading SConscript files.
> scons: Building targets ...
> g++ -o build\filelayer.o -c -g -Wall -Wno-non-virtual-dtor -O3
> -DFBCVERSION=230
> -m32 -mpreferred-stack-boundary=2 -mno-sse filelayer.cpp
> filelayer.cpp: In function 'int OPENFILE(FBSTRING*, OPENBits, int&)':
> filelayer.cpp:154:74: error: new declaration 'int OPENFILE(FBSTRING*,
> OPENBits,
> int&)'
> filelayer.h:60:6: error: ambiguates old declaration 'int OPENFILE(FBSTRING*,
> OPE
> NBits, int&)'
> scons: *** [build\filelayer.o] Error 1
> scons: building terminated because of errors.

That's a very strange error message, but it turns out it's due to
different calling conventions, stdcall vs cdecl.

It also turns out that Windows builds have been broken for several
days since my backends.bas changes, also due to a stdcall vs cdecl
mismatch.


More information about the Ohrrpgce mailing list