Menu

MS Visual C++ support?

Help
2004-11-08
2013-03-19
  • Nobody/Anonymous

    Hi,

    Are there plans to support the MSVC compiler? Currently the situation is not good:

    1. No projects/workspace ot makefiles exist for it. Of course, one can still build a Windows executable using Cygwin, but that's rather unconvenient.

    2. The files output by asn1c cannot be compiled using MSVC. One issue is the usage of <inttypes.h> which MSVC 7.1 does not have. Is it possible to replace its use with something else?

     
    • Lev Walkin

      Lev Walkin - 2004-11-12

      Everything is quite possible.

      However, as I do not have the Windows system on my
      hands, supporting MSVC for the compiler is tricky.
      That is, if you want to build the asn1c compiler with MSVC,
      you probably will have to make it yourself. If you can show
      me what changes are required in asn1c build structure to
      support MSVC, I'll consider merging them in into asn1c distribution.

      Yet, I don't think that it is important to support asn1c
      compilation under MSVC: it can be done once per release
      to make a Windows binary, and then this binary would be
      distributed along with Unix sources. Does it make sense?

      The more important problem is inability of MSVC to compile
      the standard ISO C output from asn1c. There are two
      problems with it: the first one you've already discovered
      (the <inttypes.h> stuff), and the second being the problems
      supporting timegm()/gmtime() on that platform.

      However, both problems are easy to fix. The asn1c compiler
      produces two sets of files:
      1. The result of ASN.1 module compilation and
      2. The supporting code for BER/DER/XER codecs.

      The #1 output from asn1c compiler rarely has any
      difficulties to be compiled by MSVC.
      The #2 output is not strictly a compiler's output. The
      compiler just copies the existing sources from ./skeletons
      into the destination projects's folder.

      If you want <inttypes.h> thing to be fixed, just fix the
      sources inside ./skeletons, and make it a library (.dll).
      Then, use compiler with -R flag (asn1c -R <files>) to
      generate only #1 type of output. Then, tell MSVC to
      compile the #1 asn1c output together with the .dll library
      made on the previous step.

      If you want to have these <inttypes.h> changes make
      its way into the standard asn1c sources, please give
      me the diffs.

       

Log in to post a comment.

MongoDB Logo MongoDB