Julia Embedding in Windows (winsock2.h not found)



What more directories should I include? And will Julia embedding work with visual studio’s compiler?
This is actually for an interface for Scilab, a language like Matlab.
I used cflags, ldflags, ldlibs from julia-config.jl file.

This is the command used

cl -D__MSC__ -DFORDLL -D_WIN64 -c -DSTRICT -D_CRT_SECURE_NO_DEPRECATE -D__MAKEFILEVC__ -nologo -I"C:/PROGRA~1/SCILAB~1.2/libs/MALLOC/includes"  -I"C:/PROGRA~1/SCILAB~1.2/libs/f2c"  -I"C:/PROGRA~1/SCILAB~1.2/libs/hashtable"  -I"C:/PROGRA~1/SCILAB~1.2/libs/intl"  -I"C:/PROGRA~1/SCILAB~1.2/modules/core/includes"  -I"C:/PROGRA~1/SCILAB~1.2/modules/api_scilab/includes"  -I"C:/PROGRA~1/SCILAB~1.2/modules/call_scilab/includes"  -I"C:/PROGRA~1/SCILAB~1.2/modules/output_stream/includes"  -I"C:/PROGRA~1/SCILAB~1.2/modules/jvm/includes"  -I"C:/PROGRA~1/SCILAB~1.2/modules/localization/includes"  -I"C:/PROGRA~1/SCILAB~1.2/modules/dynamic_link/includes"  -I"C:/PROGRA~1/SCILAB~1.2/modules/mexlib/includes"  -I"C:/PROGRA~1/SCILAB~1.2/modules/time/includes"  -I"C:/PROGRA~1/SCILAB~1.2/modules/windows_tools/includes" -W3 -Gd -Z7 -O2 -MD -DNDEBUG /Fo"Release/" /Fd"Release/" -D__SCILAB_TOOLBOX__ -DFORDLL -DJULIA_ENABLE_THREADING=1 -DJULIA_INIT_DIR="I:\scilab-julia-interface\thirdparty\Windows\julia\lib" -I"I:\scilab-julia-interface\thirdparty\Windows\julia\include\julia" bool_conv.c

It gives this error.
fatal error C1083: Cannot open include file: 'winsock2.h': No such file or directory

Btw, I’m using Windows 10 as a matter of fact.


Yes, visual studio should work. I’ve done basic tests with c++ and c# in vs2015 recently (on phone, please look in the embedding tag for convo). That missing header is not a julia problem. Calling cl directly is not usually recommended; to get the proper directories either create a VS project, or use cmake, or check stackoverflow, or use ctrl-f in the sdk directory.

Also note that you need 8mb stack for 0.6.


Actually I can’t use Visual Studio, this compilation is done by Scilab, I can only add more flags. And I’m using 0.5. I’ll try using Visual Studio and get the directories. Thank you.


First step should often be “google the error message”. e.g.

(the mentioned variables should be defined in the vs2015 command prompt)