Kostenloser SFML compiler



  • Ok, es reicht nach inzwischen ungefähr 20 Fragen zum Thema SFML in Code::Blocks oder in Visual Studio zu installieren und einen Fehler der unmöglich möglich wäre nach dem anderen gebe ich nun endgültig auf also jetzt zur Frage

    Kennt irgendwer einen guten Compiler für C++ auf dem SFML vorinstalliert ist wenn ja bitte schreibt mir den Namen des Compilers wenn es funktioniert wäre ich sehr dankbar 😉
    LG Fuchsi



  • Solchen 'Compiler' gibt es nicht. Ein kompiler ist ein Programm, der dein Programm übersetzt, der Linker mixt dann verschiedene übersetzte module in ein fertiges programm oder bibliothek. Und hier solltest du ansetzen: Im Grunde brauchst du nur allen Code, bzw bei platformspezifischem code für windows etc eben nur den der ausgewählten platform, in ein projekt, zb für vs oder c::b, tun, das ziel als statische bibliothek oder dll setzen und play drücken.
    Es wäre wichtig, die Fehlermeldungen, die dich abhalten, mal zu posten.

    Für sfml gibt es bereits vorkompilierte bibliotheken: http://www.sfml-dev.org/download/sfml/2.3.2/



  • Die Fehler hab ich schon mehrmals gepostet allerdings sind z.b die letzten Fehler bei c::b nachdem ich das "Testprogramm" von SFML getestet habe (vl kennst du es ja es soll einen grünen Kreis erstellen) auf jeden fall sind die Fehlermeldungen aufgetaucht das
    A) namespace nicht erkannt wird allerding nur in der config.hpp
    und
    😎 danach ein ; oder etc. erwartet wird darauf hab ích genau die Fehlermeldungen befolgt und nach namespace sf ein ; gesetzt nur hat das nichts geändert an der Fehlermeldung...

    C) Ich hatte einen Schreibfehler übersehen und zwar SFML-Windows und nicht window und besserte es darauf aus das Resultat waren 22 Fehlermeldung und sf:: irgendwas wurde generell nicht mehr erkannt

    D) ostream wird nicht erkannt

    Bei VisualStudio

    War das Problem das im Programmfolder immer ein 2. Folder mit dem namen des Programms aufgetaucht hat und so alle ordner ungeordnet waren
    KA wo man das Reparieren sollte....

    Hier noch der Code von Codeblocks

    //main.c
    
    #include <SFML/Graphics.hpp>
    
    int main()
    {
        sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
        sf::CircleShape shape(100.f);
        shape.setFillColor(sf::Color::Green);
    
        while (window.isOpen())
        {
            sf::Event event;
            while (window.pollEvent(event))
            {
                if (event.type == sf::Event::Closed)
                    window.close();
            }
    
            window.clear();
            window.draw(shape);
            window.display();
        }
    
        return 0;
    }
    

    und hier die confi

    //config.hpp
    ////////////////////////////////////////////////////////////
    //
    // SFML - Simple and Fast Multimedia Library
    // Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
    //
    // This software is provided 'as-is', without any express or implied warranty.
    // In no event will the authors be held liable for any damages arising from the use of this software.
    //
    // Permission is granted to anyone to use this software for any purpose,
    // including commercial applications, and to alter it and redistribute it freely,
    // subject to the following restrictions:
    //
    // 1. The origin of this software must not be misrepresented;
    //    you must not claim that you wrote the original software.
    //    If you use this software in a product, an acknowledgment
    //    in the product documentation would be appreciated but is not required.
    //
    // 2. Altered source versions must be plainly marked as such,
    //    and must not be misrepresented as being the original software.
    //
    // 3. This notice may not be removed or altered from any source distribution.
    //
    ////////////////////////////////////////////////////////////
    
    #ifndef SFML_CONFIG_HPP
    #define SFML_CONFIG_HPP
    
    ////////////////////////////////////////////////////////////
    // Define the SFML version
    ////////////////////////////////////////////////////////////
    #define SFML_VERSION_MAJOR 2
    #define SFML_VERSION_MINOR 0
    
    ////////////////////////////////////////////////////////////
    // Identify the operating system
    ////////////////////////////////////////////////////////////
    #if defined(_WIN32) || defined(__WIN32__)
    
        // Windows
        #define SFML_SYSTEM_WINDOWS
        #ifndef NOMINMAX
            #define NOMINMAX
        #endif
    
    #elif defined(linux) || defined(__linux)
    
        // Linux
        #define SFML_SYSTEM_LINUX
    
    #elif defined(__APPLE__) || defined(MACOSX) || defined(macintosh) || defined(Macintosh)
    
        // MacOS
        #define SFML_SYSTEM_MACOS
    
    #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
    
        // FreeBSD
        #define SFML_SYSTEM_FREEBSD
    
    #else
    
        // Unsupported system
        #error This operating system is not supported by SFML library
    
    #endif
    
    ////////////////////////////////////////////////////////////
    // Define a portable debug macro
    ////////////////////////////////////////////////////////////
    #if !defined(NDEBUG)
    
        #define SFML_DEBUG
    
    #endif
    
    ////////////////////////////////////////////////////////////
    // Define helpers to create portable import / export macros for each module
    ////////////////////////////////////////////////////////////
    #if !defined(SFML_STATIC)
    
        #if defined(SFML_SYSTEM_WINDOWS)
    
            // Windows compilers need specific (and different) keywords for export and import
            #define SFML_API_EXPORT __declspec(dllexport)
            #define SFML_API_IMPORT __declspec(dllimport)
    
            // For Visual C++ compilers, we also need to turn off this annoying C4251 warning
            #ifdef _MSC_VER
    
                #pragma warning(disable : 4251)
    
            #endif
    
        #else // Linux, FreeBSD, Mac OS X
    
            #if __GNUC__ >= 4
    
                // GCC 4 has special keywords for showing/hidding symbols,
                // the same keyword is used for both importing and exporting
                #define SFML_API_EXPORT __attribute__ ((__visibility__ ("default")))
                #define SFML_API_IMPORT __attribute__ ((__visibility__ ("default")))
    
            #else
    
                // GCC < 4 has no mechanism to explicitely hide symbols, everything's exported
                #define SFML_API_EXPORT
                #define SFML_API_IMPORT
    
            #endif
    
        #endif
    
    #else
    
        // Static build doesn't need import/export macros
        #define SFML_API_EXPORT
        #define SFML_API_IMPORT
    
    #endif
    
    ////////////////////////////////////////////////////////////
    // Define portable fixed-size types
    ////////////////////////////////////////////////////////////
    namespace sf
    {
        // All "common" platforms use the same size for char, short and int
        // (basically there are 3 types for 3 sizes, so no other match is possible),
        // we can use them without doing any kind of check
    
        // 8 bits integer types
        typedef signed   char Int8;
        typedef unsigned char Uint8;
    
        // 16 bits integer types
        typedef signed   short Int16;
        typedef unsigned short Uint16;
    
        // 32 bits integer types
        typedef signed   int Int32;
        typedef unsigned int Uint32;
    
        // 64 bits integer types
        #if defined(_MSC_VER)
            typedef signed   __int64 Int64;
            typedef unsigned __int64 Uint64;
        #else
            typedef signed   long long Int64;
            typedef unsigned long long Uint64;
        #endif
    
    } // namespace sf
    
    #endif // SFML_CONFIG_HPP
    

    Also wenn du irgendeine Ahnung hast wie man das fixxen sollte wär ich dir unbeschreiblich dankbar soweit ich es überhaupt verstehe.... Aber ich bin nicht sehr Optimistisch 😞



  • Und die Bibliotheken benutz ich bereits :C



  • Benenne mal die main.c in main.cpp um.



  • Hab ich schon 2 * gemacht... 😞



  • Wenn du sie schon zweimal umbenannt hast, heißt das, dass du ja auch zwei Dateien hast. Wieviele main.c hast Du noch?

    War das Problem das im Programmfolder immer ein 2. Folder mit dem namen des Programms aufgetaucht hat und so alle ordner ungeordnet waren
    KA wo man das Reparieren sollte....

    Hä?


Anmelden zum Antworten