Development > Newbie Coding

compile using MinGW

<< < (2/6) > >>

Muton:
./configure --prefix= --exec-prefix=
........
checking for jpeglib.h... yes
checking for jpeg_CreateDecompress in -ljpeg... yes
configure: error: For current build options, pkg-config is required. Did you maybe forget to run aclocal with the current include path?

--------------------------------

ufomodel.exe
will cry for libpng12.dll but there is only libpng12-0.dll in contrib/dlls

The problem is libpng12.dll.a referring to libpng12.dll instead of libpng12-0.dll
I've recompiled png and now its working
C::B is using libpng3 (older) btw because of png instead of png12
What about version 1.4??

Mattn:
i'm using 1.4 on linux - so feel free to update the c::b script and/or package

Muton:
I was able to "make" under mingw

I had to edit
mingw/bin/sdl-config
modify line 3 to
prefix=

and after "configure" modify
ufoai/config.h
each line
#undef HAVE_VORBIS_CODEC_H
#undef HAVE_XVID_H
#undef HAVE_THEORA_THEORA_H
to
#define HAVE_VORBIS_CODEC_H
#define HAVE_XVID_H
#define HAVE_THEORA_THEORA_H
to fix cl_cinematic_ogm.c "No ogm support compiled into the binary"

if i configure some CFLAGS then the value is NOT appended (Makefile)
CFLAGS=-v
instead of
CFLAGS=-g -O2 -v

Windows 2000
I had to edit (WINVER 0x500)
platform_specific.mk
or
config.h
to compile the game for Windows 2000
but it will fail during net.c
btw no problem under C::B

--- Code: ---COLLECT_GCC_OPTIONS='-g' '-O2' '-v' '-DUFO_REVISION="27318:30088M"' '-DGETTEXT_STATIC' '-DWINVER=0x500' '-DSHARED_EXT="dll"' '-DHAVE_CONFIG_H' '-DUSE_SIGNALS=1' '-Wall' '-pipe' '-Winline' '-Wcast-qual' '-Wcast-align' '-Wdeclaration-after-statement' '-Wmissing-prototypes' '-Wmissing-declarations' '-std=c99' '-ggdb' '-O0' '-DDEBUG' '-fno-inline' '-DLUA_USE_APICHECK' '-DCOMPILE_UFO' '-IV:/str/MinGW/include/SDL' '-D_GNU_SOURCE=1' '-Dmain=SDL_main' '-o' 'debug-mingw32-i386/client/ports/windows/win_main.o' '-c' '-MD' '-MT' 'debug-mingw32-i386/client/ports/windows/win_main.o' '-MP' '-mtune=i386'
 * [RC ] src/ports/windows/ufo.rc
 * [UFO] ... linking   (-LV:/str/MinGW/lib -lvorbis -lm -logg       -lz  -L/usr/local/lib -lcurl -L/home/dast/src/win32 -lwinmm -lws2_32 -lz -lws2_32 -ljpeg  -LV:/str/MinGW/lib -lpng12   -L/lib -lmingw32 -lSDLmain -lSDL -mwindows -lSDL_image  -lSDL_mixer  -lSDL_ttf  -logg  -lxvidcore  -LV:/str/MinGW/lib -ltheora -logg   -lintl -lxvidcore  -lws2_32 -lwinmm -lopengl32 -L/lib -lmingw32 -lSDLmain -lSDL -mwindows)
debug-mingw32-i386/client/common/net.o: In function `NET_Connect':
V:\str\MinGW\ufoai/src/common/net.c:630: undefined reference to `WspiapiGetAddrInfo@16'
V:\str\MinGW\ufoai/src/common/net.c:639: undefined reference to `WspiapiFreeAddrInfo@4'
V:\str\MinGW\ufoai/src/common/net.c:645: undefined reference to `WspiapiFreeAddrInfo@4'
debug-mingw32-i386/client/common/net.o: In function `NET_StreamPeerToName':
V:\str\MinGW\ufoai/src/common/net.c:822: undefined reference to `WspiapiGetNameInfo@28'
debug-mingw32-i386/client/common/net.o: In function `SV_Start':
V:\str\MinGW\ufoai/src/common/net.c:927: undefined reference to `WspiapiGetAddrInfo@16'
V:\str\MinGW\ufoai/src/common/net.c:941: undefined reference to `WspiapiFreeAddrInfo@4'
debug-mingw32-i386/client/common/net.o: In function `NET_DatagramSocketNew':
V:\str\MinGW\ufoai/src/common/net.c:1048: undefined reference to `WspiapiGetAddrInfo@16'
V:\str\MinGW\ufoai/src/common/net.c:1059: undefined reference to `WspiapiFreeAddrInfo@4'
debug-mingw32-i386/client/common/net.o: In function `NET_SockaddrToStrings':
V:\str\MinGW\ufoai/src/common/net.c:1146: undefined reference to `WspiapiGetNameInfo@28'
debug-mingw32-i386/client/common/net.o:net.c:(.data+0x8): undefined reference to `WspiapiLegacyGetAddrInfo@16'
debug-mingw32-i386/client/common/net.o:net.c:(.data+0x10): undefined reference to `WspiapiLegacyGetNameInfo@28'
debug-mingw32-i386/client/common/net.o:net.c:(.data+0x18): undefined reference to `WspiapiLegacyFreeAddrInfo@4'
debug-mingw32-i386/client/common/net.o:net.c:(.rdata+0x834): undefined reference to `WspiapiLegacyGetAddrInfo@16'
debug-mingw32-i386/client/common/net.o:net.c:(.rdata+0x83c): undefined reference to `WspiapiLegacyGetNameInfo@28'
debug-mingw32-i386/client/common/net.o:net.c:(.rdata+0x844): undefined reference to `WspiapiLegacyFreeAddrInfo@4'
collect2: ld returned 1 exit status
make: *** [ufo] Error 1

--- End code ---

Mattn:
thanks for sharing this info - i will give it a try later with cross-compiling, too

Muton:
On Windows there is a problem related to stdout
all output is redirected to a text file called stdout/stderr.txt
and no output on the console
Very annoying!
How can I get console output instead of stdout.txt and stderr.txt
http://sdl.beuc.net/sdl.wiki/FAQ_Console

ufo2map and ufomodel is affected if compiled under Mingw
ufo2map is working well if compiled using C::B
ufomodel will use txt files even when C::B

I've focused on ufo2map first
conclusion
Linking:
$(filter-out -lmingw32 -lSDLmain -mwindows,$(TOOLS_LIBS)) $(filter-out -lmingw32 -lSDLmain -mwindows,$(SDL_LIBS))
build .o
$(filter-out -Dmain=SDL_main,$(SDL_CFLAGS))

But i dont know how to merge this into tools.mk, except to use a new var (this will effect any OS_build)
# Say how to link the exe
$(UFO2MAP_TARGET): $(UFO2MAP_OBJS)
   @echo " * [MAP] ... linking $(LNKFLAGS) ( $(filter-out -lmingw32 -lSDLmain -mwindows,$(TOOLS_LIBS)) $(filter-out -lmingw32 -lSDLmain -mwindows,$(SDL_LIBS)) )"; \
      $(CC) $(LDFLAGS) -o $@ $(UFO2MAP_OBJS) $(filter-out -lmingw32 -lSDLmain -mwindows,$(TOOLS_LIBS)) $(filter-out -lmingw32 -lSDLmain -mwindows,$(SDL_LIBS)) $(LNKFLAGS)
....
# Say how to build .o files from .c files for this module
# -ffloat-store option to ensure that maps are the same on every plattform
# store the float values in buffers, not in cpu registers, maybe slower
$(BUILDDIR)/tools/ufo2map/%.o: $(SRCDIR)/%.c
   @echo " * [MAP] $<"; \
      $(CC) $(UFO2MAP_CFLAGS) $(filter-out -Dmain=SDL_main,$(SDL_CFLAGS)) -o $@ -c $< $(CFLAGS_M_OPTS)

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version