简体   繁体   中英

How to I tell em++ to find WS2tcpip.h

Trying to make a whois tcp lookup that directly queries verisign via port 43. Got it to work in command line + visual studio community 2017.

When I try to use em++ to compile it, I get an error.

C:\Users\Samuel Walker\source\repos\Barebones_Client\Barebones_Client>em++ -O3 --emrun -s WASM=1 -o main.html main.cpp
main.cpp:3:10: fatal error: 'WS2tcpip.h' file not found
#include <WS2tcpip.h>
         ^~~~~~~~~~~~
1 error generated.
ERROR:root:compiler frontend failed to generate LLVM bitcode, halting

I'm using WS2tcpip.h for the script. It's essential, but yeah still entirely new to C++ and following guides and snippets online. Is this a matter of somehow telling enscripten to know where windows header files are or am I completely off?

You cannot. WS2tcpip.h is part of the Windows API, which is not available in the browser.

You can make HTTP requests from JavaScript, but there are no generic sockets to be able to make requests using the WHOIS protocol. You will need to contact a web server that offers an API for making WHOIS requests. Also see this question and its answers: Whois with JavaScript

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM