0

Compiling the following code on DJGPP with GCC 6.1.0

#include <cmath>
int main() {}

results in the following error:

In file included from c:/djgpp/include/cxx/6.10/cmath:42:0,
                 from MAIN.CPP:1:
c:/djgpp/include/cxx/6.10/bits/cpp_type_traits.h:162:7: error: expected unqualified-id at end of input
       typedef __true_type __type;
       ^~~~~~~
c:/djgpp/include/cxx/6.10/bits/cpp_type_traits.h:162:7: error: expected '}' at end of input
c:/djgpp/include/cxx/6.10/bits/cpp_type_traits.h:162:7: error: expected '}' at end of input
c:/djgpp/include/cxx/6.10/bits/cpp_type_traits.h:162:7: error: expected '}' at end of input
c:/djgpp/include/cxx/6.10/bits/cpp_type_traits.h:162:7: error: unterminated #ifndef
MAIN.CPP: file not recognized: File format not recognized
collect2.exe: error: ld returned 1 exit status

Everything around cpp_type_traits.h:162 looks normal:

  template<>
    struct __is_integer<unsigned char>
    {
      enum { __value = 1 };
      typedef __true_type __type;
    };

What's going wrong?

Ross Ridge
  • 38,414
  • 7
  • 81
  • 112
Emil Laine
  • 41,598
  • 9
  • 101
  • 157
  • Why the downvote? Anything I could improve? – Emil Laine Aug 12 '16 at 19:52
  • 1
    You can copy and paste the output by redirecting the output to a file and then using an editor outside of DOSBox to copy the text. You can use DJGPP's `redir` utility to redirect both standard output and standard error to a file. eg. `redir -o err.txt -eo make`. You should also show the error messages you're getting when you compile the example you gave that reproduces the error. – Ross Ridge Aug 13 '16 at 07:07
  • What commands are you using to get those errors? – Ross Ridge Aug 13 '16 at 14:53
  • @RossRidge `gxx main.cpp` – Emil Laine Aug 13 '16 at 14:53
  • Hmm... that command shouldn't try to both compiler and link `MAIN.CPP`. You might want to try testing this under something else other than DOSBox. You might also want to try changing the `core` setting under `[cpu]` in the DOSBox config file. – Ross Ridge Aug 13 '16 at 15:01
  • Hey, setting `core` to `normal` or `simple` makes it work! – Emil Laine Aug 13 '16 at 15:11

0 Answers0