Question about local variables

Or can you update the code in svn ? I will re check out it.

Or where, I mean in which file shall I include unistd.h ?





===========================================

Phone : 82-42-860-1838
Fax : 82-42-860-6790
Cell Phone: 82-10-7599-1981
===========================================


— On Mon, 10/24/11, Eli Friedman eli.friedman@gmail.com wrote:


> From: Eli Friedman eli.friedman@gmail.com
> Subject: Re: [LLVMdev] LLVM build is failed giving Path.inc:714: error: ‘unlink’ was not declared in this scope
> To: “janarbek” canarbekmatay@yahoo.com
> Cc: “LLVM Developers Mailing List” llvmdev@cs.uiuc.edu
> Date: Monday, October 24, 2011, 5:16 PM
>
> On Mon, Oct 24, 2011 at 5:10 PM, janarbek canarbekmatay@yahoo.com wrote:
> >
> > Yes,
> >
> > I applied the patch on trunk version like below. It says patching file. However, when I make, the build is still failing.
> >
> > janarbek@ubuntu:~/Work/llvm/llvm$ patch -p0 < unistd.txt
> > patching file lib/Support/Unix/Path.inc
>
> That means it was applied.
>
> In that case, I have no idea how you could run into the error you’re
> seeing; unlink should be defined in unistd.h.
>
> -Eli

|

The patch does inseret unistd.h as below. However, I am still getting exactly same error when I do make.if you have any suggestions please let me know.

#if HAVE_UNISTD_H
#include <unistd.h>
#endif





===========================================

Phone : 82-42-860-1838
Fax : 82-42-860-6790
Cell Phone: 82-10-7599-1981
===========================================


— On Mon, 10/24/11, Eli Friedman eli.friedman@gmail.com wrote:


> From: Eli Friedman eli.friedman@gmail.com
> Subject: Re: [LLVMdev] LLVM build is failed giving Path.inc:714: error: ‘unlink’ was not declared in this scope
> To: “janarbek” canarbekmatay@yahoo.com
> Cc: “LLVM Developers Mailing List” llvmdev@cs.uiuc.edu
> Date: Monday, October 24, 2011, 5:16 PM
>
> On Mon, Oct 24, 2011 at 5:10 PM, janarbek canarbekmatay@yahoo.com wrote:
> >
> > Yes,
> >
> > I applied the patch on trunk version like below. It says patching file. However, when I make, the build is still failing.
> >
> > janarbek@ubuntu:~/Work/llvm/llvm$ patch -p0 < unistd.txt
> > patching file lib/Support/Unix/Path.inc
>
> That means it was applied.
>
> In that case, I have no idea how you could run into the error you’re
> seeing; unlink should be defined in unistd.h.
>
> -Eli

|

Does someone have a solution for this problem ?
I am using gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) and I have tried several versions of LLVM including llvm 2.9 final. I am getting same error again and again.

I have successfully build the llvm on another machine with gcc version of 4.3.

Thanks in advance.

make[1]: Entering directory /home/janarbek/Work/llvm/RELEASE_29/final/trunk/lib/Support' llvm[1]: Compiling Path.cpp for Debug+Asserts build In file included from Path.cpp:299: Unix/Path.inc: In member function ‘bool llvm::sys::Path::eraseFromDisk(bool, std::string*) const’: Unix/Path.inc:716: error: ‘unlink’ was not declared in this scope make[1]: *** [/home/janarbek/Work/llvm/RELEASE_29/final/trunk/lib/Support/Debug+Asserts/Path.o] Error 1 make[1]: Leaving directory /home/janarbek/Work/llvm/RELEASE_29/final/trunk/lib/Support’
make: *** [all] Error 1

Hi, if you change unlink to ::unlink on that line, does it help?

Ciao, Duncan.


Hi Duncan,


unlink is a C function, right ? why need a :: ?


Or is there a class ?




— On Wed, 10/26/11, Duncan Sands baldrick@free.fr wrote:


> From: Duncan Sands baldrick@free.fr
> Subject: Re: [LLVMdev] LLVM build is failed giving Path.inc:714: error: ‘unlink’ was not declared in this scope
> To: llvmdev@cs.uiuc.edu
> Date: Wednesday, October 26, 2011, 11:10 AM
>
> Hi, if you change unlink to ::unlink on that line, does it help?
>
> Ciao, Duncan.
>
> On 10/26/11 19:27, janarbek wrote:
> > Does someone have a solution for this problem ?
> > I am using gcc version 4.4.5 (Ubuntu/Linaro 4.4.4-14ubuntu5) and I have tried
> > several versions of LLVM including llvm 2.9 final. I am getting same error again
> > and again.
> >
> > I have successfully build the llvm on another machine with gcc version of 4.3.
> >
> > Thanks in advance.
> >
> > make[1]: Entering directory
> > /home/janarbek/Work/llvm/RELEASE_29/final/trunk/lib/Support'<br>> > llvm[1]: Compiling Path.cpp for Debug+Asserts build<br>> > In file included from Path.cpp:299:<br>> > Unix/Path.inc: In member function ‘bool llvm::sys::Path::eraseFromDisk(bool,<br>> > std::string*) const’:<br>> > Unix/Path.inc:716: error: ‘unlink’ was not declared in this scope<br>> > make[1]: ***<br>> > [/home/janarbek/Work/llvm/RELEASE_29/final/trunk/lib/Support/Debug+Asserts/Path.o]<br>> > Error 1<br>> > make[1]: Leaving directory<br>> > /home/janarbek/Work/llvm/RELEASE_29/final/trunk/lib/Support’
> > make: *** [all] Error 1
> >
> >
> >
> > ===========================================
> >
> > Phone : 82-42-860-1838
> > Fax : 82-42-860-6790
> > Cell Phone: 82-10-7599-1981
> > ===========================================
> >
> >
> > — On Mon, 10/24/11, janarbek /canarbekmatay@yahoo.com/ wrote:
> >
> >
> > From: janarbek canarbekmatay@yahoo.com
> > Subject: Re: [LLVMdev] LLVM build is failed giving Path.inc:714: error:
> > ‘unlink’ was not declared in this scope
> > To: “Eli Friedman” eli.friedman@gmail.com
> > Cc: “LLVM Developers Mailing List” llvmdev@cs.uiuc.edu
> > Date: Monday, October 24, 2011, 5:54 PM
> >
> > The patch does inseret unistd.h as below. However, I am still getting
> > exactly same error when I do make.if you have any suggestions please let me
> > know.
> >
> > #if HAVE_UNISTD_H
> > #include <unistd.h>
> > #endif
> >
> >
> >
> > ===========================================
> >
> > Phone : 82-42-860-1838
> > Fax : 82-42-860-6790
> > Cell Phone: 82-10-7599-1981
> > ===========================================
> >
> >
> > — On Mon, 10/24/11, Eli Friedman /eli.friedman@gmail.com/ wrote:
> >
> >
> > From: Eli Friedman eli.friedman@gmail.com
> > Subject: Re: [LLVMdev] LLVM build is failed giving Path.inc:714: error:
> > ‘unlink’ was not declared in this scope
> > To: “janarbek” canarbekmatay@yahoo.com
> > Cc: “LLVM Developers Mailing List” llvmdev@cs.uiuc.edu
> > Date: Monday, October 24, 2011, 5:16 PM
> >
> > On Mon, Oct 24, 2011 at 5:10 PM, janarbek canarbekmatay@yahoo.com wrote:
> > >
> > > Yes,
> > >
> > > I applied the patch on trunk version like below. It says patching
> > file. However, when I make, the build is still failing.
> > >
> > > janarbek@ubuntu:~/Work/llvm/llvm$ patch -p0 < unistd.txt
> > > patching file lib/Support/Unix/Path.inc
> >
> > That means it was applied.
> >
> > In that case, I have no idea how you could run into the error you’re
> > seeing; unlink should be defined in unistd.h.
> >
> > -Eli
> >
> >
> >
> > _______________________________________________
> > LLVM Developers mailing list
> > LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev@cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev



|

Regarding the error below, I checked /usr/include/sys/unistd.h, and found out that unistd.h file contains only one line. So does llvm is using this unistd.h ? I suspect there is something wrong in my unistd.h.