Coder Social home page Coder Social logo

Failed to build on MSYS2 MINGW64 about c-ray HOT 4 OPEN

 avatar commented on June 28, 2024
Failed to build on MSYS2 MINGW64

from c-ray.

Comments (4)

vkoskiv avatar vkoskiv commented on June 28, 2024

Hey, thanks for reporting. Currently, the network protocol is not supported on Windows, as it assumes a Berkeley sockets style API.
I'm guarding the network code with a simple #ifndef WINDOWS. Reworking these guards is needed to get it building on MINGW environments.
I don't have a MINGW environment available, but the included instructions in the README on how to build natively on Windows should still work.

from c-ray.

 avatar commented on June 28, 2024

Hey, thanks for reporting. Currently, the network protocol is not supported on Windows, as it assumes a Berkeley sockets style API. I'm guarding the network code with a simple #ifndef WINDOWS. Reworking these guards is needed to get it building on MINGW environments. I don't have a MINGW environment available, but the included instructions in the README on how to build natively on Windows should still work.

Shouldn't it be #ifndef _WIN32? Your usage of #ifndef WINDOWS is wrong. This is the reason why <arpa/inet.h> is still included.

from c-ray.

 avatar commented on June 28, 2024

Oh I see, -DWINDOWS is added by you on your CMakeLists.txt. @vkoskiv What about replacing #ifndef WINDOWS in code with #ifndef _WIN32 so you will not need to define -DWINDOWS on CMakeLists.txt? Btw, please have a look at your CMakeLists.txt and add support for MinGW compiler. You could use if (MinGW) to check for MinGW on CMake. Currently you only check for MSVC so -DWINDOWS is not defined when building with MSYS2.

from c-ray.

vkoskiv avatar vkoskiv commented on June 28, 2024

Btw, please have a look at your CMakeLists.txt and add support for MinGW compiler.

I personally don't have a need for MinGW support, nor a test environment to implement that support, but I'd be happy to merge in those changes if someone else works on it.

from c-ray.

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.