[LLVMdev] CommandLine.cpp:189: error: `strdup' undeclared

Chris Lattner sabre at nondot.org
Sat Jul 3 10:01:03 PDT 2004


On Sat, 3 Jul 2004, Henrik Bach wrote:

> I'm trying to port and build LLVM to the Interix environment. I've succeded
> until the Interix version of gcc program executes:

> After the patch:
> It seems that the declaration of strdup is still missing.

> I have a <cstring> located in '/opt/gcc.3.3/include/c++/3.3' and <string>
> located more places including in the listed directory.

That should work fine.  I'm not familiar at all with internix, but it
appears to have a buggy header or something.  From what I understand,
internix is a posix layer for windows.  Have you tried compiling under
cygwin?  If you grab the latest CVS sources, they should work fine with
cygwin, and will probably work better with windows in general than LLVM
1.2.

Again, I'm sorry that I don't know more about this and why <cstring>
apparently doesn't have strdup, it seems really odd.  If <cstring> doesn't
work, you could try <string.h> explicitly, but it would be much better to
use cygwin if you can.

-Chris

-- 
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/




More information about the llvm-dev mailing list