Comments (23)
Hi,
Thanks for reporting the issue, I don't have a Mac system here, but I recently accepted a pull request for removing Qt Script for some of the build process as it is now deprecated - can you try to remove the remaining references and retry the build?
In qmlfmt/QtCreator/CMakeLists.txt:
Delete find_package(Qt5Script REQUIRED)
and the two references to Qt5::Script
from qmlfmt.
Thanks for answering!
I tried what you've suggested me. The previous error disappeared but I get a new one at the end:
[...]
[ 98%] Building CXX object CMakeFiles/qmljs.dir/src/libs/qmljs/qmljstypedescriptionreader.cpp.o
[ 99%] Building CXX object CMakeFiles/qmljs.dir/src/libs/qmljs/qmljsutils.cpp.o
[ 99%] Building CXX object CMakeFiles/qmljs.dir/src/libs/qmljs/qmljsvalueowner.cpp.o
[ 99%] Building CXX object CMakeFiles/qmljs.dir/src/libs/qmljs/qmljsviewercontext.cpp.o
[100%] Building CXX object CMakeFiles/qmljs.dir/qmljs_autogen/mocs_compilation.cpp.o
[100%] Linking CXX static library Release/libqmljs.a
[100%] Built target qmljs
[ 50%] No install step for 'QtCreator'
[ 54%] Completed 'QtCreator'
[ 54%] Built target QtCreator
Scanning dependencies of target qmlfmt_autogen
[ 59%] Automatic MOC for target qmlfmt
[ 59%] Built target qmlfmt_autogen
Scanning dependencies of target qmlfmt
[ 63%] Building CXX object CMakeFiles/qmlfmt.dir/main.cpp.o
[ 68%] Building CXX object CMakeFiles/qmlfmt.dir/qmlfmt.cpp.o
[ 72%] Building CXX object CMakeFiles/qmlfmt.dir/qmlfmt_autogen/mocs_compilation.cpp.o
[ 77%] Linking CXX executable qmlfmt
Undefined symbols for architecture x86_64:
"Utils::Internal::filePathUrl(QUrl const&)", referenced from:
Utils::isFileDrop(QMimeData const*, QList<Utils::DropSupport::FileSpec>*) in libutils.a(dropsupport.cpp.o)
"Utils::Internal::normalizePathName(QString const&)", referenced from:
Utils::FileUtils::normalizePathName(QString const&) in libutils.a(fileutils.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [qmlfmt] Error 1
make[1]: *** [CMakeFiles/qmlfmt.dir/all] Error 2
make: *** [all] Error 2
Sorry I'm not an expert about building C++ apps.
from qmlfmt.
Hmm, could be a newer/older version of Qt that I have not tested with, what version are you using?
Can you try qmake -v in a terminal?
from qmlfmt.
$ qmake -v
QMake version 3.0
Using Qt version 5.5.1 in /Applications/Qt/5.5/clang_64/lib
It uses the Qt 5.5.1 version. I can try with a 5.12 version.
from qmlfmt.
Sorry, I used the wrong terminal, I was already using the 5.12 version:
$ qmake -v
QMake version 3.1
Using Qt version 5.12.0 in /Applications/Qt/5.12.0/clang_64/lib
from qmlfmt.
I can see that the build automation only builds with 5.10 at the moment, I will take a look at getting it working with Qt 5.12 this week- my guess is that is the reason it does not build.
from qmlfmt.
Ok, I'm going to install the 5.10 version. I've just tested with the 5.5.1, but it doesn't work too.
from qmlfmt.
Argh, not better with the 5.10.1 version, same error. 😞
from qmlfmt.
The problem should come from this line:
Line 108 in 955e19d
from qmlfmt.
My guess is that this is just the first place that triggers the dependency for the reformatting library - if you remove that line it will just fail the next place that uses the reformatter.
I am working on setting up continuous integration for a clang build, I hope that will uncover what the issue is.
from qmlfmt.
I have created a new branch built on qt creator 4.8.1, can you try that one out?
https://github.com/jesperhh/qmlfmt/tree/submodulesetc
I have also set up a clang build on it, and it passes, so at least that is not the source of the issue.
from qmlfmt.
I got an error on the cmake
command:
CMake Error at qmljs/CMakeLists.txt:66 (list):
list sub-command REMOVE_ITEM requires two or more arguments.
Do you know what it means?
from qmlfmt.
from qmlfmt.
Ok, thanks, I never use this.
from qmlfmt.
Sorry, but still some errors:
[ 98%] Linking CXX executable qmlfmt
Undefined symbols for architecture x86_64:
"Utils::Internal::filePathUrl(QUrl const&)", referenced from:
Utils::isFileDrop(QMimeData const*, QList<Utils::DropSupport::FileSpec>*) in libutils.a(dropsupport.cpp.o)
"Utils::Internal::normalizePathName(QString const&)", referenced from:
Utils::FileUtils::normalizePathName(QString const&) in libutils.a(fileutils.cpp.o)
"Utils::Internal::forceMacOSLightAquaApperance()", referenced from:
Utils::setCreatorTheme(Utils::Theme*) in libutils.a(theme.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
from qmlfmt.
If it can help:
$ clang -v
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin18.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
from qmlfmt.
I think I found some of the issue at least - missing include of .mm files. Can you try again in the submodule branch?
..you need to rerun CMake configure as I have added some new files
..I updated it some more, missing mac specific frameworks
from qmlfmt.
I still get this kind of errors but this time more 😞
[ 98%] Linking CXX executable qmlfmt
Undefined symbols for architecture x86_64:
"_NSApp", referenced from:
Utils::Internal::forceMacOSLightAquaApperance() in libutils.a(theme_mac.mm.o)
"_NSAppearanceNameAqua", referenced from:
Utils::Internal::forceMacOSLightAquaApperance() in libutils.a(theme_mac.mm.o)
"_NSURLNameKey", referenced from:
Utils::Internal::normalizePathName(QString const&) in libutils.a(fileutils_mac.mm.o)
"_OBJC_CLASS_$_NSAppearance", referenced from:
objc-class-ref in libutils.a(theme_mac.mm.o)
"_OBJC_CLASS_$_NSURL", referenced from:
objc-class-ref in libutils.a(fileutils_mac.mm.o)
"_objc_autoreleasePoolPop", referenced from:
Utils::Internal::filePathUrl(QUrl const&) in libutils.a(fileutils_mac.mm.o)
Utils::Internal::normalizePathName(QString const&) in libutils.a(fileutils_mac.mm.o)
"_objc_autoreleasePoolPush", referenced from:
Utils::Internal::filePathUrl(QUrl const&) in libutils.a(fileutils_mac.mm.o)
Utils::Internal::normalizePathName(QString const&) in libutils.a(fileutils_mac.mm.o)
"_objc_msgSend", referenced from:
Utils::Internal::filePathUrl(QUrl const&) in libutils.a(fileutils_mac.mm.o)
Utils::Internal::normalizePathName(QString const&) in libutils.a(fileutils_mac.mm.o)
Utils::Internal::forceMacOSLightAquaApperance() in libutils.a(theme_mac.mm.o)
ld: symbol(s) not found for architecture x86_64
from qmlfmt.
And you have the version where I added:
if (APPLE)
find_library(AppKit AppKit)
find_library(Foundation Foundation)
target_link_libraries(utils ${AppKit} ${Foundation})
endif()
In qmljs/QMakeLists.txt?
from qmlfmt.
Sorry I tried with the previous commit. I got this error on cmake
:
CMake Error at qmljs/CMakeLists.txt:89 (target_link_libraries):
The keyword signature for target_link_libraries has already been used with
the target "utils". All uses of target_link_libraries with a target must
be either all-keyword or all-plain.
The uses of the keyword signature are here:
* qmljs/CMakeLists.txt:79 (target_link_libraries)
from qmlfmt.
Good news, I make some changes and it finally worked!
-target_link_libraries(utils PRIVATE Qt5::Widgets Qt5::Network Qt5::Concurrent Qt5::Qml)
+# target_link_libraries(utils PRIVATE Qt5::Widgets Qt5::Network Qt5::Concurrent Qt5::Qml)
if(WIN32)
target_link_libraries(utils PRIVATE user32 iphlpapi ws2_32 shell32)
endif()
if (APPLE)
find_library(AppKit AppKit)
find_library(Foundation Foundation)
- target_link_libraries(utils ${AppKit} ${Foundation})
+ # target_link_libraries(utils ${AppKit} ${Foundation})
+ target_link_libraries(utils PRIVATE Qt5::Widgets Qt5::Network Qt5::Concurrent Qt5::Qml ${AppKit} ${Foundation})
endif()
from qmlfmt.
Great! I think it would be enough to just add "PRIVATE" to the line:
target_link_libraries(utils ${AppKit} ${Foundation})
So I will integrate that in this changeset
from qmlfmt.
Thanks @jesperhh for investigating and fixing!
from qmlfmt.
Related Issues (20)
- Generate an AST document HOT 4
- No version number output HOT 5
- generating an AST HOT 1
- QML enum is removed HOT 5
- Distributing as a standalone tool HOT 1
- "cannot execute binary file" using prebuilt on macOS HOT 3
- I get some error about the error while loading shared libraries HOT 3
- Indent with tabs HOT 1
- More options for format? HOT 2
- Problem with launching cmake HOT 1
- Binaries HOT 2
- Doesn't work with JS lambdas HOT 3
- Difference to qmlformat HOT 1
- Build against Qt Creator 10.x HOT 4
- Properties sorting HOT 1
- Alphabetical order HOT 2
- import qrc: HOT 4
- Column and line information not shown HOT 1
- Formatting of QML comments HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from qmlfmt.