[AD] Problem with compiling the grabber with plugins that require their own libs in MSVC

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Hi,

I am experimenting with the JPGalleg 2.6 RC's, and have come accross a problem installing the JPGalleg grabber plugin when using MSVC. The installation works fine under Mingw32 (under Cygwin) but fails under MSVC (under Cygwin). After a bit of investigation, I came to the conclusion that it was a problem with the way MSVC build of Allegro handles grabber plugins that require their own libs.

Here is the offending command when I compile with MSVC.

obj/msvc/runner.exe C:/PROGRA~1/MICROS~4/VC98/bin/link @ -nologo -release -subsystem:windows -out:tools/grabber.exe obj/msvc/alleg/grabber.obj lib/msvc/aldat.lib @tools/plugins/jpgalleg.scv lib/msvc/alleg.lib kernel32.lib user32.lib gdi32.lib comdlg32.lib ole32.lib dinput.lib ddraw.lib dxguid.lib winmm.lib dsound.lib

I get the following error:
LINK : fatal error LNK1181: cannot open input file "@tools/plugins/jpgalleg.scv"

I checked to make sure that the file tools/plugins/jpgalleg.scv was where it should be. The file contains just one line (without a terminating newline) that consists of "libjpgal.lib".

However, when I compile with mingw32, it works fine.

obj/mingw32/runner.exe gcc -s -mno-cygwin -Wl,--subsystem,windows -o tools/grabber.exe obj/mingw32/alleg/grabber.o lib/mingw32/libaldat.a @tools/plugins/jpgalleg.scm lib/mingw32/liballeg.a -lkernel32 -luser32 -lgdi32 -lcomdlg32 -lole32 -ldinput -lddraw -ldxguid -lwinmm -ldsound -L/lib/mingw -lmoldname -lmsvcrt

The way JPGalleg works is that it calls the Allegro makefile to rebuild the grabber. The offending rule in the Allegro makefile is:

tools/grabber$(EXE): $(OBJ_DIR)/grabber$(OBJ) $(PLUGIN_DEPS)
   $(LINK_WITH_PLUGINS)

LINK_WITH_PLUGINS for MSVC is defined as:

define LINK_WITH_PLUGINS
$(RUNNER) $(MSVC_LINK) @ -nologo $(LFLAGS) -subsystem:windows -out:$@ $< $(strip $(PLUGIN_LIB) $(addprefix @,$(PLUGIN_SCRIPTS)) $(IMPLIB_NAME) $(LIBRARIES))
endef

PLUGIN_SCRIPTS is defined as:

PLUGIN_SCRIPTS = $(wildcard tools/plugins/*.$(PLUGIN_SCR))

and PLUGIN_SCR for MSVC is defined as

PLUGIN_SCR = scv


Note that even though mingw32 is using a utility called runner.exe, it is a different runner (runnergw.c) Both utilities handle the '@' character in a different way, and also use different means of detecting '@'. runner.c uses "if(strcmp(argv[i], "@") == 0)", and runnergw.c uses "if(argv[i][0] == '@')".

My first theory is that due to the differences in the way that both runners handle '@', this might be the cause of the problem. However, I am not sure if a '@' before the filename is part of makefile syntax or gcc-specific syntax. If the latter is the case, then my second theory would be that that is why an error is produced with MSVC.

I am using MSVC 6 (under Cygwin) in Windows 2000, Allegro 4.2.0, and a modified version of JPGalleg 2.6 RC3 (see http://www.allegro.cc/forums/thread/583497/586598#target )


AE.





Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/