Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Very intersting, but currently unbuildable on Linux #1

Open
ebachard opened this issue Jan 16, 2018 · 11 comments
Open

Very intersting, but currently unbuildable on Linux #1

ebachard opened this issue Jan 16, 2018 · 11 comments

Comments

@ebachard
Copy link

ebachard commented Jan 16, 2018

Hey,
Thanks a lot for your work, extremely interesting. FYI, I started a build on Linux, but I found a lot of issues. Since it is not that different of Mac OS X, I'll give it a try, and if ever, I'll propose some changes (at least for testing purpose).

@ebachard
Copy link
Author

Ok, got it building, but remains a boring:

GLX: Failed to create context: GLXBadFBConfig"

I tried to change the OpenGL major/minor version, but probably something is missing. Todo (Linux only): ApplicationFilePatht() to be implemented, maybe boost could help (not sure)

Below, the attached diff to show what I did, to achieve the compilation. Lot of warnings though.

LinuxBuild_FishGUI.diff.txt](https://github.com/yushroom/FishGUI/files/1635300/LinuxBuild_FishGUI.diff.txt)

@yushroom
Copy link
Owner

You are right, ApplicationFilePath() is missing on Linux. I'm working on it now.

@yushroom
Copy link
Owner

@ebachard
Done. Tested on Ubuntu.
See readme for build instructions.

@ebachard
Copy link
Author

@yushroom

Thanks a lot for all the changes you did, very appreciated. Nevertheless, I still have some breakages and I'm wondering what I did so wrong ...

e.g. in ListWidget.hpp use m_rect.x directly is not possible, since m_rect is private. Maybe I'm not correct, but the attached patch fixed (partially) the build on Linux Intel (x86_64) + LinuxMint 18.3

Please have a look at this : https://gist.github.com/ebachard/8728ea69b7887b834146b0400052e95a#file-fishgui2-diff

Last but not least, what remains to be fixed :

Scanning dependencies of target Demo
[ 84%] Building CXX object CMakeFiles/Demo.dir/examples/demo1/main.cpp.o
In file included from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/TreeWidget.hpp:3:0,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/../common/HierarchyWidget.hpp:3,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/main.cpp:11:
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/ItemView.hpp: In instantiation of ‘void FishGUI::TItemView<T>::HandleKeyEvent() [with T = FileNode*]’:
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/ItemView.hpp:351:18:   required from ‘void FishGUI::TItemView<T>::DrawImpl() [with T = FileNode*]’
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/main.cpp:196:1:   required from here
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/ItemView.hpp:197:23: error: no matching function for call to ‘find(std::vector<FileNode*>::iterator, std::vector<FileNode*>::iterator, FileNode*&)’
    auto it = std::find(m_visibleItems.begin(), m_visibleItems.end(), first);
                       ^
In file included from /usr/include/c++/5/bits/locale_facets.h:48:0,
                 from /usr/include/c++/5/bits/basic_ios.h:37,
                 from /usr/include/c++/5/ios:44,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/main.cpp:5:
/usr/include/c++/5/bits/streambuf_iterator.h:369:5: note: candidate: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)
     find(istreambuf_iterator<_CharT> __first,
     ^
/usr/include/c++/5/bits/streambuf_iterator.h:369:5: note:   template argument deduction/substitution failed:
In file included from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/TreeWidget.hpp:3:0,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/../common/HierarchyWidget.hpp:3,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/main.cpp:11:
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/ItemView.hpp:197:23: note:   ‘__gnu_cxx::__normal_iterator<FileNode**, std::vector<FileNode*> >’ is not derived from ‘std::istreambuf_iterator<_CharT>’
    auto it = std::find(m_visibleItems.begin(), m_visibleItems.end(), first);
                       ^
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/ItemView.hpp: In instantiation of ‘bool FishGUI::TItemSelectionModel<T>::IsSelected(T) [with T = FileNode*]’:
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/ListWidget.hpp:96:7:   required from ‘void FishGUI::ListWidget<T>::Render() [with T = FileNode*]’
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/main.cpp:196:1:   required from here
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/ItemView.hpp:96:23: error: no matching function for call to ‘find(std::__cxx11::list<FileNode*, std::allocator<FileNode*> >::iterator, std::__cxx11::list<FileNode*, std::allocator<FileNode*> >::iterator, FileNode*&)’
    auto it = std::find(m_selection.begin(), m_selection.end(), item);
                       ^
In file included from /usr/include/c++/5/bits/locale_facets.h:48:0,
                 from /usr/include/c++/5/bits/basic_ios.h:37,
                 from /usr/include/c++/5/ios:44,
                 from /usr/include/c++/5/ostream:38,
                 from /usr/include/c++/5/iostream:39,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/main.cpp:5:
/usr/include/c++/5/bits/streambuf_iterator.h:369:5: note: candidate: template<class _CharT2> typename __gnu_cxx::__enable_if<std::__is_char<_CharT2>::__value, std::istreambuf_iterator<_CharT> >::__type std::find(std::istreambuf_iterator<_CharT>, std::istreambuf_iterator<_CharT>, const _CharT2&)
     find(istreambuf_iterator<_CharT> __first,
     ^
/usr/include/c++/5/bits/streambuf_iterator.h:369:5: note:   template argument deduction/substitution failed:
In file included from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/TreeWidget.hpp:3:0,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/../common/HierarchyWidget.hpp:3,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/examples/demo1/main.cpp:11:
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/include/FishGUI/ModelView/ItemView.hpp:96:23: note:   ‘std::_List_iterator<FileNode*>’ is not derived from ‘std::istreambuf_iterator<_CharT>’
    auto it = std::find(m_selection.begin(), m_selection.end(), item);
                       ^
CMakeFiles/Demo.dir/build.make:62 : la recette pour la cible « CMakeFiles/Demo.dir/examples/demo1/main.cpp.o » a échouée
make[2]: *** [CMakeFiles/Demo.dir/examples/demo1/main.cpp.o] Erreur 1
CMakeFiles/Makefile2:106 : la recette pour la cible « CMakeFiles/Demo.dir/all » a échouée
make[1]: *** [CMakeFiles/Demo.dir/all] Erreur 2
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/build/Makefile:127 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2

I'll continue to investigate what still causes the breakage.

To be continued :-)

@ebachard
Copy link
Author

OK, fixed : was a missing #include in include/FishGUI/ModelView/ItemView.hpp

=> see the full attached patch
fishGUI2.diff.txt

@ebachard
Copy link
Author

Still the GLX: Failed to create context.

eric@PasMaMachine ~/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI2/bin $ ./Demo
GLX: Failed to create context: GLXBadFBConfig

Investigating ...

@ebachard
Copy link
Author

ebachard commented Jan 17, 2018

Got it working, finaly :-)
Was the OpenGL version. Changing for 3.2 works now.

+#ifdef Linux
+		glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
+		glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 2);
+#else
 		glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
 		glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 1);
+#endif

Wow, the layout is really nice, great work !

Last but not least, the whole changes are attached. Feel free to use what you consider important.

fishGUI2.diff.txt

@yushroom
Copy link
Owner

thank you for your interest.
I made a new commit to fix, 0f7f074.

@ebachard
Copy link
Author

Thanks for your changes, very helpfull.

Still not fixed for me. If this can help, I started a new build (after a simple git clone + mkdir build && cd build && cmake .. && make ), but the build is still broken. Maybe this is my compiler ? Below the log, where I still have visibility issues (m_rect seen as private if I'm not wrong) :

[ 84%] Building CXX object CMakeFiles/Demo.dir/examples/demo1/main.cpp.o
In file included from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/examples/demo1/../common/HierarchyWidget.hpp:3:0,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/examples/demo1/main.cpp:11:
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/include/FishGUI/ModelView/TreeWidget.hpp: In member function ‘void FishGUI::TreeWidget<T>::Cell(T)’:
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/include/FishGUI/ModelView/TreeWidget.hpp:108:30: error: ‘class FishGUI::Widget’ has no member named ‘x’
     totalCellRect.x = m_rect.x;
                              ^
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/include/FishGUI/ModelView/TreeWidget.hpp:109:34: error: ‘class FishGUI::Widget’ has no member named ‘width’
     totalCellRect.width = m_rect.width;
                                  ^
In file included from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/examples/demo1/../common/FileListWidget.hpp:4:0,
                 from /home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/examples/demo1/main.cpp:13:
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/include/FishGUI/ModelView/ListWidget.hpp: In member function ‘virtual void FishGUI::ListWidget<T>::Render()’:
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/include/FishGUI/ModelView/ListWidget.hpp:54:17: error: ‘class FishGUI::Widget’ has no member named ‘x’
    r.x = m_rect.x;
                 ^
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/include/FishGUI/ModelView/ListWidget.hpp:55:34: error: ‘class FishGUI::Widget’ has no member named ‘y’
    r.y = static_cast<int>(m_rect.y + m_imContext->yStart);
                                  ^
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/include/FishGUI/ModelView/ListWidget.hpp:59:65: error: ‘class FishGUI::Widget’ has no member named ‘x’
    const float totalWidth = float(m_imContext->Right() - m_rect.x);
                                                                 ^
/home/eric/Devel/minidart/miniDart_0.7/IMPORTANT/fishGUI3/include/FishGUI/ModelView/ListWidget.hpp:81:19: error: ‘class FishGUI::Widget’ has no member named ‘x’
      r.x = m_rect.x + r.width * col;
                   ^
CMakeFiles/Demo.dir/build.make:62 : la recette pour la cible « CMakeFiles/Demo.dir/examples/demo1/main.cpp.o » a échouée
make[2]: *** [CMakeFiles/Demo.dir/examples/demo1/main.cpp.o] Erreur 1
CMakeFiles/Makefile2:106 : la recette pour la cible « CMakeFiles/Demo.dir/all » a échouée
make[1]: *** [CMakeFiles/Demo.dir/all] Erreur 2
Makefile:127 : la recette pour la cible « all » a échouée
make: *** [all] Erreur 2

@yushroom
Copy link
Owner

What is your gcc version? It seems that it can not handle two phase name lookup correctly. m_rect is a protected member of Widget.
Try to replace m_rect with this->m_rect.

@ebachard
Copy link
Author

~ $ gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.5) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I agree, it should work, but I dunno what happens. And indeed, this-> works as expected (I'm dumb, I should have thought to that before ...)

With the last attached diff (as .txt), you can consider the issue as fixed. Thanks a lot for your help, and your great work !

To be continued :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants