W
walkeraj
I'm trying to compile an open source game called IVAN
[ivan.sourceforge.net], and I'm able to compile it from a makefile, but
not from an IDE. I have attempted to recreate the way the makefile
compiles the project as closely as possible, yet I'm getting odd
linking errors. I think I've traced it to some kind of problem with
the SDL libraries it uses, yet I can't explain why it will compile from
the makefile and not from the IDE. I have made sure that the ide knows
all of the include paths, and is linking to all of the libraries in the
makefile (and then some). Here is the makefile:
=======================================
# Iter Vehemens ad Necem makefile for MinGW environment
# Copyrights (C) Timo Kiviluoto / IvanDev 2002-2004
CC = g++ -o
FeLibDIR = FeLib
FeLibGCH =
#FeLibGCH = $(FeLibDIR)/Include/allocate.h.gch
$(FeLibDIR)/Include/bitmap.h.gch $(FeLibDIR)/Include/config.h.gch
$(FeLibDIR)/Include/error.h.gch $(FeLibDIR)/Include/fearray.h.gch
$(FeLibDIR)/Include/feio.h.gch $(FeLibDIR)/Include/felibdef.h.gch
$(FeLibDIR)/Include/felist.h.gch $(FeLibDIR)/Include/feloops.h.gch
$(FeLibDIR)/Include/femath.h.gch $(FeLibDIR)/Include/festring.h.gch
$(FeLibDIR)/Include/fetime.h.gch $(FeLibDIR)/Include/graphics.h.gch
$(FeLibDIR)/Include/hscore.h.gch $(FeLibDIR)/Include/rawbit.h.gch
$(FeLibDIR)/Include/rect.h.gch $(FeLibDIR)/Include/save.h.gch
$(FeLibDIR)/Include/v2.h.gch $(FeLibDIR)/Include/whandler.h.gch
FeLibOBJ = $(FeLibDIR)/Source/bitmap.o $(FeLibDIR)/Source/config.o
$(FeLibDIR)/Source/error.o $(FeLibDIR)/Source/feio.o
$(FeLibDIR)/Source/felist.o $(FeLibDIR)/Source/femain.o
$(FeLibDIR)/Source/femath.o $(FeLibDIR)/Source/festring.o
$(FeLibDIR)/Source/fetime.o $(FeLibDIR)/Source/graphics.o
$(FeLibDIR)/Source/hscore.o $(FeLibDIR)/Source/rawbit.o
$(FeLibDIR)/Source/save.o $(FeLibDIR)/Source/whandler.o
IVANDIR = Main
IVANBIN = IVAN.exe
IVANGCH =
#IVANGCH = $(IVANDIR)/Include/action.h.gch
$(IVANDIR)/Include/actions.h.gch $(IVANDIR)/Include/area.h.gch
$(IVANDIR)/Include/bodypart.h.gch $(IVANDIR)/Include/char.h.gch
$(IVANDIR)/Include/command.h.gch $(IVANDIR)/Include/cont.h.gch
$(IVANDIR)/Include/database.h.gch $(IVANDIR)/Include/dungeon.h.gch
$(IVANDIR)/Include/entity.h.gch $(IVANDIR)/Include/fluid.h.gch
$(IVANDIR)/Include/game.h.gch $(IVANDIR)/Include/gear.h.gch
$(IVANDIR)/Include/god.h.gch $(IVANDIR)/Include/gods.h.gch
$(IVANDIR)/Include/human.h.gch $(IVANDIR)/Include/iconf.h.gch
$(IVANDIR)/Include/id.h.gch $(IVANDIR)/Include/igraph.h.gch
$(IVANDIR)/Include/iloops.h.gch $(IVANDIR)/Include/item.h.gch
$(IVANDIR)/Include/level.h.gch $(IVANDIR)/Include/lsquare.h.gch
$(IVANDIR)/Include/lterra.h.gch $(IVANDIR)/Include/lterras.h.gch
$(IVANDIR)/Include/materia.h.gch $(IVANDIR)/Include/materias.h.gch
$(IVANDIR)/Include/message.h.gch $(IVANDIR)/Include/miscitem.h.gch
$(IVANDIR)/Include/nonhuman.h.gch $(IVANDIR)/Include/object.h.gch
$(IVANDIR)/Include/pool.h.gch $(IVANDIR)/Include/proto.h.gch
$(IVANDIR)/Include/rain.h.gch $(IVANDIR)/Include/room.h.gch
$(IVANDIR)/Include/rooms.h.gch $(IVANDIR)/Include/script.h.gch
$(IVANDIR)/Include/smoke.h.gch $(IVANDIR)/Include/square.h.gch
$(IVANDIR)/Include/stack.h.gch $(IVANDIR)/Include/team.h.gch
$(IVANDIR)/Include/terra.h.gch $(IVANDIR)/Include/trap.h.gch
$(IVANDIR)/Include/traps.h.gch $(IVANDIR)/Include/worldmap.h.gch
$(IVANDIR)/Include/wskill.h.gch $(IVANDIR)/Include/wterra.h.gch
$(IVANDIR)/Include/wterras.h.gch
IVANOBJ = $(IVANDIR)/Source/actset.o $(IVANDIR)/Source/areaset.o
$(IVANDIR)/Source/charset.o $(IVANDIR)/Source/charsset.o
$(IVANDIR)/Source/command.o $(IVANDIR)/Source/coreset.o
$(IVANDIR)/Source/dataset.o $(IVANDIR)/Source/dungeon.o
$(IVANDIR)/Source/game.o $(IVANDIR)/Source/godset.o
$(IVANDIR)/Source/iconf.o $(IVANDIR)/Source/id.o
$(IVANDIR)/Source/igraph.o $(IVANDIR)/Source/itemset.o
$(IVANDIR)/Source/levelset.o $(IVANDIR)/Source/main.o
$(IVANDIR)/Source/materset.o $(IVANDIR)/Source/message.o
$(IVANDIR)/Source/object.o $(IVANDIR)/Source/roomset.o
$(IVANDIR)/Source/script.o $(IVANDIR)/Source/slotset.o
$(IVANDIR)/Source/trapset.o $(IVANDIR)/Source/wmapset.o
$(IVANDIR)/Source/wskill.o
#FLAGS = -DGCC -DUSE_SDL -DWIZARD -IInclude -I$(FeLibDIR)/Include -pg
-ffast-math -W -Wall -pedantic -march=athlon-xp -mrtd
-maccumulate-outgoing-args -mwindows
#FLAGS = -DGCC -DUSE_SDL -DWIZARD -IInclude -I$(FeLibDIR)/Include -pg
-O3 -ffast-math -march=athlon-xp -mwindows
FLAGS = -DGCC -DUSE_SDL -DWIZARD -D_WIN32 -IInclude
-I$(FeLibDIR)/Include -O3 -ffast-math -s -W -Wall -pedantic -mwindows
LIBS = -lmingw32 -lSDLmain -lSDL
all: $(IVANBIN)
$(FeLibGCH) : %.h.gch : %.h
@echo Compiling $@...
@$(CC) $@ -c $< $(FLAGS)
$(FeLibOBJ) : %.o : %.cpp
@echo Compiling $@...
@$(CC) $@ -c $< $(FLAGS)
$(IVANGCH) : %.h.gch : %.h
@echo Compiling $@...
@$(CC) $@ -c $< $(FLAGS) -I$(IVANDIR)/Include
$(IVANOBJ) : %.o : %.cpp
@echo Compiling $@...
@$(CC) $@ -c $< $(FLAGS) -I$(IVANDIR)/Include
$(IVANBIN) : $(FeLibGCH) $(FeLibOBJ) $(IVANGCH) $(IVANOBJ)
@echo Compiling $(IVANBIN)...
@$(CC) $(IVANBIN) $(FeLibOBJ) $(IVANOBJ) $(FLAGS) $(LIBS)
=======================================
And here is my build log (note, the IDE divides the FeLib and main
program into separate projects):
=======================================
-------------- Build: Win32 Release in FeLib ---------------
Target is up to date.
-------------- Build: Win32 Release in Main ---------------
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\charset.cpp -o Main\Release\Main\Source\charset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\charsset.cpp -o Main\Release\Main\Source\charsset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\command.cpp -o Main\Release\Main\Source\command.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\coreset.cpp -o Main\Release\Main\Source\coreset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\dataset.cpp -o Main\Release\Main\Source\dataset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\dungeon.cpp -o Main\Release\Main\Source\dungeon.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\game.cpp -o Main\Release\Main\Source\game.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\godset.cpp -o Main\Release\Main\Source\godset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\iconf.cpp -o Main\Release\Main\Source\iconf.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\id.cpp -o Main\Release\Main\Source\id.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\igraph.cpp -o Main\Release\Main\Source\igraph.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\itemset.cpp -o Main\Release\Main\Source\itemset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\levelset.cpp -o Main\Release\Main\Source\levelset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\main.cpp -o Main\Release\Main\Source\main.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\materset.cpp -o Main\Release\Main\Source\materset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\message.cpp -o Main\Release\Main\Source\message.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\object.cpp -o Main\Release\Main\Source\object.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\roomset.cpp -o Main\Release\Main\Source\roomset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\script.cpp -o Main\Release\Main\Source\script.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\slotset.cpp -o Main\Release\Main\Source\slotset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\trapset.cpp -o Main\Release\Main\Source\trapset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\wmapset.cpp -o Main\Release\Main\Source\wmapset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\wskill.cpp -o Main\Release\Main\Source\wskill.o
mingw32-g++.exe -LFeLib\Release -LC:\MinGW\lib -o
C:\Projects\ivan-0.50\Main\Release\Main.exe
Main\Release\Main\Source\actset.o Main\Release\Main\Source\areaset.o
Main\Release\Main\Source\charset.o Main\Release\Main\Source\charsset.o
Main\Release\Main\Source\command.o Main\Release\Main\Source\coreset.o
Main\Release\Main\Source\dataset.o Main\Release\Main\Source\dungeon.o
Main\Release\Main\Source\game.o Main\Release\Main\Source\godset.o
Main\Release\Main\Source\iconf.o Main\Release\Main\Source\id.o
Main\Release\Main\Source\igraph.o Main\Release\Main\Source\itemset.o
Main\Release\Main\Source\levelset.o Main\Release\Main\Source\main.o
Main\Release\Main\Source\materset.o Main\Release\Main\Source\message.o
Main\Release\Main\Source\object.o Main\Release\Main\Source\roomset.o
Main\Release\Main\Source\script.o Main\Release\Main\Source\slotset.o
Main\Release\Main\Source\trapset.o Main\Release\Main\Source\wmapset.o
Main\Release\Main\Source\wskill.o Main\Release\Main\Resource\Ivan.res
..\..\MinGW\lib\libmingw32.a ..\..\MinGW\lib\libSDLmain.a
...\..\MinGW\lib\libSDL.a FeLib\Release\libFeLib.a
...\..\MinGW\lib\libwinmm.a -mwindows
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function `DX5_Available':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:487:
undefined reference to `IID_IDirectDrawSurface3'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function `DX5_VideoInit':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:915:
undefined reference to `IID_IDirectDraw2'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_AllocDDSurface':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:1672:
undefined reference to `IID_IDirectDrawSurface3'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_SetVideoMode':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:1320:
undefined reference to `IID_IDirectDrawSurface3'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_SetGammaRamp':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:2268:
undefined reference to `IID_IDirectDrawGammaControl'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_GetGammaRamp':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:2314:
undefined reference to `IID_IDirectDrawGammaControl'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function `DX5_Available':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:460:
undefined reference to `GUID_XAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:462:
undefined reference to `GUID_YAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:465:
undefined reference to `GUID_ZAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:466:
undefined reference to `GUID_RxAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:471:
undefined reference to `GUID_RyAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:472:
undefined reference to `GUID_RzAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:472:
undefined reference to `GUID_Slider'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:472:
undefined reference to `GUID_Slider'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:474:
undefined reference to `GUID_POV'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:474:
undefined reference to `GUID_POV'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:481:
undefined reference to `GUID_POV'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:481:
undefined reference to `GUID_POV'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_CreateDevice':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:532:
undefined reference to `GUID_XAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:533:
undefined reference to `GUID_YAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:537:
undefined reference to `GUID_ZAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:577:
undefined reference to `GUID_Key'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:579:
undefined reference to `GUID_Key'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:582:
undefined reference to `GUID_Key'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:582:
undefined reference to `GUID_Key'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:588:
undefined reference to `GUID_Key'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o):/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:589:
more undefined references to `GUID_Key' follow
...\..\MinGW\lib\libSDL.a(SDL_dx5events.o): In function
`DX5_CreateWindow':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5events.c:177:
undefined reference to `IID_IDirectInputDevice2A'
...\..\MinGW\lib\libSDL.a(SDL_dx5events.o): In function
`GetTopLevelParent':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5events.c:72:
undefined reference to `GUID_SysKeyboard'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5events.c:76:
undefined reference to `GUID_SysMouse'
...\..\MinGW\lib\libSDL.a(SDL_dx5yuv.o): In function
`DX5_CreateYUVOverlay':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5yuv.c:86:
undefined reference to `IID_IDirectDrawSurface3'
FeLib\Release\libFeLib.a(graphics.o):graphics.cpp
.text+0xff):
undefined reference to `SDL_RWFromFile'
FeLib\Release\libFeLib.a(graphics.o):graphics.cpp
.text+0x110):
undefined reference to `SDL_LoadBMP_RW'
collect2: ld returned 1 exit status
=======================================
As you can see there aren't any errors until linking, yet I cannot
identify where these errors are coming from. It LOOKS like some
library or another isn't being included, but no extra libraries are
listed in the makefile, which compiles just fine. You can even see
that I attempted to fix some of the errors by including libwinmm.a, but
that didn't solve all of them, and I've decided to ask for help rather
than attempting to include random libraries without any direction
[ivan.sourceforge.net], and I'm able to compile it from a makefile, but
not from an IDE. I have attempted to recreate the way the makefile
compiles the project as closely as possible, yet I'm getting odd
linking errors. I think I've traced it to some kind of problem with
the SDL libraries it uses, yet I can't explain why it will compile from
the makefile and not from the IDE. I have made sure that the ide knows
all of the include paths, and is linking to all of the libraries in the
makefile (and then some). Here is the makefile:
=======================================
# Iter Vehemens ad Necem makefile for MinGW environment
# Copyrights (C) Timo Kiviluoto / IvanDev 2002-2004
CC = g++ -o
FeLibDIR = FeLib
FeLibGCH =
#FeLibGCH = $(FeLibDIR)/Include/allocate.h.gch
$(FeLibDIR)/Include/bitmap.h.gch $(FeLibDIR)/Include/config.h.gch
$(FeLibDIR)/Include/error.h.gch $(FeLibDIR)/Include/fearray.h.gch
$(FeLibDIR)/Include/feio.h.gch $(FeLibDIR)/Include/felibdef.h.gch
$(FeLibDIR)/Include/felist.h.gch $(FeLibDIR)/Include/feloops.h.gch
$(FeLibDIR)/Include/femath.h.gch $(FeLibDIR)/Include/festring.h.gch
$(FeLibDIR)/Include/fetime.h.gch $(FeLibDIR)/Include/graphics.h.gch
$(FeLibDIR)/Include/hscore.h.gch $(FeLibDIR)/Include/rawbit.h.gch
$(FeLibDIR)/Include/rect.h.gch $(FeLibDIR)/Include/save.h.gch
$(FeLibDIR)/Include/v2.h.gch $(FeLibDIR)/Include/whandler.h.gch
FeLibOBJ = $(FeLibDIR)/Source/bitmap.o $(FeLibDIR)/Source/config.o
$(FeLibDIR)/Source/error.o $(FeLibDIR)/Source/feio.o
$(FeLibDIR)/Source/felist.o $(FeLibDIR)/Source/femain.o
$(FeLibDIR)/Source/femath.o $(FeLibDIR)/Source/festring.o
$(FeLibDIR)/Source/fetime.o $(FeLibDIR)/Source/graphics.o
$(FeLibDIR)/Source/hscore.o $(FeLibDIR)/Source/rawbit.o
$(FeLibDIR)/Source/save.o $(FeLibDIR)/Source/whandler.o
IVANDIR = Main
IVANBIN = IVAN.exe
IVANGCH =
#IVANGCH = $(IVANDIR)/Include/action.h.gch
$(IVANDIR)/Include/actions.h.gch $(IVANDIR)/Include/area.h.gch
$(IVANDIR)/Include/bodypart.h.gch $(IVANDIR)/Include/char.h.gch
$(IVANDIR)/Include/command.h.gch $(IVANDIR)/Include/cont.h.gch
$(IVANDIR)/Include/database.h.gch $(IVANDIR)/Include/dungeon.h.gch
$(IVANDIR)/Include/entity.h.gch $(IVANDIR)/Include/fluid.h.gch
$(IVANDIR)/Include/game.h.gch $(IVANDIR)/Include/gear.h.gch
$(IVANDIR)/Include/god.h.gch $(IVANDIR)/Include/gods.h.gch
$(IVANDIR)/Include/human.h.gch $(IVANDIR)/Include/iconf.h.gch
$(IVANDIR)/Include/id.h.gch $(IVANDIR)/Include/igraph.h.gch
$(IVANDIR)/Include/iloops.h.gch $(IVANDIR)/Include/item.h.gch
$(IVANDIR)/Include/level.h.gch $(IVANDIR)/Include/lsquare.h.gch
$(IVANDIR)/Include/lterra.h.gch $(IVANDIR)/Include/lterras.h.gch
$(IVANDIR)/Include/materia.h.gch $(IVANDIR)/Include/materias.h.gch
$(IVANDIR)/Include/message.h.gch $(IVANDIR)/Include/miscitem.h.gch
$(IVANDIR)/Include/nonhuman.h.gch $(IVANDIR)/Include/object.h.gch
$(IVANDIR)/Include/pool.h.gch $(IVANDIR)/Include/proto.h.gch
$(IVANDIR)/Include/rain.h.gch $(IVANDIR)/Include/room.h.gch
$(IVANDIR)/Include/rooms.h.gch $(IVANDIR)/Include/script.h.gch
$(IVANDIR)/Include/smoke.h.gch $(IVANDIR)/Include/square.h.gch
$(IVANDIR)/Include/stack.h.gch $(IVANDIR)/Include/team.h.gch
$(IVANDIR)/Include/terra.h.gch $(IVANDIR)/Include/trap.h.gch
$(IVANDIR)/Include/traps.h.gch $(IVANDIR)/Include/worldmap.h.gch
$(IVANDIR)/Include/wskill.h.gch $(IVANDIR)/Include/wterra.h.gch
$(IVANDIR)/Include/wterras.h.gch
IVANOBJ = $(IVANDIR)/Source/actset.o $(IVANDIR)/Source/areaset.o
$(IVANDIR)/Source/charset.o $(IVANDIR)/Source/charsset.o
$(IVANDIR)/Source/command.o $(IVANDIR)/Source/coreset.o
$(IVANDIR)/Source/dataset.o $(IVANDIR)/Source/dungeon.o
$(IVANDIR)/Source/game.o $(IVANDIR)/Source/godset.o
$(IVANDIR)/Source/iconf.o $(IVANDIR)/Source/id.o
$(IVANDIR)/Source/igraph.o $(IVANDIR)/Source/itemset.o
$(IVANDIR)/Source/levelset.o $(IVANDIR)/Source/main.o
$(IVANDIR)/Source/materset.o $(IVANDIR)/Source/message.o
$(IVANDIR)/Source/object.o $(IVANDIR)/Source/roomset.o
$(IVANDIR)/Source/script.o $(IVANDIR)/Source/slotset.o
$(IVANDIR)/Source/trapset.o $(IVANDIR)/Source/wmapset.o
$(IVANDIR)/Source/wskill.o
#FLAGS = -DGCC -DUSE_SDL -DWIZARD -IInclude -I$(FeLibDIR)/Include -pg
-ffast-math -W -Wall -pedantic -march=athlon-xp -mrtd
-maccumulate-outgoing-args -mwindows
#FLAGS = -DGCC -DUSE_SDL -DWIZARD -IInclude -I$(FeLibDIR)/Include -pg
-O3 -ffast-math -march=athlon-xp -mwindows
FLAGS = -DGCC -DUSE_SDL -DWIZARD -D_WIN32 -IInclude
-I$(FeLibDIR)/Include -O3 -ffast-math -s -W -Wall -pedantic -mwindows
LIBS = -lmingw32 -lSDLmain -lSDL
all: $(IVANBIN)
$(FeLibGCH) : %.h.gch : %.h
@echo Compiling $@...
@$(CC) $@ -c $< $(FLAGS)
$(FeLibOBJ) : %.o : %.cpp
@echo Compiling $@...
@$(CC) $@ -c $< $(FLAGS)
$(IVANGCH) : %.h.gch : %.h
@echo Compiling $@...
@$(CC) $@ -c $< $(FLAGS) -I$(IVANDIR)/Include
$(IVANOBJ) : %.o : %.cpp
@echo Compiling $@...
@$(CC) $@ -c $< $(FLAGS) -I$(IVANDIR)/Include
$(IVANBIN) : $(FeLibGCH) $(FeLibOBJ) $(IVANGCH) $(IVANOBJ)
@echo Compiling $(IVANBIN)...
@$(CC) $(IVANBIN) $(FeLibOBJ) $(IVANOBJ) $(FLAGS) $(LIBS)
=======================================
And here is my build log (note, the IDE divides the FeLib and main
program into separate projects):
=======================================
-------------- Build: Win32 Release in FeLib ---------------
Target is up to date.
-------------- Build: Win32 Release in Main ---------------
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\charset.cpp -o Main\Release\Main\Source\charset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\charsset.cpp -o Main\Release\Main\Source\charsset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\command.cpp -o Main\Release\Main\Source\command.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\coreset.cpp -o Main\Release\Main\Source\coreset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\dataset.cpp -o Main\Release\Main\Source\dataset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\dungeon.cpp -o Main\Release\Main\Source\dungeon.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\game.cpp -o Main\Release\Main\Source\game.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\godset.cpp -o Main\Release\Main\Source\godset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\iconf.cpp -o Main\Release\Main\Source\iconf.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\id.cpp -o Main\Release\Main\Source\id.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\igraph.cpp -o Main\Release\Main\Source\igraph.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\itemset.cpp -o Main\Release\Main\Source\itemset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\levelset.cpp -o Main\Release\Main\Source\levelset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\main.cpp -o Main\Release\Main\Source\main.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\materset.cpp -o Main\Release\Main\Source\materset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\message.cpp -o Main\Release\Main\Source\message.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\object.cpp -o Main\Release\Main\Source\object.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\roomset.cpp -o Main\Release\Main\Source\roomset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\script.cpp -o Main\Release\Main\Source\script.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\slotset.cpp -o Main\Release\Main\Source\slotset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\trapset.cpp -o Main\Release\Main\Source\trapset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\wmapset.cpp -o Main\Release\Main\Source\wmapset.o
mingw32-g++.exe -O3 -finline-functions -IInclude -IFeLib/Include
-ffast-math -s -mwindows -DGCC -DUSE_SDL -DWIZARD -D_WIN32
-IMain\Include -IMain\Include -IFeLib\Include -IC:\MinGW\include -c
..\Main\Source\wskill.cpp -o Main\Release\Main\Source\wskill.o
mingw32-g++.exe -LFeLib\Release -LC:\MinGW\lib -o
C:\Projects\ivan-0.50\Main\Release\Main.exe
Main\Release\Main\Source\actset.o Main\Release\Main\Source\areaset.o
Main\Release\Main\Source\charset.o Main\Release\Main\Source\charsset.o
Main\Release\Main\Source\command.o Main\Release\Main\Source\coreset.o
Main\Release\Main\Source\dataset.o Main\Release\Main\Source\dungeon.o
Main\Release\Main\Source\game.o Main\Release\Main\Source\godset.o
Main\Release\Main\Source\iconf.o Main\Release\Main\Source\id.o
Main\Release\Main\Source\igraph.o Main\Release\Main\Source\itemset.o
Main\Release\Main\Source\levelset.o Main\Release\Main\Source\main.o
Main\Release\Main\Source\materset.o Main\Release\Main\Source\message.o
Main\Release\Main\Source\object.o Main\Release\Main\Source\roomset.o
Main\Release\Main\Source\script.o Main\Release\Main\Source\slotset.o
Main\Release\Main\Source\trapset.o Main\Release\Main\Source\wmapset.o
Main\Release\Main\Source\wskill.o Main\Release\Main\Resource\Ivan.res
..\..\MinGW\lib\libmingw32.a ..\..\MinGW\lib\libSDLmain.a
...\..\MinGW\lib\libSDL.a FeLib\Release\libFeLib.a
...\..\MinGW\lib\libwinmm.a -mwindows
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function `DX5_Available':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:487:
undefined reference to `IID_IDirectDrawSurface3'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function `DX5_VideoInit':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:915:
undefined reference to `IID_IDirectDraw2'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_AllocDDSurface':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:1672:
undefined reference to `IID_IDirectDrawSurface3'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_SetVideoMode':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:1320:
undefined reference to `IID_IDirectDrawSurface3'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_SetGammaRamp':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:2268:
undefined reference to `IID_IDirectDrawGammaControl'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_GetGammaRamp':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:2314:
undefined reference to `IID_IDirectDrawGammaControl'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function `DX5_Available':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:460:
undefined reference to `GUID_XAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:462:
undefined reference to `GUID_YAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:465:
undefined reference to `GUID_ZAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:466:
undefined reference to `GUID_RxAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:471:
undefined reference to `GUID_RyAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:472:
undefined reference to `GUID_RzAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:472:
undefined reference to `GUID_Slider'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:472:
undefined reference to `GUID_Slider'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:474:
undefined reference to `GUID_POV'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:474:
undefined reference to `GUID_POV'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:481:
undefined reference to `GUID_POV'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:481:
undefined reference to `GUID_POV'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o): In function
`DX5_CreateDevice':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:532:
undefined reference to `GUID_XAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:533:
undefined reference to `GUID_YAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:537:
undefined reference to `GUID_ZAxis'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:577:
undefined reference to `GUID_Key'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:579:
undefined reference to `GUID_Key'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:582:
undefined reference to `GUID_Key'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:582:
undefined reference to `GUID_Key'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:588:
undefined reference to `GUID_Key'
...\..\MinGW\lib\libSDL.a(SDL_dx5video.o):/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5video.c:589:
more undefined references to `GUID_Key' follow
...\..\MinGW\lib\libSDL.a(SDL_dx5events.o): In function
`DX5_CreateWindow':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5events.c:177:
undefined reference to `IID_IDirectInputDevice2A'
...\..\MinGW\lib\libSDL.a(SDL_dx5events.o): In function
`GetTopLevelParent':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5events.c:72:
undefined reference to `GUID_SysKeyboard'
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5events.c:76:
undefined reference to `GUID_SysMouse'
...\..\MinGW\lib\libSDL.a(SDL_dx5yuv.o): In function
`DX5_CreateYUVOverlay':
/home/hercules/public_cvs/SDL12/src/video/windx5/SDL_dx5yuv.c:86:
undefined reference to `IID_IDirectDrawSurface3'
FeLib\Release\libFeLib.a(graphics.o):graphics.cpp
undefined reference to `SDL_RWFromFile'
FeLib\Release\libFeLib.a(graphics.o):graphics.cpp
undefined reference to `SDL_LoadBMP_RW'
collect2: ld returned 1 exit status
=======================================
As you can see there aren't any errors until linking, yet I cannot
identify where these errors are coming from. It LOOKS like some
library or another isn't being included, but no extra libraries are
listed in the makefile, which compiles just fine. You can even see
that I attempted to fix some of the errors by including libwinmm.a, but
that didn't solve all of them, and I've decided to ask for help rather
than attempting to include random libraries without any direction