Results 1 to 10 of 11
I'm trying to get Guile to work, but I'm having some issues.
Here is my Makefile:
guiletest : guiletest.o
gcc -o guiletest guiletest.o
guiletest.o : guiletest.c
gcc "guile-config link" -c ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 10-13-2005 #1Linux Newbie
- Join Date
- Apr 2005
- Posts
- 108
Getting Guile to work
I'm trying to get Guile to work, but I'm having some issues.
Here is my Makefile:
Here is my guiletest.c:guiletest : guiletest.o
gcc -o guiletest guiletest.o
guiletest.o : guiletest.c
gcc "guile-config link" -c guiletest.c
Yet when I compile, I'm getting these errors:#include <stdio.h>
#include <stdlib.h>
#include <libguile.h>
int main(int argc, char *argv[])
{
SCM func_symbol;
SCM func;
scm_init_guile();
scm_c_primitive_load ("script.scm");
func_symbol = scm_c_lookup("do-hello");
func = scm_variable_ref(func_symbol);
scm_call_0(func);
exit(EXIT_SUCCESS);
}
I am confused. I downloaded guile, did ./configure, make, and make install as root. Why isn't this working? I'm following this guile book.gcc -o guiletest guiletest.o
guiletest.o(.text+0x11): In function `main':
: undefined reference to `scm_init_guile'
guiletest.o(.text+0x1d): In function `main':
: undefined reference to `scm_c_primitive_load'
guiletest.o(.text+0x29): In function `main':
: undefined reference to `scm_c_lookup'
guiletest.o(.text+0x37): In function `main':
: undefined reference to `scm_variable_ref'
guiletest.o(.text+0x45): In function `main':
: undefined reference to `scm_call_0'
collect2: ld returned 1 exit status
make: *** [guiletest] Error 1
- 10-13-2005 #2
You were using double-quotes (") instead of backticks (`) on the guile-config part of the gcc command line.
- 10-13-2005 #3Linux Newbie
- Join Date
- Apr 2005
- Posts
- 108
I changed it to backticks, but it still gives me the same errors.
- 10-13-2005 #4
Just for shits and giggles, can you paste what you typed?
- 10-13-2005 #5Linux Newbie
- Join Date
- Apr 2005
- Posts
- 108
What?
I'll post the Makefile. I think that's what you're asking for.
guiletest : guiletest.o
gcc -o guiletest guiletest.o
guiletest.o : guiletest.c
gcc 'guile-config link' -c guiletest.c
- 10-13-2005 #6
a. Make sure that you've indented lines 2 and 4 with tabs
b. Those still aren't backticks. The backticks are found directly under the escape key.
- 10-13-2005 #7Linux Newbie
- Join Date
- Apr 2005
- Posts
- 108
The lines have been indented. For some reason it's not shown here.
Here's my new Makefile again:
The errors are still there.guiletest : guiletest.o
gcc -o guiletest guiletest.o
guiletest.o : guiletest.c
gcc `guile-config link` -c guiletest.c
- 10-13-2005 #8Linux User
- Join Date
- Jul 2004
- Location
- Poland
- Posts
- 368
I guess `guile-config link` returns libraries and their paths necessary for linking the program, i.e. making executable from object files. They are useless during compilation, i.e. translating source code to object files. All this boils down to changing your makefile so that it looks like:
Originally Posted by Comrade
Hope this helps a little. I also strongly suggest using -Wall flag for compilation. Best regards.Code:guiletest : guiletest.o gcc `guile-config link` -o guiletest guiletest.o guiletest.o : guiletest.c gcc -c guiletest.c"I don't know what I'm running from
And I don't know where I'm running to
There's something deep and strange inside of me I see"
- 10-13-2005 #9Linux Newbie
- Join Date
- Apr 2005
- Posts
- 108
Foolish me!
There was a makefile given with the Guile book that I linked to above.
Here it is :
Thanks for the help, anyway. I learned more about Makefiles now. Although I'm looking into Jam.CDEBUG = -g -Wall
CFLAGS = $(CDEBUG) `guile-config compile`
LDFLAGS = `guile-config link`
SRCS = main.c
OBJS = main.o
hello_world: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
- 10-14-2005 #10
What's Jam?


Reply With Quote
