Symbol Look Up Error

Hi Guys!

I have been trying to create a custom library that I would like to load into CINT. This is what I have so far:



[code]#include “mean.h”

int mean(int a, int b)
return (a+b)/2;


[code] #ifndef EXTLIB
#define EXTLIB

      #ifndef __MAKECINT__
     // Include extlib's original header file here.
     // This part is only read by C++ compiler.
     #include "mean.h"
     #else  // __MAKECINT__

     // Declare interface to the external library.
     // This part is read by cint/makecint only and 
     // must be described within cint limitation.
     // #pragma link statements can be added as option.
     void mean(int a, int b);

 #pragma link C++ function mean;

     #endif  // __MAKECINT__
     #endif // EXTLIB



all: mean.o gcc -shared -Wl,-soname, -o ln -s ln -s

I then run the following commands

makecint -mk makefile2 -dl extlib.dll -H extlib.h -l make -f makefile2

which produces extlib.dll

Then I run

cint extlib.dll mean(2,4) cint: symbol lookup error: ./extlib.dll: undefined symbol: _Z4meanii

Any suggestions on how to fix this problem?


Hi Radu,

[quote]gcc -shared -Wl,-soname, -o
[/quote]Seems to be missing the actual object file (mean.o or something like that).


Well that was a bit embarrassing :slight_smile:

It works now and thank you for the help. Now on to trying to import a large library.