huxingyi / dust3d

Dust3D is a cross-platform 3D modeling software that makes it easy to create low poly 3D models for video games, 3D printing, and more.
https://dust3d.org/
MIT License
2.98k stars 222 forks source link

Linux Support #2

Closed dev-inigmas closed 6 years ago

dev-inigmas commented 6 years ago

I keep seeing download/build instructions for Windows/Mac. Does this work on Linux?

popey commented 6 years ago

I tried building this on Ubuntu 16.04 today. I added a PPA with qt5.10 because that seems needed.. But the build fails..

In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qlayout.h:37:0,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qboxlayout.h:37,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QVBoxLayout:1,
                 from src/skeletondocumentwindow.cpp:1:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:285:13: note: candidate: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, Func2 slot)
             ^
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:285:13: note:   template argument deduction/substitution failed:
src/skeletondocumentwindow.cpp: In substitution of ‘template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2) [with Func1 = void (QWidget::*)(const QPoint&); Func2 = SkeletonDocumentWindow::SkeletonDocumentWindow()::<lambda(const QPoint&)>]’:
src/skeletondocumentwindow.cpp:465:6:   required from here
src/skeletondocumentwindow.cpp:465:6: error: template argument for ‘template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)’ uses local type ‘SkeletonDocumentWindow::SkeletonDocumentWindow()::<lambda(const QPoint&)>’
     });
      ^
src/skeletondocumentwindow.cpp:465:6: error:   trying to instantiate ‘template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, Func2)’
In file included from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qlayout.h:37:0,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/qboxlayout.h:37,
                 from /usr/include/x86_64-linux-gnu/qt5/QtWidgets/QVBoxLayout:1,
                 from src/skeletondocumentwindow.cpp:1:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:293:13: note: candidate: template<class Func1, class Func2> static typename QtPrivate::QEnableIf<(QtPrivate::FunctionPointer<Func2>::ArgumentCount == (-1)), QMetaObject::Connection>::Type QObject::connect(const typename QtPrivate::FunctionPointer<Func>::Object*, Func1, const QObject*, Func2, Qt::ConnectionType)
             connect(const typename QtPrivate::FunctionPointer<Func1>::Object *sender, Func1 signal, const QObject *context, Func2 slot,
             ^
/usr/include/x86_64-linux-gnu/qt5/QtCore/qobject.h:293:13: note:   template argument deduction/substitution failed:
src/skeletondocumentwindow.cpp:465:6: note:   cannot convert ‘<lambda closure object>SkeletonDocumentWindow::SkeletonDocumentWindow()::<lambda(const QPoint&)>{graphicsWidget, ((SkeletonDocumentWindow*)this)}’ (type ‘SkeletonDocumentWindow::SkeletonDocumentWindow()::<lambda(const QPoint&)>’) to type ‘const QObject*’
     });
      ^
src/skeletondocumentwindow.cpp: In member function ‘void SkeletonDocumentWindow::saveAll()’:
src/skeletondocumentwindow.cpp:551:10: warning: ‘auto’ changes meaning in C++11; please remove it [-Wc++0x-compat]
     for (auto &window: g_documentWindows) {
          ^
src/skeletondocumentwindow.cpp:551:16: error: ISO C++ forbids declaration of ‘window’ with no type [-fpermissive]
     for (auto &window: g_documentWindows) {
                ^
src/skeletondocumentwindow.cpp:551:24: warning: range-based ‘for’ loops only available with -std=c++11 or -std=gnu++11
     for (auto &window: g_documentWindows) {
                        ^
src/skeletondocumentwindow.cpp:552:15: error: base operand of ‘->’ is not a pointer
         window->save();
               ^
Makefile:613: recipe for target 'skeletondocumentwindow.o' failed
make: *** [skeletondocumentwindow.o] Error 1
huxingyi commented 6 years ago

@dlpatri Yes, ideally, it should work on all the platforms which can run the latest Qt. @popey Thanks for reporting, I will look into it when my Ubuntu VM ready.

huxingyi commented 6 years ago

Hi, I have tested on Ubuntu 16.04.4 LTS, and updated the build steps in docs https://dust3d.readthedocs.io/en/latest/builds.html Please check the Ubuntu section of the docs, and download the latest code(Have slightly changed Dust3D.pro file).

dev-inigmas commented 6 years ago

I'm running Ubuntu 18.04. Got to the point where I run qmake then make. This is what I get:

dlpatri@Bebop:~/thirdParty/dust3d$ qmake -qt=5 -v -makefile
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu
dlpatri@Bebop:~/thirdParty/dust3d$ make
make: *** No targets specified and no makefile found.  Stop.
huxingyi commented 6 years ago

Hi, David, I saw the folder name "thirdParty", is your file structure like this?

~/thirdParty/dust3d/dust3d.pro

If not, please run theqmake -qt=5 -v -makefile in the path where you can find the dust3d.pro.

dev-inigmas commented 6 years ago
dlpatri@Bebop:~/thirdParty/dust3d$ pwd
/home/dlpatri/thirdParty/dust3d
dlpatri@Bebop:~/thirdParty/dust3d$ ls -l
total 68
-rw-rw-r-- 1 dlpatri dlpatri 20088 Apr 21 12:48 ACKNOWLEDGEMENTS.html
-rw-rw-r-- 1 dlpatri dlpatri  3511 Apr 21 12:48 appveyor.yml
-rw-rw-r-- 1 dlpatri dlpatri    72 Apr 21 12:48 AUTHORS
drwxrwxr-x 2 dlpatri dlpatri  4096 Apr 21 12:48 ci
drwxrwxr-x 5 dlpatri dlpatri  4096 Apr 21 12:48 docs
-rw-rw-r-- 1 dlpatri dlpatri  4781 Apr 21 12:48 dust3d.pro
-rw-rw-r-- 1 dlpatri dlpatri  1071 Apr 21 12:48 LICENSE
-rw-rw-r-- 1 dlpatri dlpatri  3123 Apr 21 12:48 README.md
drwxrwxr-x 2 dlpatri dlpatri  4096 Apr 21 12:48 resources
-rw-rw-r-- 1 dlpatri dlpatri   151 Apr 21 12:48 resources.qrc
drwxrwxr-x 2 dlpatri dlpatri  4096 Apr 21 12:48 src
drwxrwxr-x 4 dlpatri dlpatri  4096 Apr 21 12:48 thirdparty
dlpatri@Bebop:~/thirdParty/dust3d$ qmake -qt=5 -v -makefile
QMake version 3.1
Using Qt version 5.9.5 in /usr/lib/x86_64-linux-gnu
dlpatri@Bebop:~/thirdParty/dust3d$ make
make: *** No targets specified and no makefile found.  Stop.
dev-inigmas commented 6 years ago

A difference between what I did (as opposed to what the instructions tell me to do) is that I did not build my own CGAL. But that's because I'm running Ubuntu 18.04; which seems to have the required version in its repositories:

$ sudo apt list libcgal-dev
Listing... Done
libcgal-dev/bionic,now 4.11-2build1 amd64 [installed]
huxingyi commented 6 years ago

Sorry, my bad. there is a mistake in the docs. Should be qmake -qt=5 -makefile

dev-inigmas commented 6 years ago

I assumed -v was for verbose.... I'm guessing it was for "version"?

dev-inigmas commented 6 years ago

Alright; so that worked. I got Dust3d up and going. The UI is a bit small; but at least it seems to be running. Thanks :)

huxingyi commented 6 years ago

You are welcome, there is a commit coming to fix a windows crash and the UI issues. I am testing it, will commit when ready.

huxingyi commented 6 years ago

I am closing this now, thanks for help. the UI small problem has been fixed in the latest commit.

dev-inigmas commented 6 years ago

Verified that https://dust3d.readthedocs.io/en/latest/builds.html no longer has the -v option in qmake. I agree with the closing.

Thanks again.