Problem with C library

Mac OSX specific forum
loulou2522
Enthusiast
Enthusiast
Posts: 495
Joined: Tue Oct 14, 2014 12:09 pm

Problem with C library

Post by loulou2522 »

I

Code: Select all

mportC "libUniKey64.dylib"
  UniKey_Find.l (*pHandle, *pSetting1, *pSetting2) 
  UniKey_User_Logon.l (*pHandle, *p1, *p2)
  UniKey_User_Logoff.l (*phandle) 
EndImport
;Definition In h.fileImport
 
 UniKey_Find (@Handle, @p1, @g2) 
Message when compiling

Purebasic Linker error
Undefined symbols for architecture x86_64:
"_UniKey_Find", referenced from:
_main in purebasic.o
PStub_UniKey_Find in purebasic.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Fred
Administrator
Administrator
Posts: 16616
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: Problem with C library

Post by Fred »

You can't import a dynlib, you need to use OpenLibrary(). Import is useful to import static libraries (.a).
Post Reply