[plt-scheme] making an embedded application using autoconf.

From: Randy Robinson (stinkytoe42 at yahoo.com)
Date: Mon Mar 21 20:00:15 EST 2005

I am trying to get mzscheme to create with autoconf.

here is the appropriate section of my Makefile.am:
machinabello_SOURCES  = machinabello.cpp \
 		        math.cpp schemebind.cpp terrain.cpp  \
 		        math.hpp schemebind.hpp terrain.hpp
machinabello_CXXFLAGS = `sdl-config --cflags`
machinabello_LDFLAGS  = `sdl-config --libs` -lGL
-lmzscheme -lmzgc

all the .cpp files compile normally, but when it tries
to link, make 
executes the following line:

g++  -g -O2   -o machinabello `sdl-config --libs` -lGL
-lmzscheme -lmzgc \
    machinabello-machinabello.o machinabello-math.o \
    machinabello-schemebind.o machinabello-terrain.o
libbello.a

(i added the \newlines)

this fails with the following error:

machinabello-schemebind.o(.text+0x5): In function 
`schemebind_test_main(int, char**)':
/home/stinkytoe/projects/machinabello/src/schemebind.cpp:65:
undefined 
reference to `scheme_basic_env'
collect2: ld returned 1 exit status

plus many other lines with scheme_basic_env replaced
with other library 
calls.

however if i switch the order between the object files
and the flags like 
so:
g++  -g -O2   -o machinabello
machinabello-machinabello.o \
    machinabello-math.o machinabello-schemebind.o
machinabello-terrain.o \
    libbello.a `sdl-config --libs` -lGL -lmzscheme
-lmzgc

it compiles and runs as expected. does anyone have any
insight as to what 
i'm doing wrong? or how i can get autoconf/automake to
play nicely with 
mzscheme? any help would be greatly appreciated, as
guile's interface for 
making new port types is god awful ugly and poorly
documented. (heh).

g++ (GCC) 3.3.5  (Gentoo Linux 3.3.5-r1, ssp-3.3.2-3,
pie-8.7.7.1)
autoconf (GNU Autoconf) 2.59
Welcome to MzScheme version 205, Copyright (c)
1995-2003 PLT
compiled on gentoo with CFLAGS="-mcpu=pentium3 -O3
-pipe"




		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 



Posted on the users mailing list.