Mingw32, unistd.h and my program

A

Al-Burak

I have a class that uses unistd.h functions for file I/O handling, I
have not used this class in a long time, but it worked just fine in
LINUX and CYGWIN, but under MINGW32 it doesn't even recognize the
function in unistd.h, and the compiler gives me errors like.

gnu_io.cpp:10: error: `F_OK' undeclared (first use this function)
gnu_io.cpp:10: error: `access' undeclared (first use this function)

What am I doing wrong?
 
J

John Ratliff

Al-Burak said:
I have a class that uses unistd.h functions for file I/O handling, I
have not used this class in a long time, but it worked just fine in
LINUX and CYGWIN, but under MINGW32 it doesn't even recognize the
function in unistd.h, and the compiler gives me errors like.

gnu_io.cpp:10: error: `F_OK' undeclared (first use this function)
gnu_io.cpp:10: error: `access' undeclared (first use this function)

What am I doing wrong?

1) cross-posting to multiple newsgroups.
2) Asking this question in three newgroups that have NOTHING to do with
your problem.

But the answer you are probably looking for is that mingw doesn't
support what you're trying to do. There is no such thing as access under
Windows, hence it's not in mingw. Mingw uses the Windows C library to
accomplish things, while cygwin emulates anything Windows doesn't have.
This is why it works on cygwin, but not mingw.

Next time you have a problem with mingw, ask it on their mailing list,
and ONLY their mailing list, please.

--John Ratliff
 
A

Al-Burak

Thank you for your prompt response, I honestly appreciate your input.
However, you reply has also raised another question, and with all due
respect I would like to have your input on this matter as well.
First, I would like to let you know what I think of cross-posted this
question.
If I have product to sell, and I want a broad audience to know that
this product exists, I would not put up a flyer at the nearest
bus-shelter, what I would do however is to advertise on TV, radio, news
paper, and yes flyers, but only on one bus-shelter, but in all possible
bus-shelters, thus letting as many people as possible know that my
product exists.
Now, to bring my point home, I have a question and I would like to
reach out to as many as possible programmers who like yourself, have a
more extensive knowledge about the subject. To achieve this goal I
chose to post the same question, in three news groups thus extending
the range and quality of the replies.

Now that you know my perspective on the matter, I would like to hear
yours.


Again, thanks for your input.
 
A

Al-Burak

Thank you for your prompt response, I honestly appreciate your input.
However, you reply has also raised another question, and with all due
respect I would like to have your input on this matter as well.
First, I would like to let you know what I think of cross-posting this
question.
Say for instance that I have product to sell, and I want a broad
audience to know that this product exists, I would not put up a flyer
at the nearest bus-shelter, what I would do however is to advertise on
TV, radio, news paper, and yes flyers, but not only on one bus-shelter,
but in all bus-shelters I could place that flyer on, thus letting as
many people as possible know that my product exists.
Now, to bring my point home, I have a question and I would like to
reach out to as many as possible programmers who like yourself, have a
more extensive knowledge about the subject. To achieve this goal I
chose to post the same question, in three news groups thus extending
the range and quality of the replies.

Now that you know my perspective on the matter, I would like to hear
yours.

I apologize for any inconvenience this might have caused you and again,
thanks for your input.
 
D

Default User

Al-Burak wrote:

If I have product to sell, and I want a broad audience to know that
this product exists, I would not put up a flyer at the nearest
bus-shelter, what I would do however is to advertise on TV, radio,
news paper, and yes flyers, but only on one bus-shelter, but in all
possible bus-shelters, thus letting as many people as possible know
that my product exists.
Now, to bring my point home, I have a question and I would like to
reach out to as many as possible programmers who like yourself, have a
more extensive knowledge about the subject. To achieve this goal I
chose to post the same question, in three news groups thus extending
the range and quality of the replies.

Your analogy is flawed. You aren't paying for advertising, you are
asking for help. You are therefore expected to follow the rules of the
newsgroups that you are intruding upon.



Brian
 
J

John Ratliff

Al-Burak said:
Thank you for your prompt response, I honestly appreciate your input.
However, you reply has also raised another question, and with all due
respect I would like to have your input on this matter as well.
First, I would like to let you know what I think of cross-posted this
question.
If I have product to sell, and I want a broad audience to know that
this product exists, I would not put up a flyer at the nearest
bus-shelter, what I would do however is to advertise on TV, radio, news
paper, and yes flyers, but only on one bus-shelter, but in all possible
bus-shelters, thus letting as many people as possible know that my
product exists.
Now, to bring my point home, I have a question and I would like to
reach out to as many as possible programmers who like yourself, have a
more extensive knowledge about the subject. To achieve this goal I
chose to post the same question, in three news groups thus extending
the range and quality of the replies.

Now that you know my perspective on the matter, I would like to hear
yours.


Again, thanks for your input.

I was a n00b once myself, and asked off-topic questions in this very
group. I was treated to the same terse response I gave you (many have
been treated worse), and for that reason I'm sorry I was so rude. I
understand that newgroups may be new to some people and they may not
know where to ask questions or how to determine where to ask questions.
My own newsgroup server has some 30,000+ newsgroups, many of which have
names that suggest overlap in topic.

Allow me to educate you. First, nearly every newsgroup has what is
called a newsgroup FAQ. This FAQ answers common questions people might
have about the subject nature and more importantly, what subjects are
discussed on the newsgroup. comp.lang.c++ is dedicated to the standard
C++ language. This is documented in the comp.lang.c++ FAQ at:
http://www.parashift.com/c++-faq-lite/how-to-post.html#faq-5.9

You can find the entire comp.lang.c++ FAQ at
http://www.parashift.com/c++-faq-lite/

More generally, to find any FAQ for any newsgroup, you can go on
www.faqs.com, or just google. For example google comp.lang.c++ FAQ and
the FAQ for this newsgroup comes right up.

Now, you posted to three groups, comp.lang.c++, gnu.gcc.help, and
gnu.g++.help. Had you read any of the three FAQs, you would know that
none of them deal with your specific problem regarding MinGW and unistd.
I can't think of any specific groups that would be helpful, as I know of
no MinGW newsgroup, however, there is a MinGW mailing list, which you
can learn more about at http://www.mingw.org/lists.shtml

gcc/g++ has nothing to do with POSIX, which is where unistd comes in.
comp.lang.c++ has nothing to do with POSIX either. Since you want to
know why MinGW doesn't do something while cygwin and Linux do, I think
the MinGW mailing list would have been the best place to start. I'm not
sure how you came up with the three groups you posted to, but please
don't pick at random in the future.

Finally, cross-posting in general is considered rude. This is because it
means you didn't take the time to find out which newsgroup is really
suited to answer your question. If you can't be bothered to find out the
topic of the newsgroups, why should the people who take time to answer
questions for no compensation bother to assist you.

Finally, I will defend the newsgroup by saying the people who come here
do so to answer questions related to the topic of the newsgroup. They
can't spend all their time answering questions that are already answered
in the FAQ. This is the purpose of the FAQ.

I find it best to simply direct people to the comp.lang.c++ FAQ. I have
no idea why I decided to respond as I did, and for my rudeness, I do
apologize.

--John Ratliff
 
A

Al-Burak

Ah! the toad of the group.

Intruding, intruding! oh my "friend"... (lol) this is a public news
group and yes I was unaware of the rules and that is my excuse for my
mistake, what your excuse for your rudeness?
The shame is on you for treating so terribly bad a new comer.

Chang your user name to de-faul user, it suits you better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top