Author Topic: Compiling Script BASIC to C  (Read 2689 times)

Offline John

  • Forum Support / SB Dev
  • Posts: 3004
    • ScriptBasic Open Source Project
Compiling Script BASIC to C
« on: April 13, 2015, 09:16:03 PM »
AIR,

I tried to compile a test Script BASIC script on my laptop that has worked fine in the past and is now returning a strange error I can't figure out. Any idea what might be going on?


jrs@laptop:~/sb/sb22/test$ cat sbc.sb
PRINT "Script BASIC\n"
jrs@laptop:~/sb/sb22/test$ gcc -Os sbc.c -I /home/jrs/sb/source -ldl /usr/lib/sb.a -lscriba -lm -lpthread -o sbc
/usr/bin/ld: /usr/lib/sb.a(dynlolib.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
/usr/lib/gcc/x86_64-linux-gnu/4.8/../../../x86_64-linux-gnu/libdl.so: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
jrs@laptop:~/sb/sb22/test$

« Last Edit: April 13, 2015, 09:20:28 PM by John »

Offline John

  • Forum Support / SB Dev
  • Posts: 3004
    • ScriptBasic Open Source Project
Re: Compiling Script BASIC to C - RESOLVED
« Reply #1 on: April 15, 2015, 02:23:33 PM »
It seems to have been an order of dependency issue. Works fine now.


jrs@laptop:~/sb/sb22/test$ cat sbc.sb
PRINT "Script BASIC\n"

jrs@laptop:~/sb/sb22/test$ gcc -Os sbc.c -I/home/jrs/sb/source /usr/lib/sb.a -ldl -lm -lpthread -lscriba -o sbc

jrs@laptop:~/sb/sb22/test$ ./sbc
Script BASIC

jrs@laptop:~/sb/sb22/test$ ls -l sbc
-rwxrwxr-x 1 jrs jrs 24655 Apr 15 14:20 sbc

jrs@laptop:~/sb/sb22/test$ file sbc
sbc: ELF 64-bit LSB  executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.24, BuildID[sha1]=a8ae87e049b81b42c037ae74bd21ad925b4cb0a0, not stripped
jrs@laptop:~/sb/sb22/test$ strip -s sbc
jrs@laptop:~/sb/sb22/test$ ls -l sbc
-rwxrwxr-x 1 jrs jrs 19992 Apr 15 14:43 sbc
jrs@laptop:~/sb/sb22/test$


« Last Edit: April 15, 2015, 02:44:40 PM by John »