* How to fix "‘get_current_dir_name’ was not declared in this scope" ?
@ 2013-11-14 11:57 David Aldrich
2013-11-14 12:07 ` Jonathan Wakely
0 siblings, 1 reply; 4+ messages in thread
From: David Aldrich @ 2013-11-14 11:57 UTC (permalink / raw)
To: gcc-help
Hi
Our application builds fine on Ubuntu 12.04 LTS, using gcc 4.6.3.
However, when I attempt to build on Fedora 19, which uses gcc 4.8.2 I see:
g++ -I../../Kernel -Wall -m64 -O3 -c -o FileSystem.o FileSystem.cpp
FileSystem.cpp: In static member function ‘static std::string FileSystem::currentDir()’:
FileSystem.cpp:108:34: error: ‘get_current_dir_name’ was not declared in this scope
p = get_current_dir_name();
Please will someone explain how to fix this?
Best regards
David
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to fix "‘get_current_dir_name’ was not declared in this scope" ?
2013-11-14 11:57 How to fix "‘get_current_dir_name’ was not declared in this scope" ? David Aldrich
@ 2013-11-14 12:07 ` Jonathan Wakely
2013-11-14 12:10 ` David Aldrich
0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Wakely @ 2013-11-14 12:07 UTC (permalink / raw)
To: David Aldrich; +Cc: gcc-help
On 14 November 2013 11:57, David Aldrich wrote:
> Hi
>
> Our application builds fine on Ubuntu 12.04 LTS, using gcc 4.6.3.
>
> However, when I attempt to build on Fedora 19, which uses gcc 4.8.2 I see:
>
> g++ -I../../Kernel -Wall -m64 -O3 -c -o FileSystem.o FileSystem.cpp
> FileSystem.cpp: In static member function ‘static std::string FileSystem::currentDir()’:
> FileSystem.cpp:108:34: error: ‘get_current_dir_name’ was not declared in this scope
> p = get_current_dir_name();
>
> Please will someone explain how to fix this?
Declare the function, of course!
It's declared in <unistd.h> so make sure you include that.
If you use that function without including <unistd.h> then your code
was always broken, but you got away with it in the past. See the
header dependency changes section of
http://gcc.gnu.org/gcc-4.7/porting_to.html for more details.
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: How to fix "‘get_current_dir_name’ was not declared in this scope" ?
2013-11-14 12:07 ` Jonathan Wakely
@ 2013-11-14 12:10 ` David Aldrich
2013-11-14 12:18 ` Jonathan Wakely
0 siblings, 1 reply; 4+ messages in thread
From: David Aldrich @ 2013-11-14 12:10 UTC (permalink / raw)
To: Jonathan Wakely; +Cc: gcc-help
Hi Jonathan
Thanks for your answer. I just needed to know where to look.
Best regards
David
> -----Original Message-----
> From: Jonathan Wakely [mailto:jwakely.gcc@gmail.com]
> Sent: 14 November 2013 12:07
> To: David Aldrich
> Cc: gcc-help@gcc.gnu.org
> Subject: Re: How to fix "‘get_current_dir_name’ was not declared in this scope"
> ?
>
> On 14 November 2013 11:57, David Aldrich wrote:
> > Hi
> >
> > Our application builds fine on Ubuntu 12.04 LTS, using gcc 4.6.3.
> >
> > However, when I attempt to build on Fedora 19, which uses gcc 4.8.2 I see:
> >
> > g++ -I../../Kernel -Wall -m64 -O3 -c -o FileSystem.o FileSystem.cpp
> > FileSystem.cpp: In static member function ‘static std::string
> FileSystem::currentDir()’:
> > FileSystem.cpp:108:34: error: ‘get_current_dir_name’ was not declared
> > in this scope p = get_current_dir_name();
> >
> > Please will someone explain how to fix this?
>
> Declare the function, of course!
>
> It's declared in <unistd.h> so make sure you include that.
>
> If you use that function without including <unistd.h> then your code was always
> broken, but you got away with it in the past. See the header dependency
> changes section of http://gcc.gnu.org/gcc-4.7/porting_to.html for more details.
>
>
> Click
> https://www.mailcontrol.com/sr/ue91J159rp!GX2PQPOmvUi5k6UwC8217nDq3J
> XqYyXHMltAxjHyTnnsqMfZP2+Q66JsWorzTs4aU8yB5sLY89Q== to report this
> email as spam.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: How to fix "‘get_current_dir_name’ was not declared in this scope" ?
2013-11-14 12:10 ` David Aldrich
@ 2013-11-14 12:18 ` Jonathan Wakely
0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Wakely @ 2013-11-14 12:18 UTC (permalink / raw)
To: David Aldrich; +Cc: gcc-help
On 14 November 2013 12:09, David Aldrich wrote:
> Hi Jonathan
>
> Thanks for your answer. I just needed to know where to look.
You could have used "man get_current_dir_name", that's what I did.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2013-11-14 12:18 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-11-14 11:57 How to fix "‘get_current_dir_name’ was not declared in this scope" ? David Aldrich
2013-11-14 12:07 ` Jonathan Wakely
2013-11-14 12:10 ` David Aldrich
2013-11-14 12:18 ` Jonathan Wakely
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).