From: JonY <jo...@us...> - 2011-01-24 01:47:57
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On 1/24/2011 07:28, Rui Lopes wrote: > Hello, > > I'm trying to use the NetUserAdd function from netapi32 library, but > its failing on me: > > gcc -shared -oservice-setup-helper.dll -lnetapi32 service-setup-helper.c > C:\Users\RUILOP~1\AppData\Local\Temp\ccHqnS1l.o:service-setup-helper.c:(.text+0x5f): > undefined reference to `NetUserAdd@16' > collect2: ld returned 1 exit status > Hi, put your libraries behind your object that use them. Eg: gcc -shared -oservice-setup-helper.dll service-setup-helper.c -lnetapi32 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.16 (MingW32) iEYEARECAAYFAk082j0ACgkQp56AKe10wHc3twCdEUZGml/CdnKzTCTpINX1tWb5 mdwAnjMEOIchU/mq9woGbAIvKkSfACth =x8Mz -----END PGP SIGNATURE----- |