Problem with FD_ZERO on raspberry pi

Problem solved. Don't use a variable with the same name as a typedef (fd_set)

Sorry bothering anyone.
Wim.

Hello,

I ran into a problem which on my rapsberry pi.
FD_ZERO somehow fails to compile.
On an ubuntu machine it is not a problem.
I have searched for this problem but could not find any hint.
Does anybody have any idea what the problem might be.

Kind regards,
Wim.

pi@Raspie ~/omxd $ cat tst.cc
#include <sys/types.h>
#include <sys/socket.h>
#include <stdlib.h>


using namespace std;


int main() {
fd_set master_set;
fd_set fd_set;
FD_ZERO(&master_set);
FD_ZERO(&fd_set);
}
pi@Raspie ~/omxd $ make tst
g++ -O2 -Wall -std=c++0x tst.cc -o tst
tst.cc: In function ‘int main()’:
tst.cc:12:3: error: ‘__arr’ was not declared in this scope
tst.cc:13:3: error: ‘__arr’ was not declared in this scope
make: *** [tst] Error 1

Last edited on
 
#include <sys/select.h> 

But you should have it in sys/types.h. I'll double check later today.

EDIT: What OS are you running? If Linux, what disto?
Last edited on
Topic archived. No new replies allowed.