Giter Site home page Giter Site logo

Compile problem about termcolor HOT 9 CLOSED

ikalnytskyi avatar ikalnytskyi commented on May 25, 2024
Compile problem

from termcolor.

Comments (9)

nabijaczleweli avatar nabijaczleweli commented on May 25, 2024

TDM-GCC is broken and outdated as all hell, I recommend using MSYS2 and GCC therefrom

from termcolor.

ikalnytskyi avatar ikalnytskyi commented on May 25, 2024

@naydef Hm.. I think the problem is that TDM-GCC tries to be compatible with *nix api and provide those sort of headers. Could you please check whether it defines either __unix__ or __unix macro? If so, please try to swap lines in OS detection code.

#if defined(__unix__) || defined(__unix)       // that line wasn't first
#   define TERMCOLOR_OS_LINUX
#elif defined(_WIN32) || defined(_WIN64)
#   define TERMCOLOR_OS_WINDOWS
#elif defined(__APPLE__)
#   define TERMCOLOR_OS_MACOS
#else
#   error unsupported platform
#endif

from termcolor.

naydef avatar naydef commented on May 25, 2024

No. They are not defined. The test code:

int main(int args, char *argv[])
{
    //std::cout << termcolor::red <<"Welcome to Steam Server Query Tool v" << SSQ_VERSION; //<< termcolor::reset;
    #ifdef __unix__
    std::cout << "__unix__" << std::end;
    #endif // __unix__

    #ifdef __unix
    std::cout << "__unix" << std::endl;
    #endif // __unix
    std::cout << "Hello" << std::endl;
    return EXIT_SUCCESS;
}

Prints:

Hello

Process returned 0 (0x0)   execution time : 0.024 s
Press any key to continue.

Replaced the code with the posted here and doesn't work. The same error

from termcolor.

nabijaczleweli avatar nabijaczleweli commented on May 25, 2024

I'm pretty sure this is TDM-GCC's trashiness :G

from termcolor.

ikalnytskyi avatar ikalnytskyi commented on May 25, 2024

@nabijaczleweli :D

@naydef please try to define it before including termcolor.hpp. It seems like TDD-GCC provides Nix API, thought it's strange it doesn't setup __unix macro.

from termcolor.

nabijaczleweli avatar nabijaczleweli commented on May 25, 2024

The __unix macro would break just about every non-trivial piece of code in existence

from termcolor.

naydef avatar naydef commented on May 25, 2024

@ikalnitsky, What? Where to define it? Anyway, I will try with tdm-gcc 5.1.0

from termcolor.

ikalnytskyi avatar ikalnytskyi commented on May 25, 2024

@naydef I'm not sure tdm-gcc 5.1.0 could fix that. It seems it doesn't have some implementation, or store them in other headers. I'm really sorry, I can't help ya now. I don't have any Windows machine near me. :(

I think the best thing you can do is to google where to find _fileno function in that compiler.

from termcolor.

naydef avatar naydef commented on May 25, 2024

You're right @ikalnitsky. Installed TDM-GCC 5.1.0 and now it compiles correctly and works. Thanks
I will close this issue

from termcolor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.