Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use UDP sockets: unresolved external symbol #76

Open
goldeneas opened this issue Mar 3, 2023 · 3 comments
Open

Cannot use UDP sockets: unresolved external symbol #76

goldeneas opened this issue Mar 3, 2023 · 3 comments

Comments

@goldeneas
Copy link

When I try to create an UDP socket using this library an unresolved external symbol errors pops up. However this does not happen if I try to create a TCP socket.
What should I do?

@fpagliughi
Copy link
Owner

Perhaps it would be helpful if you show us the error.

@goldeneas
Copy link
Author

here it is:
https://snipboard.io/Do9Ubm.jpg

@fpagliughi
Copy link
Owner

OK. It's better if you paste in the text of the sample and error(s) rather than adding an image or a link.

So a trivial UDP example (on Windows x64) that creates and binds an IPv4 UDP socket is complaining that sockpp::datagram_socket::create_handle(int, int) is missing.

That's odd... the function is completely defined in the header:

static socket_t create_handle(int domain, int protocol=0) {
return socket_t(::socket(domain, COMM_TYPE, protocol));
}

Plus this same idea is implemented in the UDP echo server example which, last I checked, compiles and run fine on Windows.

sockpp::udp_socket udpsock;
if (!udpsock) {
cerr << "Error creating the UDP v4 socket: " << udpsock.last_error_str() << endl;
return 1;
}
if (!udpsock.bind(sockpp::inet_address("localhost", port))) {
cerr << "Error binding the UDP v4 socket: " << udpsock.last_error_str() << endl;
return 1;
}

So far, I can't think of what would cause this, but I can test it from a stand-alone app to see if it does anything weird.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants