#freeaddrinfo and getaddrinfo unrecognized

19 messages · Page 1 of 1 (latest)

lime hamlet
#

Hi, i have a coding project for school using TinkerForge hardware. Some of their hardware pieces use freeaddrinfo and getaddrinfo in their header files, and seem to be necessary to run the code.
i have tried to get this working but my system seems to not know these functions at all, no matter what i try. these functions are supposed to be included on any windows system (which im using) so i have no idea why its not working for me
i have asked chatgpt and forums for help countless of times and even asked some friends who understand coding better than i do but they havent seemed to be able to figure it out either. im afraid theres something wrong with my winsock version or sum but tbh idk how to find out what exactly is the problem

mild juncoBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

blazing ingot
#

those are POSIX functions. i don't know if they 'supposed to be included on any windows system' as you claim

lime hamlet
#

ye i believe so

#

chatgpt has only told me to include them like 20 times lol

#

#include <winsock2.h>
#include <ws2tcpip.h>
#include <windows.h>``` 
these should be all that you really need
#

windows.h isnt even necessary i think

blazing ingot
lime hamlet
#

if u mean adding them to the gcc command then yes

blazing ingot
#

both of them? i.e. -lws2_32 -ladvapi32? whats the error message then?

sullen finch
#

What compiler are you using

#

GCC provided by MinGW/MSYS?

lime hamlet
#

Ye

sullen finch
#

What is the actual error? Can it not find the includes or is it undefined references?

lime hamlet
#

implicit declaration

sullen finch
#

Are you sure it's the Win32 freeaddrinfo and not the POSIX one?

#

And which MSYS shell are you using