Closed jxs closed 9 years ago
Hi, what was is the exact command you have used for compiling? The folder listing should look like this:
ext/libqmlrswrapper/
├── build
│ ├── CMakeCache.txt
│ ├── CMakeFiles
│ │ ├── 3.2.3
│ │ │ ├── CMakeCCompiler.cmake
│ │ │ ├── CMakeCXXCompiler.cmake
│ │ │ ├── CMakeDetermineCompilerABI_C.bin
│ │ │ ├── CMakeDetermineCompilerABI_CXX.bin
│ │ │ ├── CMakeSystem.cmake
│ │ │ ├── CompilerIdC
│ │ │ │ ├── a.out
│ │ │ │ └── CMakeCCompilerId.c
│ │ │ └── CompilerIdCXX
│ │ │ ├── a.out
│ │ │ └── CMakeCXXCompilerId.cpp
│ │ ├── cmake.check_cache
│ │ ├── CMakeDirectoryInformation.cmake
│ │ ├── CMakeOutput.log
│ │ ├── CMakeRuleHashes.txt
│ │ ├── CMakeTmp
│ │ ├── feature_tests.bin
│ │ ├── feature_tests.c
│ │ ├── feature_tests.cxx
│ │ ├── Makefile2
│ │ ├── Makefile.cmake
│ │ ├── progress.marks
│ │ ├── qmlrswrapper_automoc.dir
│ │ │ ├── AutogenInfo.cmake
│ │ │ ├── AutomocOldMocDefinitions.cmake
│ │ │ ├── build.make
│ │ │ ├── cmake_clean.cmake
│ │ │ ├── DependInfo.cmake
│ │ │ ├── depend.internal
│ │ │ ├── depend.make
│ │ │ └── progress.make
│ │ ├── qmlrswrapper.dir
│ │ │ ├── build.make
│ │ │ ├── cmake_clean.cmake
│ │ │ ├── cmake_clean_target.cmake
│ │ │ ├── CXX.includecache
│ │ │ ├── DependInfo.cmake
│ │ │ ├── depend.internal
│ │ │ ├── depend.make
│ │ │ ├── flags.make
│ │ │ ├── libqmlrswrapper.cpp.o
│ │ │ ├── link.txt
│ │ │ ├── progress.make
│ │ │ ├── qmlrswrapper_automoc.cpp.o
│ │ │ ├── qrsdynamicobject_capi.cpp.o
│ │ │ └── qrsdynamicobject.cpp.o
│ │ └── TargetDirectories.txt
│ ├── cmake_install.cmake
│ ├── libqmlrswrapper.a
│ ├── Makefile
│ ├── moc_libqmlrswrapper.cpp
│ └── qmlrswrapper_automoc.cpp
├── CMakeLists.txt
├── libqmlrswrapper.cpp
├── libqmlrswrapper.h
├── qrsdynamicobject_capi.cpp
├── qrsdynamicobject.cpp
└── qrsdynamicobject.h
and which rust version did you use?
oh sorry,
i used rustc 1.0.0 (built 2015-05-16)
also, i am able to compile it on linux without problems,
my directory tree is
.
├── CMakeLists.txt
├── build
│ ├── CMakeCache.txt
│ └── CMakeFiles
│ ├── 3.2.2
│ │ ├── CMakeCCompiler.cmake
│ │ ├── CMakeCXXCompiler.cmake
│ │ ├── CMakeDetermineCompilerABI_C.bin
│ │ ├── CMakeDetermineCompilerABI_CXX.bin
│ │ ├── CMakeSystem.cmake
│ │ ├── CompilerIdC
│ │ │ ├── CMakeCCompilerId.c
│ │ │ └── a.out
│ │ └── CompilerIdCXX
│ │ ├── CMakeCXXCompilerId.cpp
│ │ └── a.out
│ ├── CMakeOutput.log
│ ├── CMakeTmp
│ ├── cmake.check_cache
│ ├── feature_tests.bin
│ ├── feature_tests.c
│ └── feature_tests.cxx
├── libqmlrswrapper.cpp
├── libqmlrswrapper.h
├── qrsdynamicobject.cpp
├── qrsdynamicobject.h
└── qrsdynamicobject_capi.cpp
but on linux is the same as yours
And which commands did you use exactly to compile (like cargo run ...
, cargo build ...
). Try cargo build --verbose
instead to see what is wrong. If that did not help you: I think you'll find an error message in the file CMakeOutput.log
to see what is missing on your mac.
If that did not help you either. Try the following (step by step) and post the output:
rm -rf /Volumes/data/dev/jxs/qmlrs/ext/libqmlrswrapper/build
cd /Volumes/data/dev/jxs/qmlrs/ext/libqmlrswrapper
mkdir build
cd build
cmake ..
Post the output of the last step.
apparently the extension builds ok, it's rust who cannot find it?
here's CMakeOutput.log
I had the same issue and had to add the following line to my .zshrc
. Just point it to the directory where you installed Qt.
export CMAKE_PREFIX_PATH="$HOME/Qt/5.5/clang_64"
Hope that helps!
When using homebrew, you need to export CMAKE_PREFIX_PATH=$(brew --prefix qt5)/lib/cmake/
before running cargo. Building the wrapper library then seems to succeed.
fixed with the instruction above, also if having:
Fresh pkg-config v0.3.5 (https://github.com/alexcrichton/pkg-config-rs#42f1704b)
failed to run custom build command for `qmlrs v0.0.1 (file:///Volumes/data/dev/jxs/qmlrs)`
Process didn't exit successfully: `/Volumes/data/dev/jxs/qmlrs/target/debug/build/qmlrs-1d1b2e9aa4373dd1/build-script-build` (exit code: 101)
--- stdout
cargo:rustc-link-lib=static=qmlrswrapper
cargo:rustc-link-lib=dylib=stdc++
cargo:rustc-link-search=native=/Volumes/data/dev/jxs/qmlrs/ext/libqmlrswrapper/build
--- stderr
thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: "`\"pkg-config\" \"--libs\" \"--cflags\" \"Qt5Core Qt5Gui Qt5Qml Qt5Quick\"` did not exit successfully: exit code: 1\n--- stderr\nPackage Qt5Core was not found in the pkg-config search path.\nPerhaps you should add the directory containing `Qt5Core.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'Qt5Core\' found\nPackage Qt5Gui was not found in the pkg-config search path.\nPerhaps you should add the directory containing `Qt5Gui.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'Qt5Gui\' found\nPackage Qt5Qml was not found in the pkg-config search path.\nPerhaps you should add the directory containing `Qt5Qml.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'Qt5Qml\' found\nPackage Qt5Quick was not found in the pkg-config search path.\nPerhaps you should add the directory containing `Qt5Quick.pc\'\nto the PKG_CONFIG_PATH environment variable\nNo package \'Qt5Quick\' found\n"', src/libcore/result.rs:731
export PKG_CONFIG_PATH=/usr/local/opt/qt5/lib/pkgconfig/
fixes it
on os x 10.10 trying to compile qmlrs i get the following output:
and if i list
/Volumes/data/dev/jxs/qmlrs/ext/libqmlrswrapper/build
folder i get:thanks