file lock in MinGW

Y

yazwas

Hello All,

I'm trying to lock a file under windows, using MinGW, I'm using the
same code I use under Linux, but it keeps giving me errors like

aggregate `flock fl' has incomplete type and cannot be defined
`F_SETLK' undeclared (first use this function
`fcntl' undeclared (first use this function

does any one have any idea,
I'm using MinGW gcc 3.2.3

thankx for your time
 
R

red floyd

yazwas said:
Hello All,

I'm trying to lock a file under windows, using MinGW, I'm using the
same code I use under Linux, but it keeps giving me errors like

aggregate `flock fl' has incomplete type and cannot be defined
`F_SETLK' undeclared (first use this function
`fcntl' undeclared (first use this function

does any one have any idea,
I'm using MinGW gcc 3.2.3

My guess is that you're missing a header (probably fcntl.h), but since
flock and fcntl aren't part of Standard C++ per ISO/IEC 14882:2003,
you're better off asking in a g++ newsgroup, such as gnu.g++.help.

Note that I've cross-posted the response there, and set follow-ups there
as well.
 

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,773
Messages
2,569,594
Members
45,119
Latest member
IrmaNorcro
Top