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
#freeaddrinfo and getaddrinfo unrecognized
19 messages · Page 1 of 1 (latest)
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.
those are POSIX functions. i don't know if they 'supposed to be included on any windows system' as you claim
huh. they do https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-getaddrinfo
https://learn.microsoft.com/en-us/windows/win32/api/ws2tcpip/nf-ws2tcpip-freeaddrinfo
i was wrong apparently. did you include the relavant header?
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
do you link them as well? https://www.tinkerforge.com/en/doc/Software/API_Bindings_C.html#api-bindings-c
if u mean adding them to the gcc command then yes
both of them? i.e. -lws2_32 -ladvapi32? whats the error message then?
Ye
What is the actual error? Can it not find the includes or is it undefined references?