[Date Prev] [Date Next] [Thread Prev] [Thread Next] Date Index Thread Index Search archive:
Date:Mon Apr 1 16:30:22 2002 
Subject:external C call 
From:mhl 
Volume-ID:1020401.01 

Hi,

I'm trying to implement a very simple c function call,

Here's the c function I'm using to test...  (It's in a file called test.cc)

int foo(int x)
{
  int y;
  y=x+1;
  return y;
}

The poplog file I have is...

exload test [libtest]
foo(x) :int
endexload;


I compile the test.cc file into a shared object library with the following commands...

g++ -c -fpic test.cc
g++ -shared -o libtest.so test.o


When I try to compile the poplog exload it complains

;;; Error: can't find value for symbol foo

;;; MISHAP - ERRORS ACCESSING EXTERNAL SYMBOLS (see above)
;;; FILE     :  /home/mhl/external/temp.p   LINE NUMBER:  3
;;; DOING    :  external_do_load exload runproc

I checked the symbols is the library and there's a 'foo_Fi' so I changed the poplog code to read...

exload test [libtest]
foo(x) :int <-'foo_Fi'
endexload;

which works fine. I noticed a section on symbol names in ref * external (line 856) which says that exload should automatically do the mapping. Does anyone know why this isn't the case here? Is it something to do with the method I'm using to compile library, or the fact that I'm using Linux?

Cheers


-- Mike