Opened 14 years ago
Last modified 8 years ago
#2660 reopened Library Submissions
`fd_set' has not been declared
Reported by: | Owned by: | az_sw_dude | |
---|---|---|---|
Milestone: | Website 1.X | Component: | xpressive |
Version: | Boost.Build-M3 | Severity: | Not Applicable |
Keywords: | Cc: | gvenkatsm@… |
Description
I'm using Boost.Thread and Boost.Asio on Cygwin.
If I include boost/thread.hpp, without boost/asio.hpp first, I get a compiler error:
In file included from /usr/include/cygwin/sys_time.h:13,
from /usr/include/sys/time.h:27, from D:/local/boost/include/boost-1_37/boost/date_time/c_time.hpp:28, from D:/local/boost/include/boost-1_37/boost/date_time/microsec_time_clock.hpp:18, from D:/local/boost/include/boost-1_37/boost/thread/thread_time.hpp:9, from D:/local/boost/include/boost-1_37/boost/thread/locks.hpp:12, from D:/local/boost/include/boost-1_37/boost/thread/pthread/mutex.hpp:11, from D:/local/boost/include/boost-1_37/boost/thread/mutex.hpp:16, from D:/local/boost/include/boost-1_37/boost/thread/pthread/thread_data.hpp:12, from D:/local/boost/include/boost-1_37/boost/thread/thread.hpp:17, from D:/local/boost/include/boost-1_37/boost/thread.hpp:13, from src/flightpath_controller.cpp:27:
/usr/include/sys/select.h:31: error: `fd_set' has not been declared /usr/include/sys/select.h:31: error: `fd_set' has not been declared /usr/include/sys/select.h:31: error: `fd_set' has not been declared /usr/include/sys/select.h:33: error: `fd_set' has not been declared /usr/include/sys/select.h:33: error: `fd_set' has not been declared /usr/include/sys/select.h:33: error: `fd_set' has not been declared make: * [build/flightpath_controller.o] Error 1
A workaround for this issue is to include boost/asio.hpp before boost/thread.hpp within the given sourcefile.
Change History (12)
follow-up: 2 comment:1 by , 14 years ago
Component: | None → thread |
---|---|
Owner: | set to |
comment:2 by , 14 years ago
Replying to steven_watanabe:
So to be clear, do you get an error from a file that contains only:
#include <boost/thread.hpp>
Yes.
follow-up: 4 comment:3 by , 14 years ago
Ok. It works for me.
Do you have any compiler flags beyond the absolute minimum:
g++ -I D:/local/boost/include/boost-1_37 -c minimal_test_file.cpp
Does the code compile if you include sys/select.h only? If so, can you find the closest file in the chain of #includes that causes an error.
follow-up: 5 comment:4 by , 14 years ago
Replying to steven_watanabe:
Ok. It works for me.
Do you have any compiler flags beyond the absolute minimum:
g++ -I D:/local/boost/include/boost-1_37 -c minimal_test_file.cppDoes the code compile if you include sys/select.h only? If so, can you find the closest file in the chain of #includes that causes an error.
Yes, it compiles.
If I add "-DUSE_W32_SOCKETS" to the compiler flags, the minimal file fails to compile.
comment:5 by , 14 years ago
Replying to Jens Luedicke <jens.luedicke@gmail.com>:
If I add "-DUSE_W32_SOCKETS" to the compiler flags, the minimal file fails to compile.
Thanks. I can reproduce the problem now.
follow-up: 7 comment:6 by , 14 years ago
I've just tested sys/select.h by itself and it fails for me. Are you sure that it compiles:
$ cat test.cpp #include <sys/select.h> $ g++ test.cpp -c -D__USE_W32_SOCKETS In file included from test.cpp:1: /usr/include/sys/select.h:31: error: `fd_set' has not been declared /usr/include/sys/select.h:31: error: `fd_set' has not been declared /usr/include/sys/select.h:31: error: `fd_set' has not been declared /usr/include/sys/select.h:33: error: `fd_set' has not been declared /usr/include/sys/select.h:33: error: `fd_set' has not been declared /usr/include/sys/select.h:33: error: `fd_set' has not been declared
follow-up: 8 comment:7 by , 14 years ago
Replying to steven_watanabe:
I've just tested sys/select.h by itself and it fails for me. Are you sure that it compiles:
As far as I can remeber it does not compile.
follow-up: 9 comment:8 by , 14 years ago
Component: | thread → date_time |
---|---|
Owner: | changed from | to
Replying to jens.luedicke@gmail.com:
Replying to steven_watanabe:
I've just tested sys/select.h by itself and it fails for me. Are you sure that it compiles:
As far as I can remeber it does not compile.
Sorry. I misinterpreted Yes, it compiles..
This seems to be a cygwin problem rather than a Boost problem as the error is caused by date_time's inclusion of sys/time.h.
comment:9 by , 14 years ago
Replying to steven_watanabe:
This seems to be a cygwin problem rather than a Boost problem as the error is caused by date_time's inclusion of sys/time.h.
Has this been communicated to the Cygwin development folks?
comment:10 by , 13 years ago
Cc: | added |
---|
It seems direct linking of windows libraries and inclusion of headers is not allowed in cygwin. For details its in the following link.
comment:11 by , 12 years ago
Resolution: | → invalid |
---|---|
Status: | new → closed |
comment:12 by , 8 years ago
Component: | date_time → xpressive |
---|---|
Milestone: | Boost 1.38.0 → Website 1.X |
Resolution: | invalid |
Severity: | Problem → Not Applicable |
Status: | closed → reopened |
Type: | Bugs → Library Submissions |
Version: | Boost 1.37.0 → Boost.Build-M3 |
Do you mind if I quote a few of your posts as long as I provide credit and sources back to your weblog? My blog is in the very same niche as yours and my users would truly benefit from a lot of the information you present here. Please let me know if this alright with you. Thank you! bekabcdkbedbckab
So to be clear, do you get an error from a file that contains only: