ocornut / imgui

Dear ImGui: Bloat-free Graphical User interface for C++ with minimal dependencies
MIT License
60.55k stars 10.23k forks source link

[c++]<fstream> conflict with imgui #1699

Closed AMBULATUR closed 6 years ago

AMBULATUR commented 6 years ago

Have some troubles with connecting ImGui to project. https://i.imgur.com/Ah9EEDj.png When i connect ImGui to Build , and try make object

#define _CRT_SECURE_NO_WARNINGS
#include "menu.h"
#include <fstream>
#include <SFML/Graphics/RenderWindow.hpp>
#include <SFML/System/Clock.hpp>
#include <SFML/Window/Event.hpp>

using namespace std;
fstream wObj;
class Game {
private:
public:
    Game()
    {
        sf::RenderWindow window(VideoMode(0, 0), "TextQuest", Style::Fullscreen);
        window.setVerticalSyncEnabled(true);
        Vector2u WindowVector = window.getSize();
        ImGui::CreateContext();
        menu(window, WindowVector);
    };
}; 

int main()
{
    Game run;
    return 0;
}

then compile project i receive some errors https://i.imgur.com/dDtXSH9.png

> 1>------ Build started: Project: TextQuestC, Configuration: Release x64 ------
> 1>main.cpp
> 1>Generating code
> 1>LINK : fatal error C1001: An internal error has occurred in the compiler.
> 1>(compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 258)
> 1> To work around this problem, try simplifying or changing the program near the locations listed above.
> 1>Please choose the Technical Support command on the Visual C++
> 1> Help menu, or open the Technical Support help file for more information
> 1>  link!InvokeCompilerPass()+0x1f204
> 1>  link!InvokeCompilerPass()+0x1f204
> 1>  link!InvokeCompilerPass()+0x1ec1e
> 1>  link!DllGetC2Telemetry()+0xd853a
> 1>
> 1>LINK : fatal error C1001: An internal error has occurred in the compiler.
> 1>(compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 258)
> 1> To work around this problem, try simplifying or changing the program near the locations listed above.
> 1>Please choose the Technical Support command on the Visual C++
> 1> Help menu, or open the Technical Support help file for more information
> 1>  link!InvokeCompilerPass()+0x1f204
> 1>  link!InvokeCompilerPass()+0x1ec1e
> 1>  link!DllGetC2Telemetry()+0xd853a
> 1>
> 1>
> 1>LINK : fatal error LNK1000: Internal error during IMAGE::BuildImage
> 1>
> 1>  Version 14.12.25835.0
> 1>
> 1>  ExceptionCode            = C0000005
> 1>  ExceptionFlags           = 00000000
> 1>  ExceptionAddress         = 0FD9C072 (0F960000) "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.12.25827\bin\HostX86\x64\c2.dll"
> 1>  NumberParameters         = 00000002
> 1>  ExceptionInformation[ 0] = 00000000
> 1>  ExceptionInformation[ 1] = 12661CEC
> 1>
> 1>CONTEXT:
> 1>  Eax    = 12661CEC  Esp    = 00D3E948
> 1>  Ebx    = 08560163  Ebp    = 00D3E978
> 1>  Ecx    = 00000005  Esi    = 12661CEC
> 1>  Edx    = 0845102C  Edi    = 00D3E958
> 1>  Eip    = 0FD9C072  EFlags = 00010202
> 1>  SegCs  = 00000023  SegDs  = 0000002B
> 1>  SegSs  = 0000002B  SegEs  = 0000002B
> 1>  SegFs  = 00000053  SegGs  = 0000002B
> 1>  Dr0    = 00000000  Dr3    = 00000000
> 1>  Dr1    = 00000000  Dr6    = 00000000
> 1>  Dr2    = 00000000  Dr7    = 00000000
> 1>Done building project "TextQuestC.vcxproj" -- FAILED.
> ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
> 

But when i remove 9 row(fstream wObj;) Visual studio compile code without any problem, how can i fix it?

AMBULATUR commented 6 years ago

Or when i remove filter "Build" fstream work without any problem. But without filer "build" i cant compile ImGui code

ocornut commented 6 years ago

Hello @AMBULATUR. Sorry but it is difficult to help you with those information, and your problem is likely unrelated to imgui at all. Maybe SFML or other programming forums can help you. You may have a problem with your compiler setup, or project configuration or something else.