Code Monkey home page Code Monkey logo

Comments (10)

raysan5 avatar raysan5 commented on May 28, 2024

It seems related to VS configuration, I'm using raygui to create tools with Visual Studio and it works ok.

from raygui.

sduman avatar sduman commented on May 28, 2024

I've used the out of the box scripts for raylib to generate the project templates. Could you share what configuration you're using for visual studio to bypass the warnings?

This is very easily reproducible by just trying to compile raylib in any version of VS as part of a C++ project.

from raygui.

raysan5 avatar raysan5 commented on May 28, 2024

@sduman Sorry, I closed it too quickly.

from raygui.

Skytrias avatar Skytrias commented on May 28, 2024

yep sadly unusable in c++ as far as it seems.

getting lots of warnings about { 0 } being used, Types in brackets like (Vector2) or (Rectangle).
also conversions from int to float about 30 errors.
sadly my errors are on german so wont help much to show them

id really like to use raygui!

from raygui.

Skytrias avatar Skytrias commented on May 28, 2024

also doesnt work with extern "C" { #include "raygui.h" }

from raygui.

raysan5 avatar raysan5 commented on May 28, 2024

Tested with g++, lots of warnings but it compiles fine.

Not tested with MSVC just yet.

from raygui.

Skytrias avatar Skytrias commented on May 28, 2024

was using msvc soory shouldve pointed that out

from raygui.

simonwashere avatar simonwashere commented on May 28, 2024

With the include done like this:

#pragma warning( push, 0 )
#pragma warning( disable : 4576 )
#define RAYGUI_IMPLEMENTATION
#define RAYGUI_STANDALONE
#define RAYGUI_STATIC
#include "raygui.h"
#pragma warning( pop )

compiling using visual studio command line tools works as C code, for C++ I get these errors:

raygui.h(1193): error C2397: conversion from 'int' to 'float' requires a narrowing conversion
raygui.h(1495): error C2397: conversion from 'int' to 'float' requires a narrowing conversion
raygui.h(1496): error C2397: conversion from 'int' to 'float' requires a narrowing conversion
raygui.h(1497): error C2397: conversion from 'int' to 'float' requires a narrowing conversion
raygui.h(3971): error C2397: conversion from 'float' to 'int' requires a narrowing conversion
raygui.h(3977): error C2397: conversion from 'float' to 'int' requires a narrowing conversion

It doesn't matter to me because I am using C, but putting it here in case it helps.

from raygui.

raysan5 avatar raysan5 commented on May 28, 2024

MSVC conversion errors are just warnings in g++, they can probably be avoided with an explicit cast.

Warning 4576 is related to compound literals, a C99 feature apparently not supported by C++, despite it works with g++ and clang++. Not sure if disabling 4576 it's enough to work on MSVC C++.

from raygui.

SasLuca avatar SasLuca commented on May 28, 2024

I did a pull request in which I made raygui.h compatible with C++.
In case anyone wants to use raygui.h with C++ you can look at my fork:
https://github.com/SasLuca/raygui
#44

from raygui.

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.