Closed mdeguzis closed 7 years ago
That function is generated by rcc. The file Phoenix/backend/input/SDL_GameControllerDB/gamecontrollerdb.txt
is referred to by Phoenix/backend/input/SDL_GameControllerDB/controllerdb.qrc
. CMake should invoke rcc but it either didn't this time or it's not being passed to the linker. What version of CMake are you using? You'll need at least 3.6.0.
Check build_folder/Phoenix_automoc.dir/backend/input/qrc_controllerdb.cpp
. You should see the missing function defined towards the bottom.
I am using CMake 3.6.1. Ok, i'll review that now. Thank you for the response.
I have qrc_controllerdb.cpp
in /build/CMakeFiles/Phoenix.dir/
. Here is the contents of that file.
On my box I have qInitResources_backend_input_controllerdb()
within qrc_controllerdb.cpp
. Try building outside the source tree? Yours seems to be missing the path part in the function name, which is causing some sort of mismatch?
My build process is outlined here for debian/rules. I always try to use a build folder to contain the files. How can I build outside the src tree? cd up a level and try building? Maybe because I have CMakeFiles before Phoenix.dir :/ no idea. Maybe my use of "build" is being picked up as a var elsewhere. I'll change the folder name.
Yes. Something like this:
mkdir Phoenix && cd Phoenix
git clone phoenix[...]
mkdir phoenix-build && cd phoenix-build
cmake ../phoenix [...]
[etc]
Hmm.... no luck with:
rm -rf phoenix_build && mkdir phoenix_build
cd phoenix_build && cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_EXPORT_COMPILE_COMMANDS=on \
-DCMAKE_INSTALL_PREFIX=/usr ..
make -C phoenix_build
I even tried doing this manually:
rm -rf phoenix_build && mkdir phoenix_build
cd phoenix_build
cmake ..
make
You're not putting phoenix_build
inside the source tree are you? Is phoenix_build
in the same folder as backend
, CMake
, externals
and frontend
is it?
Yes, phoenix build is inside the build directory with the source files. Every project I have every build with cmake employs similar processes:
rm -rf Build && mkdir Build
cd Build && cmake ..
make -C Build
Not sure how I will tackle this then if it must be outside of the source files entirely. That's why I thought build directories existed in the first place, to ensure build files are contained and clean, not outside of the source directory entirely.
Out of tree builds are how Qt Creator does it, it allows for multiple build configurations to coexist without overwriting each other. Please try doing it out of tree, simply point CMake in line 2 to the source folder.
Did these exact steps from the $HOME directory of my Debian 8 VPS:
mkdir Phoenix && cd Phoenix
git clone https://github.com/team-phoenix/Phoenix
mkdir phoenix-build && cd phoenix-build
cmake ../Phoenix
make
No luck :/ It appears your Travis CI build doesn't build out of tree. Maybe that is what the env source is for above it.
What version of Qt are you using?
5.7.0 CmakeCache finds all required packages.
If there is a way to spit out more verbose cmake output, I will give you logs.
I turned on some debugging with cmake and make: http://sprunge.us/UYYQ
Doesn't this mean the naming is being generated incorrectly here? It would appear the default behavior of rcc is to match the name of the input file, in this case "controllerdb" vs "backend_input_controllerdb".
Generating qrc source CMakeFiles/Phoenix.dir/qrc_controllerdb.cpp
/usr/lib/x86_64-linux-gnu/qt5/bin/rcc -name controllerdb -o /build/phoenix_build/CMakeFiles/Phoenix.dir/qrc_controllerdb.cpp /build/phoenix-0.0.1+20160823git+bsos/backend/input/controllerdb.qrc
You said above:
That function is generated by rcc. The file Phoenix/backend/input/SDL_GameControllerDB/gamecontrollerdb.txtis referred to by Phoenix/backend/input/SDL_GameControllerDB/controllerdb.qrc.
But that file is not in a "SDL_GameControllerDB" subdir. I see it's an alias, but just wanted to be sure.
../Phoenix/backend/input/controllerdb.qrc
Update:
renaming the file and the file name in input/backend/CMakeLists.txt works. So I don't know how you are changing the generation of the name. This works fine with a temp build dir inside or outside the source tree. If the path is globbed and used as filename input, where is this done in code? Why do this vs just setting the path into the filename/CMakeLists?
I can confirm the problem is due to some regression/new bug caused by CMake 3.6.1. Try 3.6.0. I'll look into it more and see whose fault it is, mine or theirs.
Will do. Thank you for checking. If it's a cake problem, fine to use I'd think.
So looking at the generated qrc_controllerdb.cpp file, it puts the function we want as qInitResources_controllerdb() instead of qInitResources_backend_input_controllerdb(). Since the offending macro at line 86 of main.cpp is Q_INIT_RESOURCE( backend_input_controllerdb ), I figure you can just change it to Q_INIT_RESOURCE( controllerdb ). I did this and now it compiles. No idea if it broke anything at runtime, because there are other bugs preventing me from testing. I can submit a PR if you'd like.
Can probably close this now.
I remember doing your fix @bsmt a while ago and it didn't work. Seems to work with the latest CMake (as of this posting 3.7.2) so I'll keep that commit and close this.
Well it's not going to build with cmake < 3.7 now it seems, which is why the travis build failed. I guess building will just require a new cmake, which is okay imo.
Having trouble linking the final exe when running the project into cmake. I'm looking through CMakeCache.txt now. I see where the code is for this, just a bit unsure. I see in CMakeLists.txt, that my Qt paths and programs are picked up.
make -d
make -n
command listCould I be missing a package? I've backported much of the Qt stack to Debian Jessie / SteamOS. Maybe something is being missed on the backend, or I have some silly error :/ From what I read, linking is either incomplete in CMakeLists.txt somewhere, or implemented in a different manner.