PathRemoveFileSpec link problem..

Walliss, Darren wallissd@anz.com
Wed Sep 6 06:11:00 GMT 2006


Brian,

That fixed the problem, but is there a way in which I can refer to the
directory where shlwapi lives, rather than the lib itself?

Also,
- Shouldn't it be resolved via the standard libraries?
- Failing that shouldn't specifying -L/usr/lib/w32api resolve it?

Or do I have to specify each lib to the linker that a prog uses?

Darren

-----Original Message-----
From: Brian Dessent [mailto:brian@dessent.net] 
Sent: Wednesday, 6 September 2006 10:00 AM
To: Walliss, Darren
Cc: gcc-help@gcc.gnu.org
Subject: Re: PathRemoveFileSpec link problem..

"Walliss, Darren" wrote:

> $ gcc pathRemove.c -o pathRemove -mno-cygwin 
> /cygdrive/c/DOCUME~1/wallissd/LOCALS~1/Temp/ccOswrXZ.o:pathRemove.c:(.
> te
> xt+0x46)
> : undefined reference to `__imp__PathRemoveFileSpecA@4'
> collect2: ld returned 1 exit status
> 
> What am I doing wrong??

You need to add -lshlwapi to the end of your link command line to link
against the library.

Brian



"This e-mail and any attachments to it (the "Communication") is, unless otherwise stated, confidential,  may contain copyright material and is for the use only of the intended recipient. If you receive the Communication in error, please notify the sender immediately by return e-mail, delete the Communication and the return e-mail, and do not read, copy, retransmit or otherwise deal with it. Any views expressed in the Communication are those of the individual sender only, unless expressly stated to be those of Australia and New Zealand Banking Group Limited ABN 11 005 357 522, or any of its related entities including ANZ National Bank Limited (together "ANZ"). ANZ does not accept liability in connection with the integrity of or errors in the Communication, computer virus, data corruption, interference or delay arising from or in respect of the Communication."



More information about the Gcc-help mailing list