While trying to compile in Debian SID,
g++ -O2 -Wall -Wl,-Bsymbolic-functions sixad-bin.cpp bluetooth.cpp shared.cpp textfile.cpp -o bins/sixad-bin `pkg-config --cflags --libs bluez` -lpthread -fpermissive
sixad-bin.cpp: In function ‘int main(int, char**)’:
sixad-bin.cpp:84:20: warning: taking address of temporary [-fpermissive]
sixad-bin.cpp:89:18: error: ‘close’ was not declared in this scope
sixad-bin.cpp:100:20: error: ‘sleep’ was not declared in this scope
sixad-bin.cpp:109:22: error: ‘close’ was not declared in this scope
sixad-bin.cpp:117:22: error: ‘close’ was not declared in this scope
sixad-bin.cpp:140:18: error: ‘close’ was not declared in this scope
sixad-bin.cpp:144:14: error: ‘close’ was not declared in this scope
bluetooth.cpp: In function ‘void do_connect(int, bdaddr_t*, bdaddr_t*, int)’:
bluetooth.cpp:104:30: error: ‘close’ was not declared in this scope
bluetooth.cpp:110:24: error: ‘dup2’ was not declared in this scope
bluetooth.cpp:111:22: error: ‘close’ was not declared in this scope
bluetooth.cpp: In function ‘int l2cap_listen(const bdaddr_t*, short unsigned int, int, int)’:
bluetooth.cpp:148:17: error: ‘close’ was not declared in this scope
bluetooth.cpp:162:17: error: ‘close’ was not declared in this scope
bluetooth.cpp: In function ‘void l2cap_accept(int, int, int, int, int)’:
bluetooth.cpp:195:26: error: ‘close’ was not declared in this scope
bluetooth.cpp:201:26: error: ‘close’ was not declared in this scope
bluetooth.cpp:221:26: error: ‘fork’ was not declared in this scope
bluetooth.cpp:228:32: error: ‘dup2’ was not declared in this scope
bluetooth.cpp:229:30: error: ‘close’ was not declared in this scope
bluetooth.cpp:242:57: error: ‘execve’ was not declared in this scope
bluetooth.cpp:254:26: error: ‘close’ was not declared in this scope
bluetooth.cpp: In function ‘int l2cap_connect(bdaddr_t*, bdaddr_t*, short unsigned int)’:
bluetooth.cpp:274:25: error: ‘close’ was not declared in this scope
bluetooth.cpp:291:25: error: ‘close’ was not declared in this scope
make[1]: *** [sixad_bins] Error 1
make[1]: Leaving directory `/home/nanakos/QtSixA-1.5.1/sixad'
I also had this issue, the patch fixed it for me. I had to apply the patch manually, the patch file didn't like me. :D