Link .lib together with dll

Just starting out? Need help? Post your questions and find answers here.
mrniceguy1971
User
User
Posts: 56
Joined: Tue May 16, 2006 3:52 pm

Link .lib together with dll

Post by mrniceguy1971 »

Would it be possible to link a .lib or .obj file in a Purebasic DLL which call functions from the .lib or .obj?
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Link .lib together with dll

Post by ts-soft »

see Import
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
mrniceguy1971
User
User
Posts: 56
Joined: Tue May 16, 2006 3:52 pm

Re: Link .lib together with dll

Post by mrniceguy1971 »

Thanks. Will take a look at this.
mrniceguy1971
User
User
Posts: 56
Joined: Tue May 16, 2006 3:52 pm

Re: Link .lib together with dll

Post by mrniceguy1971 »

Already imported a lib but now I get the following error.

POLink: error: Unresolved external symbol '_imp_ConvertSidToStringSidW'.
POLink: fatal error: 1 unresolved external(s).

Any hints/tip how to solve this are appreciated :wink:
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Link .lib together with dll

Post by ts-soft »

You have to import advapi32.lib, but not the one from PureBasic, is to old.

Code: Select all

Import "Advapi32.lib"
EndImport
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
mrniceguy1971
User
User
Posts: 56
Joined: Tue May 16, 2006 3:52 pm

Re: Link .lib together with dll

Post by mrniceguy1971 »

Thanks again. This solved the problem.
Post Reply