Forums > Dev

Compiling and linking jitter external with msys/Mingw on Windows

August 26, 2011 | 5:50 am

I’m trying to build a jitter external on windows and am stuck at linking to the jitter library. I know my dev environment is fine, the collect example builds fine. Now I am modifying the makefile to try and build a jitter object (one that I have working on Mac, it doesn’t do anything platform dependent). It compiles fine and links to my 3rd party libraries, but fails on several screens full of lines like this:

undefined reference to '_imp___jit_sym_mop'

which it repeats for any in the code (char, long, getinfo, getdata, etc.).

The link line of my makefile is:

LDFLAGS = -shared -L$(C74SUPPORT)/max-includes -L$(C74SUPPORT)/msp-includes -L$(C74SUPPORT)/jit-includes -ljitlib -lMaxAPI -lmaxcrt -static-libgcc -mno-cygwin

It has the jitlib.lib file (if I rename the file the linker returns a different error), but it seems to be missing a DLL or something. Has anyone succeeded in building a jitter object this way?

August 26, 2011 | 12:18 pm

as a proof of the problem I’m using this makefile to test, building the jit.split example with mingw.

My only guess is that jitlib.lib is built for MSVC only, and not mingw compatible?

NAME = jit.split

SRC = $(NAME).c
SRC += max.$(NAME).c

C74SUPPORT = ../../c74support
SRC += $(C74SUPPORT)/max-includes/common/basic_c_strings.c
SRC += $(C74SUPPORT)/max-includes/common/dllmain_win.c

CC = mingw32-gcc-4.4.0

CFLAGS = -c -DWIN_VERSION -DWIN_EXT_VERSION -D_WINDOWS -D_USRDLL -D_WINDLL -I$(C74SUPPORT)/max-includes -I$(C74SUPPORT)/msp-includes -I$(C74SUPPORT)/jit-includes -mno-cygwin

LDFLAGS = -shared -L$(C74SUPPORT)/max-includes -L$(C74SUPPORT)/msp-includes -L$(C74SUPPORT)/jit-includes -lMaxAPI -lmaxcrt -ljitlib -fvisibility=default -static-libgcc -mno-cygwin --def $(NAME).def

# using -static-libgcc in the above line means that throwing exceptions across DLL boundaries won't work,
# but it also means that we don't depend on the libgcc dll

	$(CC) $(CFLAGS) -g $(SRC)
	$(CC) -o $(NAME).mxe $(NAME).o max.$(NAME).o basic_c_strings.o dllmain_win.o $(LDFLAGS)

	$(CC) $(CFLAGS) $(SRC)
	$(CC) -o $(NAME).mxe $(NAME).o max.$(NAME).o basic_c_strings.o dllmain_win.o $(LDFLAGS)

	rm -f *.o
	rm -f $(NAME).mxe

August 28, 2011 | 1:55 pm

I’m not 100% sure if this is your problem or not, but there is no _jit_sym_mop symbol. There is a __jit_sym_jit_mop symbol, which is what I assume you meant to use?

Viewing 3 posts - 1 through 3 (of 3 total)