fork download
  1. #include <string>
  2. #include <map>
  3.  
  4. enum class toolchain
  5. {
  6. GNU, // GCC+GNU binutils
  7. Microsoft, // cl.exe and link.exe
  8. LLVM, // Clang+GNU binutils (may change later)
  9. Intel // ICC+platform linker
  10. // ...
  11. };
  12.  
  13. enum class generator_string
  14. {
  15. compiler, // compiler program name (without target prefixes)
  16. linker, // linker program name
  17. output_argument, // precedes output file name
  18. compile_argument, // compile to object file
  19. };
  20.  
  21. typedef std::map<toolchain, std::map<generator_string, std::string> > generator_map;
  22.  
  23. const generator_map cgenerator_map =
  24. { { toolchain::GNU,
  25. { {generator_string::compiler, "gcc"},
  26. {generator_string::linker, "gcc"},
  27. {generator_string::output_argument, "-o"},
  28. {generator_string::compile_argument, "-c"} } },
  29. { toolchain::Microsoft,
  30. { {generator_string::compiler, "cl"},
  31. {generator_string::linker, "link"},
  32. {generator_string::output_argument, ""},
  33. {generator_string::compile_argument, "/c"} } },
  34. { toolchain::LLVM,
  35. { {generator_string::compiler, "clang++"} } },
  36. { toolchain::Intel,
  37. { {generator_string::compiler, "icc"} } } };
  38.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../crt1.o: In function `_start':
(.text+0x18): undefined reference to `main'
collect2: ld returned 1 exit status
stdout
Standard output is empty