Menu

Compiling with Borland builder 6

Help
2012-06-10
2012-10-16
  • Swisstopher

    Swisstopher - 2012-06-10

    I have been attempting to compile MathGL on windows using a Borland builder 6
    after generating the makefile with Cmake. Almost immediately I get an error
    saying the the symbol 'NAN' is undefined. It appears to be defined in define.h
    and the error occurs in type.h. Has anyone else encountered this or have any
    ideas as what might be causing it, I'm not sure how it could be undefined.

    Thanks.

     
  • Alexey Balakin

    Alexey Balakin - 2012-06-10

    Hi,
    It look as Borland compiler don't define NAN (similarly to MS VisualStudio).
    So, if you give me the name of definition which Borland determines itself
    (like _MSC_VER for VisualStudio) then I add NAN definition for Borland
    compiler too.

    Alternatively you can just use

    #define NAN 0./0.
    

    This is formally correct but may produce a lot of warnings by compiler.

     
  • Swisstopher

    Swisstopher - 2012-06-11

    Hi,

    Thanks for the reply. Your workaround worked. I think that the predefined ID
    for Borland is BORLANDC.

    I have hit another problem which is the dependence on unistd.h. I believe this
    file is not used in windows (although I guess its in MinGW). Is there a
    windows equivalent of this or will copying the file from MinGW work? I'm not
    familliar enough which what it does to know.

    I'm guessing this would be easier if I compiled/downloaded binaries for MingGW
    although I guess I won't be able to link against a Borland Builer 6 project.

     
  • Alexey Balakin

    Alexey Balakin - 2012-06-14

    Thank you. I add BORLANDC everywhere -- with _MS_VER (as for MS
    VisualStudio).

    Concerning unistd.h. It is header file which contain some system routines
    (like chdir() or system()). I've just clean the code (SVN rev.461) for
    removing unused inclusion. All other places now use io.h and direct.h only.

    Note, that you can use existed win32 binaries as is -- just make .lib from
    .dll. But be careful with using MathGL widgets under Borland Builder. Most
    probably they will not work due to difference in naming and in event handling.

     

Log in to post a comment.

MongoDB Logo MongoDB