04-30-07 06:17 AM
In article <1177898133.107010.322600@y80g2000hsf.googlegroups.com>,
cviniciusm@gmail.com wrote:
> Hello,
>
> I'm using "g++ (GCC) 4.1.1 20070105 (Red Hat 4.1.1-51)".
>
> I'm trying to use the open() function as defined by the header
> fcntl.h, but I'm getting this error:
> "
> mylibrary.cpp:16: error: no matching function for call to
> 'mylibrary::open(const char*, int)'
> mylibrary.cpp:14: note: candidates are: int mylibrary::open()
> "
>
> mylibrary.h:
> class mylibrary
> {
> private:
> int fd;
> ...
> public:
> int open(void);
> ...
>
> };
>
> mylibrary.cpp:
> #include <fcntl.h>
> #include "mylibrary.h"
> int mylibrary::open(void)
> {
> fd = open("/dev/ttyS0", O_RDWR | O_NOCTTY | O_NONBLOCK);
> ...
> return 0;
>
> }
>
> How to tell the compiler to use the open() from fcntl.h, please?
fd = ::open(...);
--
Barry Margolin, barmar@alum.mit.edu
Arlington, MA
*** PLEASE post questions in newsgroups, not directly to me ***
*** PLEASE don't copy me on replies, I'll read them in the group ***
[ Post a follow-up to this message ]
|