New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: no matching function for call to ‘stat::stat(const char*, stat*) #10

Closed
GoogleCodeExporter opened this Issue Mar 15, 2015 · 3 comments

Comments

Projects
None yet
1 participant
@GoogleCodeExporter

GoogleCodeExporter commented Mar 15, 2015

What steps will reproduce the problem?
1. svn checkout
2. cd MicropolisCore/src
3. make

What is the expected output? What do you see instead?

I expect to see make finish succesfully, but instead I get this:

cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
Ada/C/ObjC but not for C++
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall 
-Wstrict-prototypes -fPIC -Isrc -I/usr/local/include -I/usr/include/python2.7 
-c src/main.cpp -o objs/temp.linux-x86_64-2.7/src/main.o
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for 
Ada/C/ObjC but not for C++
src/main.cpp: In function ‘bool testDirectory(const std::string&, const 
char*)’:
src/main.cpp:96:35: error: no matching function for call to ‘stat::stat(const 
char*, stat*)’
/usr/include/bits/stat.h:47:3: note: candidates are: stat::stat()
/usr/include/bits/stat.h:47:3: note:                 stat::stat(const stat&)
src/main.cpp:96:69: error: ‘S_ISDIR’ was not declared in this scope
error: command 'gcc' failed with exit status 1
make[1]: *** [objs/lib.linux-x86_64-2.7/_micropolisengine.so] Error 1
make[1]: Leaving directory 
`/home/pmjdebruijn/micropolis/micropolis-read-only/MicropolisCore/src/Micropolis
Engine'
make: *** [build_micropolisEngine] Error 2

What version of the product are you using? On what operating system?

I'm trying to build svn-r511, on Ubuntu Natty:

$ dpkg -S /usr/include/bits/stat.h
libc6-dev: /usr/include/bits/stat.h

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wra
pper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 
4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs 
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr 
--program-suffix=-4.5 --enable-shared --enable-multiarch 
--with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id 
--with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu 
--without-included-gettext --enable-threads=posix 
--with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/x86_64-linux-gnu 
--enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug 
--enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default 
--with-plugin-ld=ld.gold --enable-objc-gc --disable-werror --with-arch-32=i686 
--with-tune=generic --enable-checking=release --build=x86_64-linux-gnu 
--host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) 

$ /lib/x86_64-linux-gnu/libc-2.13.so
GNU C Library (Ubuntu EGLIBC 2.13-0ubuntu13) stable release version 2.13, by 
Roland McGrath et al.
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
Compiled by GNU CC version 4.5.2.
Compiled on a Linux 2.6.38 system on 2011-04-11.
Available extensions:
    crypt add-on version 2.1 by Michael Glad and others
    GNU Libidn by Simon Josefsson
    Native POSIX Threads Library by Ulrich Drepper et al
    BIND-8.2.3-T5B
libc ABIs: UNIQUE IFUNC
For bug reporting instructions, please see:
<http://www.debian.org/Bugs/>.

Original issue reported on code.google.com by pmjdebru...@pcode.nl on 30 Jul 2011 at 2:53

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Mar 15, 2015

It compiles ok for me on Debian GNU/Linux 6.0. 
Perhaps the sys/stat.h file is not being pulled in from micropolis.h on your 
system, but is indirectly included on mine somehow.
The windows ifdef defines S_ISDIR if it's not already defined. I don't remember 
when I or somebody else added that, but maybe it's related? 
I have jiggled the includes in main.c so it always includes sys/stat.h. 
Give this new revision a try and tell me if it works. 
Thanks for your helpfully written bug report! 

Original comment by simhac...@gmail.com on 30 Jul 2011 at 3:18

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Mar 15, 2015

Yep that fixed it. Thanks for your fast response.

Original comment by pmjdebru...@pcode.nl on 30 Jul 2011 at 3:43

@GoogleCodeExporter

This comment has been minimized.

GoogleCodeExporter commented Mar 15, 2015

You're welcome, and thanks for your help. 

Original comment by simhac...@gmail.com on 30 Jul 2011 at 3:52

  • Changed state: Fixed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment