RE: link error when using getcon

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



That worked.

I forgot that libselinx was compiled as C and not c++.

Thank you!

> -----Original Message-----
> From: Daniel J Walsh [mailto:dwalsh@xxxxxxxxxx]
> Sent: Tuesday, May 15, 2007 6:20 PM
> To: Clarkson, Mike R (US SSA)
> Cc: fedora-selinux-list@xxxxxxxxxx
> Subject: Re: link error when using getcon
> 
> Clarkson, Mike R (US SSA) wrote:
> > Can anyone help me out with this link error?
> >
> > % g++ -L/usr/lib64 -lselinux -o SimulatedImport SimulatedImport.cc
> > /tmp/cc2AWYzw.o(.text+0x1ab): In function `main':
> > : undefined reference to `getcon(char**)'
> > collect2: ld returned 1 exit status
> >
> > I thought that all I needed to link in was libselinux.a, located at
> > /usr/lib64/libselinux.a
> >
> > I have the following lines in SimulatedImport.cc:
> > 	security_context_t *context = 0;
> >   	int gcrtn = getcon(context);
> >
> > Thanks,
> >   Mike
> >
> >
> > --
> > fedora-selinux-list mailing list
> > fedora-selinux-list@xxxxxxxxxx
> > https://www.redhat.com/mailman/listinfo/fedora-selinux-list
> >
> Do you need?
> 
>   extern "C" {
>    /// Get declaration for f(int i, char c, float x)/
>    #include <selinux/selinux.h>
>  }


--
fedora-selinux-list mailing list
fedora-selinux-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-selinux-list

[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Campsites]     [KDE Users]     [Gnome Users]

  Powered by Linux