Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.os.linux.development.apps > #368
| From | jt@toerring.de (Jens Thoms Toerring) |
|---|---|
| Newsgroups | comp.os.linux.development.apps, comp.lang.c, comp.lang.c++ |
| Subject | Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 |
| Date | 2012-01-08 16:35 +0000 |
| Organization | Freie Universitaet Berlin |
| Message-ID | <9mtuudF8esU1@mid.uni-berlin.de> (permalink) |
| References | <3f058b58-9035-4981-b5cb-97ca01476423@w4g2000vbc.googlegroups.com> |
Cross-posted to 3 groups.
In comp.lang.c OtagoHarbour <peterdlauren@gmail.com> wrote:
> I am using NetBeans IDE 7.0.1 to build a C++ application on Ubuntu
> 11.08.
I would guess that it's either Ubuntu 11.04 or 11.10, there is
no 11.08 vaersion. And if you write on C++ it would also seem
to be preferable to ask in the C++ nwesgroup, comp.lang.c++.
> I have code written in C++ and it builds fine in Debug mode. However,
> when I try to build it in Release mode I get the following errors.
> /usr/include/i386-linux-gnu/bits/fcntl2.h:51:26 error: call to ' open
> missing mode' declared with attribute error: open with O_CREAT in
> second argument needs 3 arguments.
> I have the following definition files included.
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
Obviously this is a Unix related problem, since there is no
open() function in either stamdard C or C++, thus a better
place to ask would be e.g. comp.unix.programmer. But what
you have to do seems rather clear: for some reasons the
the compiler gets passed some flags in "release" mode that
aren't set in "debug" mode and which result in some extra
checks being done (I would suspect that in "debug" mode the
-O0 flag is passed to the compiler to disable optimizatation,
but that also makes the detection of certain potential pro-
blems impossible). And with those extra flags it detects that
in some place in your code open() is called with 'O_CREAT'
being set in the second argument and there's no third argu-
ment, which in this case is required. The only reasonable fix
for that is to go to the places in your code where open() is
used and misses the required third argument (the exact plave
is rather likely shown in the error message from the compiler
just before the line you cited) and fix that. It's rather
likely that your program will exhibit rather strange behaviour
if you don't do so (at least the permission flags for the file
might be set randomly, which isn't a good thing at all).
Regards, Jens
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Back to comp.os.linux.development.apps | Previous | Next — Previous in thread | Next in thread | Find similar
fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 OtagoHarbour <peterdlauren@gmail.com> - 2012-01-08 06:47 -0800
Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 Richard Kettlewell <rjk@greenend.org.uk> - 2012-01-08 15:53 +0000
Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 Kaz Kylheku <kaz@kylheku.com> - 2012-01-08 18:39 +0000
Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 Richard Kettlewell <rjk@greenend.org.uk> - 2012-01-08 18:45 +0000
Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 jt@toerring.de (Jens Thoms Toerring) - 2012-01-08 16:35 +0000
Re: fcntl2.h:51:26 error with NetBeans IDE 7.0.1 on Ubuntu 11.08 Jorgen Grahn <grahn+nntp@snipabacken.se> - 2012-01-08 20:13 +0000
csiph-web