Hi everyone:

I can't figure out why I'm getting the following:

$ make clean && make
rm -rf cython_chicken.o libcython_chicken.so
gcc-4.2 -fPIC -g -c -m64 -I/usr/local/include cython_chicken.c
gcc-4.2 -dynamiclib -o libcython_chicken.dylib cython_chicken.o -m64
-L/usr/local/lib -lchicken -lm
Undefined symbols:
  "_C_toplevel", referenced from:
      _setup in cython_chicken.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make: *** [all] Error 1

with the code below.

Thanks,

-Dave


** cython_chicken.c:

/* cython_chicken.c */

#include <chicken.h>

char buffer[ 256 ];

void setup (void)
{
  CHICKEN_run(C_toplevel);
  printf("Chicken setup successful");
}

char * eval(char *in_str)
{
  int status;
  status = CHICKEN_eval_string_to_string(in_str, buffer, 255);
  if (status)
  {
    printf("Chicken > %s\n", buffer);
    return buffer;
  }
  else
  {
    printf("Chicken evaluation failed");
    return in_str;
  }
}


**Makefile:

CC = gcc-4.2
CHICKEN_LIB = /usr/local/lib
CHICKEN_INC = /usr/local/include

all:
        $(CC) -fPIC -g -c -m64 -I$(CHICKEN_INC) cython_chicken.c
        $(CC) -dynamiclib -o libcython_chicken.dylib cython_chicken.o -m64
-L$(CHICKEN_LIB) -lchicken -lm
        
clean:
        rm -rf cython_chicken.o libcython_chicken.so

_______________________________________________
Chicken-users mailing list
Chicken-users@nongnu.org
http://lists.nongnu.org/mailman/listinfo/chicken-users

Reply via email to