Allegro.cc - Online Community

Allegro.cc Forums » Installation, Setup & Configuration » Compiling CBuild on MinGW32

Credits go to Arthur Kalliokoski and Kitty Cat for helping out!
This thread is locked; no one can reply to it. rss feed Print
Compiling CBuild on MinGW32
Biznaga
Member #3,180
January 2003
avatar

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
Member #2,815
October 2002
avatar

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.

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Arthur Kalliokoski
Second in Command
February 2005
avatar

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

They all watch too much MSNBC... they get ideas.

Kitty Cat
Member #2,815
October 2002
avatar

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).

--
"Do not meddle in the affairs of cats, for they are subtle and will pee on your computer." -- Bruce Graham

Biznaga
Member #3,180
January 2003
avatar

Thanks, Kitty Cat!

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

Go to: