c++ - Unresolved token and symbols for <alcapi.h> -


i want create library can modify acls of object. i've created c++ project in vs 2015 (all c++ components installed), giving me layout dll library.

i've included sample code in link above in .cpp file, , included alcapi.h :

#include <windows.h> #include <stdio.h> #include <aclapi.h>  dword addacetoobjectssecuritydescriptor(     lptstr pszobjname,          // name of object     se_object_type objecttype,  // type of object     lptstr psztrustee,          // trustee new ace     trustee_form trusteeform,   // format of trustee structure     dword dwaccessrights,       // access mask new ace     access_mode accessmode,     // type of ace     dword dwinheritance         // inheritance flags new ace ) {     dword dwres = 0;     pacl polddacl = null, pnewdacl = null;     psecurity_descriptor psd = null;     explicit_access ea; ... 

when try build this, following errors following:

lnk2028 unresolved token (0a00005d) "extern "c" unsigned long __stdcall setnamedsecurityinfow(wchar_t *,enum _se_object_type,unsigned long,void *,void *,struct _acl *,struct _acl *)" (?setnamedsecurityinfow@@$$j228ygkpa_ww4_se_object_type@@kpax2pau_acl@@3@z) referenced in function "unsigned long __cdecl addacetoobjectssecuritydescriptor(wchar_t *,enum _se_object_type,wchar_t *,enum _trustee_form,unsigned long,enum _access_mode,unsigned long)" (?addacetoobjectssecuritydescriptor@@$$fyakpa_ww4_se_object_type@@0w4_trustee_form@@kw4_access_mode@@k@z)     lnk2019 unresolved external symbol "extern "c" unsigned long __stdcall setnamedsecurityinfow(wchar_t *,enum _se_object_type,unsigned long,void *,void *,struct _acl *,struct _acl *)" (?setnamedsecurityinfow@@$$j228ygkpa_ww4_se_object_type@@kpax2pau_acl@@3@z) referenced in function "unsigned long __cdecl addacetoobjectssecuritydescriptor(wchar_t *,enum _se_object_type,wchar_t *,enum _trustee_form,unsigned long,enum _access_mode,unsigned long)" (?addacetoobjectssecuritydescriptor@@$$fyakpa_ww4_se_object_type@@0w4_trustee_form@@kw4_access_mode@@k@z) 

the linker doesn't find definitions functions declared in aclapi.h.

what need make work?

thanks in advance.


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -