Compilling MathGL with CMAKE on Windows 10 64 bits ERROR unistd.h

76 views
Skip to first unread message

Claudemir Mastelaro

unread,
Nov 23, 2017, 8:01:16 AM11/23/17
to MathGL
Hi everyone !

i'm trying to compile MathGL with CMAKE on my Windows 10 64 bits and i got an error because the file font.cpp includes unistd.h (unix include) without check the operational system
all external options are disabled and the error was:

C:\Users\cmast\Downloads\mathgl-2.4.1\src\font.cpp(23): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.

i have changed the code to not use unistd instead 

#include <stdlib.h>
#include <io.h>
#include <getopt.h>
#include <process.h>
#include <direct.h>

and now another error on prim.cpp (1088)

C:\Users\cmast\Downloads\mathgl-2.4.1\src\prim.cpp(1189): error C2131: expression did not evaluate to a constant
C:\Users\cmast\Downloads\mathgl-2.4.1\src\prim.cpp(1189): note: failure was caused by non-constant arguments or reference to a non-constant symbol
C:\Users\cmast\Downloads\mathgl-2.4.1\src\prim.cpp(1189): note: see usage of 'm'
C:\Users\cmast\Downloads\mathgl-2.4.1\src\prim.cpp(1191): error C3863: array type 'HMDT [m]' is not assignable
C:\Users\cmast\Downloads\mathgl-2.4.1\src\prim.cpp(1204): error C2664: 'void mgl_plot_xy(HMGL,HCDT,HCDT,const char *,const char *)': cannot convert argument 2 from 'HMDT [m]' to 'HCDT'
C:\Users\cmast\Downloads\mathgl-2.4.1\src\prim.cpp(1204): note: Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
C:\Users\cmast\Downloads\mathgl-2.4.1\src\prim.cpp(1221): warning C4156: deletion of an array expression without using the array form of 'delete'; array form substituted
C:\Users\cmast\Downloads\mathgl-2.4.1\src\prim.cpp(1221): warning C4154: deletion of an array expression; conversion to pointer supplied
NMAKE : fatal error U1077: 'C:\PROGRA~2\MICROS~1.0\VC\bin\amd64\cl.exe' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\BIN\amd64\nmake.exe"' : return code '0x2'

Alexey Balakin

unread,
Nov 27, 2017, 12:17:56 PM11/27/17
to mat...@googlegroups.com
Dear Claudemir!

I'm sorry for delay with answer -- I was too overwhelmed during last week.

About yours problem. It look as novel versions of MSVS don't define WIN32 (but should according the documentation). Contrary, they define _WIN32. So, the solution is manually pass definition WIN32, or use the latest version from SVN (I hope it was fixed a few days ago).

Kind regards,
Alexey Balakin

23.11.2017 15:11, Claudemir Mastelaro пишет:
--
You received this message because you are subscribed to the Google Groups "MathGL" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathgl+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
Kind regards,
Alexey Balakin
Reply all
Reply to author
Forward
0 new messages