Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
wrapping a c-lib?
#1
Hello,

I've looked through the examples directory but I can't seem to find the answer I am looking for.

Here is my C file:
Code:
int testme ()
{
  return 5 + 3;
}

This is my test.bi file:
Code:
#ifndef TST_BI
#define TST_BI

declare function        testme          cdecl alias  "testme"           ( ) as


#endif ' TST_BI

This is my test.bas file:
Code:
'$include: "test.bi"

print "Hello, we are going to make a test now :)"
print testme()
print "Did it work?"

I compiled the c file:
Code:
gcc -c test.c
Then I made it a lib:
Code:
fbc -lib test.o
But when I do:
Code:
fbc -l ./libtest.a test.bas
I get:
Code:
ld: cannot find -l./libtest.a
or when I try:
Code:
fbc test.bas
I get:
Code:
test.o(.text+0x53): In function `_t0000':
: undefined reference to `testme'

So, what should I do?
b newbie Big Grin
running Fedora Core Linux 3 Smile
Reply
#2
Or you use the #inclib "abc" in the header itself or on each prototype the lib "abc" clause.

The name for LD must be "abc", w/o the "lib" and the ".a", if the lib was called "libabc.a".
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)