Giter VIP home page Giter VIP logo

Comments (23)

jesperhh avatar jesperhh commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024

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.

jesperhh avatar jesperhh commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024
$ 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.

oltodo avatar oltodo commented on August 23, 2024

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.

jesperhh avatar jesperhh commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024

Argh, not better with the 5.10.1 version, same error. 😞

from qmlfmt.

oltodo avatar oltodo commented on August 23, 2024

The problem should come from this line:

new QmlJS::ModelManagerInterface();

from qmlfmt.

jesperhh avatar jesperhh commented on August 23, 2024

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.

jesperhh avatar jesperhh commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024

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.

jesperhh avatar jesperhh commented on August 23, 2024

from qmlfmt.

oltodo avatar oltodo commented on August 23, 2024

Ok, thanks, I never use this.

from qmlfmt.

oltodo avatar oltodo commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024

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.

jesperhh avatar jesperhh commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024

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.

jesperhh avatar jesperhh commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024

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.

jesperhh avatar jesperhh commented on August 23, 2024

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.

oltodo avatar oltodo commented on August 23, 2024

Thanks @jesperhh for investigating and fixing!

from qmlfmt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.