saprykin / plibsys

Highly portable C system library: threads and synchronization primitives, sockets (TCP, UDP, SCTP), IPv4 and IPv6, IPC, hash functions (MD5, SHA-1, SHA-2, SHA-3, GOST), binary trees (RB, AVL) and more. Native code performance.
MIT License
684 stars 75 forks source link

Missing AF_INET definition on Windows #84

Closed Anh-Kagi closed 4 years ago

Anh-Kagi commented 4 years ago

I built the library using cygwin on Windows 10 x64, but when i use the compiled library, i get the following error when including plibsys.h:

libs\plibsys\include\psocketaddress.h 76 error: 'AF_INET' was not declared in this scope

I don't know if i compiled it correctly using cygwin, i just did the following:

mkdir build && cd build
cmake .. && cmake --build .
saprykin commented 4 years ago

Hi @Anh-Kagi , If the library was successfully compiled, then it shall be usable. Did you compile it in Cygwin environment? Can you also run tests in Cygwin after compiling the library by running make test in the build folder?

Anh-Kagi commented 4 years ago

yes i compiled in the cygwin environment, and i can run make test. I get 100% success on the 28 tests.

saprykin commented 4 years ago

Then the problem is in the way you are trying to use the library. How do you use it? Are you doing it inside Cygwin environment?

Anh-Kagi commented 4 years ago

Ok, i figured out where the problem was, some path to the cygwin compiler was broken inside code::block. I configured it correctly, and it now works.

Thanks a lot for the fast help!