hi,
i'm trying to compile scheme to c code.
here's the hello.scm code: (display "hello world") (newline)
compiled ok with gsc: /usr/local/Gambit-C/bin/gsc -c hello.scm
however when tried to compile with gcc produced the following error: gcc test.c -I/usr/local/Gambit-C/include -L/usr/local/Gambit-C/lib Undefined symbols: "____gstate", referenced from: ____gstate$non_lazy_ptr in cccK2CZQ.o "_main", referenced from: start in crt1.10.5.o "____G__20_test", referenced from: ____G__20_test$non_lazy_ptr in cccK2CZQ.o "____G_display", referenced from: ____G_display$non_lazy_ptr in cccK2CZQ.o "____G_newline", referenced from: ____G_newline$non_lazy_ptr in cccK2CZQ.o ld: symbol(s) not found collect2: ld returned 1 exit status
i'm running on mac os x: uname -srmp; gcc --version Darwin 9.8.0 i386 i386 i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
did i miss some settings or steps?
thanks,
antonitio
Afficher les réponses par date
You missed the library, -lgambc
-Ivan
On Wed, Aug 26, 2009 at 12:15:28AM +0800, antonitio wrote:
hi,
i'm trying to compile scheme to c code.
here's the hello.scm code: (display "hello world") (newline)
compiled ok with gsc: /usr/local/Gambit-C/bin/gsc -c hello.scm
however when tried to compile with gcc produced the following error: gcc test.c -I/usr/local/Gambit-C/include -L/usr/local/Gambit-C/lib Undefined symbols: "____gstate", referenced from: ____gstate$non_lazy_ptr in cccK2CZQ.o "_main", referenced from: start in crt1.10.5.o "____G__20_test", referenced from: ____G__20_test$non_lazy_ptr in cccK2CZQ.o "____G_display", referenced from: ____G_display$non_lazy_ptr in cccK2CZQ.o "____G_newline", referenced from: ____G_newline$non_lazy_ptr in cccK2CZQ.o ld: symbol(s) not found collect2: ld returned 1 exit status
i'm running on mac os x: uname -srmp; gcc --version Darwin 9.8.0 i386 i386 i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
did i miss some settings or steps?
thanks,
antonitio
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
i thought if i include the -I and -L options there's no need for the -lgambc.
anyway, it works now! gcc hello.c -I/usr/local/Gambit-C/include -L/usr/local/Gambit-C/lib -lgambc ./a.out hello world!
thanks ivan
antonitio
On Wed, Aug 26, 2009 at 12:30 AM, Ivan Kelly ivan@bleurgh.com wrote:
You missed the library, -lgambc
-Ivan
On Wed, Aug 26, 2009 at 12:15:28AM +0800, antonitio wrote:
hi,
i'm trying to compile scheme to c code.
here's the hello.scm code: (display "hello world") (newline)
compiled ok with gsc: /usr/local/Gambit-C/bin/gsc -c hello.scm
however when tried to compile with gcc produced the following error: gcc test.c -I/usr/local/Gambit-C/include -L/usr/local/Gambit-C/lib Undefined symbols: "____gstate", referenced from: ____gstate$non_lazy_ptr in cccK2CZQ.o "_main", referenced from: start in crt1.10.5.o "____G__20_test", referenced from: ____G__20_test$non_lazy_ptr in cccK2CZQ.o "____G_display", referenced from: ____G_display$non_lazy_ptr in cccK2CZQ.o "____G_newline", referenced from: ____G_newline$non_lazy_ptr in cccK2CZQ.o ld: symbol(s) not found collect2: ld returned 1 exit status
i'm running on mac os x: uname -srmp; gcc --version Darwin 9.8.0 i386 i386 i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5465)
did i miss some settings or steps?
thanks,
antonitio
Gambit-list mailing list Gambit-list@iro.umontreal.ca https://webmail.iro.umontreal.ca/mailman/listinfo/gambit-list
2009/8/26 antonitio antonitio@gmail.com:
i thought if i include the -I and -L options there's no need for the -lgambc. anyway, it works now! gcc hello.c -I/usr/local/Gambit-C/include -L/usr/local/Gambit-C/lib -lgambc ./a.out hello world!
You wanted to do gsc -exe hello.scm didn't you?
Marc added this option quite recently. It's a great one that is not yet famous.
P!
yup, that is a pretty handy option to have :-) thanks
antonitio
On Wed, Aug 26, 2009 at 1:23 AM, Adrien Piérard pierarda@iro.umontreal.cawrote:
2009/8/26 antonitio antonitio@gmail.com:
i thought if i include the -I and -L options there's no need for the -lgambc. anyway, it works now! gcc hello.c -I/usr/local/Gambit-C/include -L/usr/local/Gambit-C/lib
-lgambc
./a.out hello world!
You wanted to do gsc -exe hello.scm didn't you?
Marc added this option quite recently. It's a great one that is not yet famous.
P!
-- Français, English, 日本語, 한국어
On Wed, 2009-08-26 at 01:33 +0800, antonitio wrote:
yup, that is a pretty handy option to have :-) thanks
I've been compiling Gambit passing "-g" to gcc to help debugging with gdb. And I thought I'd try this "-exe" option. This is what I got:
-rw-r--r-- 1 lucier lucier 28 2009-08-25 13:39 hello.scm -rwxr-xr-x 1 lucier lucier 9962967 2009-08-25 13:39 hello*
Maybe I should enable shared libraries or something ;-).
Brad
Hallo,
On 8/25/09, antonitio antonitio@gmail.com wrote:
did i miss some settings or steps?
I suggest letting GSC do the work for you. There are several GCC options and preprocessor defines it adds to the command line. You can read how to use GSC to produce dynamic modules and stand-alone executables in the Gambit-C manual.
Cheers,