Main Menu
Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - WiWo

#1
I apology that took me so long to reply. I was trying to use another compiler (MinGW 6.10), but it didn't work.

I built the new libraries using TDM-GCC 5.1 and now everything works.

Thank you really much for your help.
#2
When I use the precompiled version I get a load of "undefined reference" errors. Here are the one I get (after getting rid of any theme in my code):

c:/TGUI-0.7done/include/TGUI/Signal.hpp:356: undefined reference to `_imp___ZN4tgui16SignalWidgetBase18extractSignalNamesENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
c:/TGUI-0.7done/include/TGUI/Signal.hpp:362: undefined reference to `_imp___ZN4tgui7toLowerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
c:/TGUI-0.7done/include/TGUI/Signal.hpp:365: undefined reference to `_imp___ZN4tgui7toLowerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
c:/TGUI-0.7done/include/TGUI/Signal.hpp:374: undefined reference to `_imp___ZN4tgui7toLowerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
c:/TGUI-0.7done/include/TGUI/Signal.hpp:356: undefined reference to `_imp___ZN4tgui16SignalWidgetBase18extractSignalNamesENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
c:/TGUI-0.7done/include/TGUI/Signal.hpp:362: undefined reference to `_imp___ZN4tgui7toLowerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
c:/TGUI-0.7done/include/TGUI/Signal.hpp:365: undefined reference to `_imp___ZN4tgui7toLowerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'
c:/TGUI-0.7done/include/TGUI/Signal.hpp:374: undefined reference to `_imp___ZN4tgui7toLowerENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE'

When using #ifdef _MSC_VER in Theme.cpp I get this error instead:

<tgui path>\src\TGUI\Loading\Theme.cpp: In member function 'virtual void tgui::Theme::initWidget(tgui::Widget*, std::__cxx11::string, std::__cxx11::string)':
<tgui path>\src\TGUI\Loading\Theme.cpp:369:60: error: 'realpath' was not declared in this scope
             buffer = realpath(resourcePath.c_str(), nullptr);
                                                                                ^

Thanks for your help.
#3
I'm trying to use tgui 0.7 with CodeLite on Windows 10. I installed the TDM-GCC compiler (5.1) (32-bit).
I can successfully use CMake(32-bit) to create a CodeLite project. However, when I try to build it using CodeLite I get this error:

<tgui path>\src\TGUI\Loading\Theme.cpp: In member function 'virtual void tgui::Theme::initWidget(tgui::Widget*, std::__cxx11::string, std::__cxx11::string)':
<tgui path>\src\TGUI\Loading\Theme.cpp:364:66: error: '_fullpath' was not declared in this scope
             buffer = _fullpath(nullptr, resourcePath.c_str(), 512);
                                                                                       ^
src\TGUI\CMakeFiles\tgui.dir\build.make:562: recipe for target 'src/TGUI/CMakeFiles/tgui.dir/Loading/Theme.cpp.obj' failed
mingw32-make.exe[1]: *** [src/TGUI/CMakeFiles/tgui.dir/all] Error 2
mingw32-make.exe: *** [all] Error 2

The same issue appeared when I tried the 0.8 version of tgui.

When instead I try to use the precompiled version of tgui 0.7 for tdm I get errors where I use themes (for instance when calling theme->load), and also in the Singnals.hpp file.

What I'm trying to do is simply compile a tgui 0.7 project on windows 10, but since VS 2017 Community has no tutorial and CodeBlocks keeps having problems with c++11, CodeLite was the best solution.

Thanks for any help.
#4
Help requests / Re: Special Character
23 August 2017, 14:55:29
Thanks A LOT

I tried fixing the problem using wfstream and wstring but I then had to use

Code (cpp) Select

file.imbue(std::locale(std::locale::classic() , new std::codecvt_utf8<wchar_t>))


So your solution is much neater.

Thanks again.
#5
Help requests / Re: Special Character
23 August 2017, 13:56:27
This is the minimal code using DejaVuSans

Code (cpp) Select

#include <TGUI/TGUI.hpp>
#include <fstream>
#include <string>
using namespace sf;

int main() {
   
    tgui::Gui gui;
    tgui::Theme::Ptr theme;
    tgui::TextBox::Ptr textbox;
    RenderWindow window;
   
    window.create(VideoMode(1224,1224), "NotSoVisualNovel");
    gui.setWindow(window);
    theme = tgui::Theme::create("/Users/***/Desktop/TGUI\ Characters/TGUI\ Characters/WiWo.txt");
    textbox = theme->load("TextBox");
    textbox->setSize(1000,300);
    textbox->setPosition(100, 900);
    textbox->setReadOnly();
    textbox->setTextSize(30);
    gui.add(textbox, "textbox");
    gui.setFont("/Users/***/Desktop/TGUI\ Characters/TGUI\ Characters/DejaVuSans.ttf");
   
    std::fstream file;
    file.open("/Users/***/Desktop/TGUI\ Characters/TGUI\ Characters/input.txt");
    std::string line;
   
    while (window.isOpen()) {
       
        window.clear(sf::Color::Black);
       
        Event event;
        while (window.pollEvent(event)) {
            if(event.type == Event::Closed) {
                window.close();
            }
            else if (event.type == Event::KeyPressed && event.key.code == Keyboard::Space) {
                getline(file,line);
                textbox->addText("\n"+line);
            }
            gui.handleEvent(event);
        }
        gui.draw();
        window.display();
       
    }
   
}


I attached the external file that may be used to reproduce the code as well as a screen shot of issue when the program is launched.
Note that the WiWo.txt file is simply Black.txt with the text box's background changed.

Thanks for your help
#6
Help requests / Special Character
23 August 2017, 13:04:18
I need to show some text I read from a file over an image on the screen.
So I used a text box with a personalized theme. (I can swap to something else, if necessary)

However, I need to display characters such as à, è, ° .

I read the post about Cyrillic characters, but I am using Arial as font and I'm sure these characters are included.

Is there any way to fix this? Thanks a lot.

p.s.: even sf::Text do not display that characters and I am using the 0.7.4 version of TGUI