Compiling CBuild on MinGW32
Biznaga

Can CBuild (from APEG 1.2.1) be compiled on MinGW?

I tried both the batch file and manual installation (using MSYS) but I got the following linker error message:

cbuild.c: undefined reference to `mkstemp'

What am I missing?

$ gcc -v
Reading specs from c:/sdk/mingw/3.1/bin/../lib/gcc-lib/mingw32/3.2.3/specs
Configured with: ../gcc/configure --with-gcc --with-gnu-ld --with-gnu-as --host=mingw32 --target=mingw32 --prefix=/mingw --enable-threads --disable-nls --enable-languages=c++,f77,objc --disable-win32-registry --disable-shared --enable-sjlj-exceptions
Thread model: win32
gcc version 3.2.3 (mingw special 20030504-1)

Kitty Cat

It seems neither Windows nor MinGW have mkstemp. Could you try the attached version? It should work, hopefully. If it does, I'll update the archives.

EDIT:
There was another problem related to the Windows version. If you downloaded the attachment before, please get it again.

Arthur Kalliokoski

Mingw has tmpnam(). Maybe you could substitute and strcat the result?

Kitty Cat

I switched to tmpfile() + fileno(), which is an all-around cleaner solution to what I needed. :) Windows seems to have it (even though MSVC has it deprecated in favor of tmpfile_s, and I need to define fileno to _fileno :P).

Biznaga

Thanks, Kitty Cat!

It compiled fine. I even compiled APEG with it. ;D

Thread #581240. Printed from Allegro.cc