Ultimaker / cura-build-environment

CMake project to build dependencies for Cura
GNU Affero General Public License v3.0
24 stars 55 forks source link

Qt Feature Failed #68

Closed francoisbrassart closed 5 years ago

francoisbrassart commented 5 years ago

Hi, When building on Ubuntu, I have this error (when trying to build Qt).

ERROR: Feature 'pkg-config' was enabled, but the pre-condition 'tests.pkg-config' failed.
ERROR: Feature 'xcb' was enabled, but the pre-condition 'libs.xcb' failed.
ERROR: Feature 'opengl-desktop' was enabled, but the pre-condition '(config.win32 && !config.winrt && !features.opengles2 && (config.msvc || libs.opengl))
                          || (!config.watchos && !config.win32 && libs.opengl)' failed.
ERROR: Feature 'system-freetype' was enabled, but the pre-condition 'features.freetype && libs.freetype' failed.
ERROR: Feature 'fontconfig' was enabled, but the pre-condition '!config.win32 && !config.darwin && features.system-freetype && libs.fontconfig' failed.
ERROR: The OpenGL functionality tests failed!
You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.

I searched a lot but didn't find a solution. Does anyone knows how to fix this?

Ghostkeeper commented 5 years ago

I think you need to ask this on the Qt bugtracker.

thopiekar commented 5 years ago

Well, he just didn't follow the instructions and thus Qt is missing some dependencies. Wouldn't call it a bug that need to be reported at Qt.

Ghostkeeper commented 5 years ago

Oh, sorry then. Maybe something we need to make more clear in our instructions?

francoisbrassart commented 5 years ago

Hi, Thanks for your reply but I'm sure I followed all the instructions....

thopiekar commented 5 years ago

Well, there is a clear list of dependencies. Don't know how to make it more clear. 😅

Maybe we need to add package like freetype, pkg-config, xcb, etc to our list.

francoisbrassart commented 5 years ago

Hey I already have installed pkg-config and xcb (althought they are not listed in the dependancies) . Can't find package freetype

thopiekar commented 5 years ago

Are you sure that there is nothing like libfreetype-dev?🤔

francoisbrassart commented 5 years ago

Oh yes there is libfreetype6-dev but I already have the newest version...

Ghostkeeper commented 5 years ago

FreeType should be installed by default on Ubuntu. At least, that's what I'm assuming with my SVG plug-in.

Ghostkeeper commented 5 years ago

I added some documentation to the readme about these dependencies. Not sure which of these dependencies are necessary on MacOS though (on Windows they are not necessary since you won't build Qt there).

francoisbrassart commented 5 years ago

Thank you Ghostkeeper. Unfortunately, I still have the seame error, althought I checked that all dependencies were installed :( Any idea why ?

Ghostkeeper commented 5 years ago

Maybe Qt's build system is not finding it on your computer, even if it's there. You could debug a bit further by pointing CMake at the build directory in the Qt-prefix folder that cura-build-environment created.

francoisbrassart commented 5 years ago

I did

cmake .. -DCMAKE_PREFIX_PATH=./Qt-prefix

sudo make

But still have the same errors.

Ghostkeeper commented 5 years ago

No, what I meant was something more like:

cd Qt-prefix/build
cmake ../src
cmake-gui .

And then see where it says NOTFOUND or anything.

francoisbrassart commented 5 years ago

I don't have any 'build' folder in folder 'Qt-prefix'. I just have 'src' and 'tmp'. Thanks for helping me !

Ghostkeeper commented 5 years ago

Ah, yes sorry. It should be in Qt-prefix/src/Qt-build then.

francoisbrassart commented 5 years ago

In 'src' I have 'Qt' and Qt-stamp' only. no cmake file in any of these folders.

Ghostkeeper commented 5 years ago

Googling your error leads me to the suggestion that you could go to the source directory with a terminal and type configure -platform linux-g++ (given that there is a script there called configure). Maybe that helps?

After configuring that, you could go back to running the CMake script of cura-build-environment. It should retain that configuration.

francoisbrassart commented 5 years ago

Hi, Still trying to fix this problem. I tried what you saidand I still got this error

Note: No wayland-egl support detected. Cross-toolkit compatibility disabled.

WARNING: Python version 2 (2.7.5 or later) is required to build QtWebEngine.

WARNING: gperf is required to build QtWebEngine.

WARNING: bison is required to build QtWebEngine.

WARNING: flex is required to build QtWebEngine.

ERROR: The OpenGL functionality tests failed!
You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2],
QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.

Check config.log for details.

I tried a lots of "solutions" on the page you linked, without any success.... For the record, I am working on an ubuntu 18.04 Virtual Machine.

If you have another idea to solve this problem, I would be very grateful, I really need to make this work. Thanks in advance.

Ghostkeeper commented 5 years ago

For one, Cura doesn't use QtWebEngine. We stay away from that because it adds another 50MB of libraries and another hour to our environment build time. You can try disabling that component of Qt.

francoisbrassart commented 5 years ago

I succeded in building Qt in the Qt-prefix directory. I did configure, make and make install. Everything work without any errors. When going back to the build directory of cura-build-environment, when I call make, there's no more problem with the configuration step for Qt, but there are some errors for building step. I don't understand why it tries to build Qt because I think I did build it in the Qt-prefix directory (maybe I missed something?).

Here are the errors I get :

[ 78%] Performing build step for 'Qt'
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:0,
                 from ssl/qsslcertificate.cpp:116:
ssl/qsslsocket_openssl11_symbols_p.h:87:22: error: ‘OPENSSL_STACK’ was not declared in this scope
 int q_OPENSSL_sk_num(OPENSSL_STACK *a);
                      ^~~~~~~~~~~~~
ssl/qsslsocket_openssl11_symbols_p.h:87:22: note: suggested alternative: ‘OPENSSL_BLOCK’
 int q_OPENSSL_sk_num(OPENSSL_STACK *a);
                      ^~~~~~~~~~~~~
                      OPENSSL_BLOCK
ssl/qsslsocket_openssl11_symbols_p.h:87:37: error: ‘a’ was not declared in this scope
 int q_OPENSSL_sk_num(OPENSSL_STACK *a);
                                     ^
ssl/qsslsocket_openssl11_symbols_p.h:88:28: error: variable or field ‘q_OPENSSL_sk_pop_free’ declared void
 void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
                            ^~~~~~~~~~~~~
ssl/qsslsocket_openssl11_symbols_p.h:88:28: error: ‘OPENSSL_STACK’ was not declared in this scope
ssl/qsslsocket_openssl11_symbols_p.h:88:28: note: suggested alternative: ‘OPENSSL_BLOCK’
 void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
                            ^~~~~~~~~~~~~
                            OPENSSL_BLOCK
ssl/qsslsocket_openssl11_symbols_p.h:88:43: error: ‘a’ was not declared in this scope
 void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
                                           ^
ssl/qsslsocket_openssl11_symbols_p.h:88:53: error: ‘b’ was not declared in this scope
 void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
                                                     ^
ssl/qsslsocket_openssl11_symbols_p.h:88:56: error: expected primary-expression before ‘void’
 void q_OPENSSL_sk_pop_free(OPENSSL_STACK *a, void (*b)(void *));
                                                        ^~~~
ssl/qsslsocket_openssl11_symbols_p.h:89:1: error: ‘OPENSSL_STACK’ does not name a type; did you mean ‘OPENSSL_BLOCK’?
 OPENSSL_STACK *q_OPENSSL_sk_new_null();
 ^~~~~~~~~~~~~
 OPENSSL_BLOCK
ssl/qsslsocket_openssl11_symbols_p.h:90:24: error: variable or field ‘q_OPENSSL_sk_push’ declared void
 void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
                        ^~~~~~~~~~~~~
ssl/qsslsocket_openssl11_symbols_p.h:90:24: error: ‘OPENSSL_STACK’ was not declared in this scope
ssl/qsslsocket_openssl11_symbols_p.h:90:24: note: suggested alternative: ‘OPENSSL_BLOCK’
 void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
                        ^~~~~~~~~~~~~
                        OPENSSL_BLOCK
ssl/qsslsocket_openssl11_symbols_p.h:90:39: error: ‘st’ was not declared in this scope
 void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
                                       ^~
ssl/qsslsocket_openssl11_symbols_p.h:90:43: error: expected primary-expression before ‘void’
 void q_OPENSSL_sk_push(OPENSSL_STACK *st, void *data);
                                           ^~~~
ssl/qsslsocket_openssl11_symbols_p.h:91:24: error: variable or field ‘q_OPENSSL_sk_free’ declared void
 void q_OPENSSL_sk_free(OPENSSL_STACK *a);
                        ^~~~~~~~~~~~~
ssl/qsslsocket_openssl11_symbols_p.h:91:24: error: ‘OPENSSL_STACK’ was not declared in this scope
ssl/qsslsocket_openssl11_symbols_p.h:91:24: note: suggested alternative: ‘OPENSSL_BLOCK’
 void q_OPENSSL_sk_free(OPENSSL_STACK *a);
                        ^~~~~~~~~~~~~
                        OPENSSL_BLOCK
ssl/qsslsocket_openssl11_symbols_p.h:91:39: error: ‘a’ was not declared in this scope
 void q_OPENSSL_sk_free(OPENSSL_STACK *a);
                                       ^
ssl/qsslsocket_openssl11_symbols_p.h:92:27: error: ‘OPENSSL_STACK’ was not declared in this scope
 void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
                           ^~~~~~~~~~~~~
ssl/qsslsocket_openssl11_symbols_p.h:92:27: note: suggested alternative: ‘OPENSSL_BLOCK’
 void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
                           ^~~~~~~~~~~~~
                           OPENSSL_BLOCK
ssl/qsslsocket_openssl11_symbols_p.h:92:42: error: ‘a’ was not declared in this scope
 void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
                                          ^
ssl/qsslsocket_openssl11_symbols_p.h:92:45: error: expected primary-expression before ‘int’
 void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
                                             ^~~
ssl/qsslsocket_openssl11_symbols_p.h:92:50: error: expression list treated as compound expression in initializer [-fpermissive]
 void * q_OPENSSL_sk_value(OPENSSL_STACK *a, int b);
                                                  ^
ssl/qsslsocket_openssl11_symbols_p.h:95:45: error: ‘OPENSSL_INIT_SETTINGS’ does not name a type; did you mean ‘OPENSSL_CSTRING’?
 int q_OPENSSL_init_ssl(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                             ^~~~~~~~~~~~~~~~~~~~~
                                             OPENSSL_CSTRING
In file included from ssl/qsslsocket_openssl_symbols_p.h:220:0,
                 from ssl/qsslcertificate.cpp:116:
ssl/qsslsocket_openssl11_symbols_p.h:107:50: error: ‘X509_STORE_CTX_verify_cb’ has not been declared
 void q_X509_STORE_set_verify_cb(X509_STORE *ctx, X509_STORE_CTX_verify_cb verify_cb);
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~
ssl/qsslsocket_openssl11_symbols_p.h:124:48: error: ‘OPENSSL_INIT_SETTINGS’ does not name a type; did you mean ‘OPENSSL_CSTRING’?
 int q_OPENSSL_init_crypto(uint64_t opts, const OPENSSL_INIT_SETTINGS *settings);
                                                ^~~~~~~~~~~~~~~~~~~~~
                                                OPENSSL_CSTRING
Makefile:25654: recipe for target '.obj/qsslcertificate.o' failed
make[6]: *** [.obj/qsslcertificate.o] Error 1
Makefile:247: recipe for target 'sub-network-make_first' failed
make[5]: *** [sub-network-make_first] Error 2
Makefile:48: recipe for target 'sub-src-make_first' failed
make[4]: *** [sub-src-make_first] Error 2
Makefile:60: recipe for target 'module-qtbase-make_first' failed
make[3]: *** [module-qtbase-make_first] Error 2
CMakeFiles/Qt.dir/build.make:113: recipe for target 'Qt-prefix/src/Qt-stamp/Qt-build' failed
make[2]: *** [Qt-prefix/src/Qt-stamp/Qt-build] Error 2
CMakeFiles/Makefile2:335: recipe for target 'CMakeFiles/Qt.dir/all' failed
make[1]: *** [CMakeFiles/Qt.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2

Thanks for your precious help

Ghostkeeper commented 5 years ago

When building Qt manually, did you provide these options too?

https://github.com/Ultimaker/cura-build-environment/blob/1b07754c8712acce529fefdc55e96b0d177b4aa2/projects/qt.cmake#L11-L49