19 Nov 2013, 19:44
Generic-user-small

Andy Wang (1 post)

I’ve been trying to build the port library example in windows.

While compiling the port driver in cygwin fails, I tried to compile with MSVC’s cl. After including the header erl_win_dyn_driver.h, I got a bunch of errors.

c:\cygwin\home\awang\code\ports>cl /MD /LD /Ic:\erl5.10.3\lib\erl-interface-3.7.14\include /Ic:\erl5.10.3\erts-5.10.3\include /Feexample1_drv.dll example1.c example1_lid.c
Microsoft (R) C/C++ Optimizing Compiler Version 17.00.61030 for x86
Copyright (C) Microsoft Corporation.  All rights reserved.

example1.c
example1_lid.c
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(40) : error C2143: syntax error : missing ')' before '*'
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(40) : error C2081: 'ErlDrvSizeT' : name in formal parameter list illegal
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(40) : error C2143: syntax error : missing '{' before '*'
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(40) : error C2059: syntax error : ','
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(40) : error C2059: syntax error : ')'
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(43) : error C2081: 'ErlDrvSizeT' : name in formal parameter list illegal
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(44) : error C2081: 'ErlDrvSizeT' : name in formal parameter list illegal
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(45) : error C2143: syntax error : missing ')' before '*'
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(45) : error C2081: 'ErlDrvSizeT' : name in formal parameter list illegal
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(45) : error C2081: 'ErlDrvBinary' : name in formal parameter list illegal
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(45) : error C2143: syntax error : missing '{' before '*'
c:\erl5.10.3\erts-5.10.3\include\erl_win_dyn_driver.h(45) : error C2059: syntaxerror : ','
...

This is not just for this particular example. Throughout the book, the examples are written exclusively for *nix environment with little or no documentation regarding windows build.

I checked the erlang.org online documentation and their examples and this is a common issue.

Is that possible that we can have some general documentation for windows build environment? Especially regarding ports, drivers and nifs.

I’m a linux person. Due to organization network setup, my distributed system can only run in windows and erlang distributed nodes can’t see each other across machines under our DNS server. In short, I need that documentation.

Thanks.

Andy

  You must be logged in to comment