compile error resfile.o 58% through the process (qtcreator)
Greetings!
I'm a newbie with the Musescore code, but seems I have it more or less under control. Code compiles fine from the command line, but when I try to compile/debug within QTCreator, I get this:
[ 58%] Generating ../resfile.o
'-i' is not recognized as an internal or external command,
operable program or batch file.
mscore\CMakeFiles\mscore.dir\build.make:850: recipe for target 'resfile.o' failed
CMakeFiles\Makefile2:254: recipe for target 'mscore/CMakeFiles/mscore.dir/all' failed
makefile:148: recipe for target 'all' failed
mingw32-make.exe[2]: *** [resfile.o] Error 1
sure enough this is line 850 in the build.make file, the only -i in the whole file:
num=$(CMAKE_PROGRESS_153) "Generating ../resfile.o"
cd /d C:\Users\Bix\Documents\GitHub\MuseScore\mscore\data && -i mscore.rc -o
etc...
Any insights?
Thanks!
John
Comments
Check https://musescore.org/en/node/48891
In reply to Check by Jojo-Schmitz
thanks for the ultra-quick reply. a lot of info in that post, i'll let you know how it works out. musescore is worth the effort!
So I followed the tread in that post and modified my build.make file thus:
resfile.o: ../mscore/data/mscore.rc
@$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --blue --bold --progress-dir=C:\Users\Bix\Documents\GitHub\MuseScore\build.qtc\CMakeFiles --progress-num=$(CMAKE_PROGRESS_149) "Generating ../resfile.o"
cd /d C:\Users\Bix\Documents\GitHub\MuseScore\mscore\data && C:\Qt\Tools\mingw491_32\bin\windres.exe -i mscore.rc -o C:/Users/Bix/Documents/GitHub/MuseScore/build.qtc/mscore.res
cd /d C:\Users\Bix\Documents\GitHub\MuseScore\mscore\data && C:\Qt\Tools\mingw491_32\bin\windres.exe C:/Users/Bix/Documents/GitHub/MuseScore/build.qtc/mscore.res -o C:/Users/Bix/Documents/GitHub/MuseScore/build.qtc/resfile.o
and I can compile, but still no link, same errors basically as in that post. I am trying to run 3.0 and it seems the link problem was "resolved" by using a much older version.
At least I can indeed debug inside QtCreator, so I suppose that is good enough, but it would be nice if the whole thing could be handled inside creator. Any thoughts regarding those linker errors?
Thanks!
John
In reply to So I followed the tread in by John Klima
I've never even tried compiling outside of QtCreator - I only use QtCreator for compiling and debugging. I don't have any problems at all. Is it possible you have the wrong version of Qt or something like that? I just got my current build system up about a month ago, so I'm probably using current tools.
In reply to I've never even tried by Marc Sabatella
Im using current tools, used the version of qt from the online instructions, though qtcreator is a newer version than shown, so some of the screenshots for the install were not exactly the same. Are you using latest cmake or an older version? I was unable to find older releases and it has been a while since I used it, and not on this machine
In reply to Im using current tools, used by John Klima
Seen https://musescore.org/en/developers-handbook/compilation/compile-instru… too?
It is still the same for the current QtCreator 4.2. I'm using that and CMake 3.5.1 currently
In reply to Seen by Jojo-Schmitz
First off, the rapid response here is truly wonderful! Been a while since I experienced this level of commitment! Thinking I might have landed in a nice place :)
So,
4.2 has different UI screens for sure than those instructions, which I followed. Should I be using THE VERY LATEST QT? because I installed Qt to match the screens, iow, I installed 5.6, creator is 4.2, and musescore is 3.0
Tempted to start from scratch on another machine, if I can get confirmation of exact versions of each bit that has worked for others. BTW, windows 8 if that makes a difference.
In reply to First off, the rapid response by John Klima
Qt 5.6 is good for me currently. We update the requirements from time to time, but it's not uncommon that the very latest doesn't work until someone figures out what we need to change.
And yes, I think this is a good place :-)
In reply to First off, the rapid response by John Klima
I'm on Windows 7 and 10, and Qt-5.6.2
QtCreator 4.2 has different screens than shown on https://musescore.org/en/developers-handbook/compilation/compile-instru… (which is for 3.6), yes, but should be the same as shown on https://musescore.org/en/node/116991
And yes, many here came for the software and stayed for the community ;-)
In reply to I'm on Windows 7 and 10, and by Jojo-Schmitz
more stuff to go through, will have a fresh look in the morning. Again thanks for the help. I can indeed debug if not compile in creator and that is halfway there. I have a good friend, a piano player, composer, and teacher, who loves this software and asked me if I can add some enhancements to aid in his pedagogy and compositions. He's actually on a Linux distro, so I someday hope to make a real pull request that gets added to the official release!
In reply to more stuff to go through, by John Klima
If you want, you can already post some of his requests into the feature request forum or even the Issue tracker if they're not in there already. You just might get lucky and find another developer willing to help out; if not, then at least it helps keeping track and possibly avoid double work.
In reply to Im using current tools, used by John Klima
My cmake is 3.6.2
In reply to My cmake is 3.6.2 by Marc Sabatella
interesting, i'm on 3.7.1 and it would not be the first time that cmake versions bork a build, actually, I can not count the number of times I have experienced that problem.
In reply to interesting, i'm on 3.7.1 and by John Klima
I've just upgraded to CMake 3.7.1 and it still works for me.
But maybe you are using the 64bit Version? The developers's handbook claims that you'd need to use the 32bit version (and I do and ever did)
In reply to So I followed the tread in by John Klima
Funny enough I'm running into the same resfile.o problem today, trying to build from the 2.1 branch. And the hint at https://musescore.org/en/node/48891#comment-370551 helped, to get around that, not sure about the root cause and final fix yet though, and also after that I get tons of undefined references when linking MuseScore.exe
In reply to Funny enough I'm running into by Jojo-Schmitz
Sorry if I chime in maybe too late. The generation of resfile.o is coded here:
lines 405-406 of mscore/CMakeLists.txt
where QT_WRC_EXECUTABLE and QT_WINE_EXECUTABLE are defined in build/mingw32.mingw.cmake as build/wrc.bat and build/wine.bat.
build/mingw32.cmake lines 31-32
These .bat files contains the instruction "windres" assuming Mingw bin folder is in the PATH (in the "wine.bat" case it also skips the first argument so that the string "/home/ws/.wine/drive_c/MingW/bin/windres.exe" is completely ignored).
Apparently in the case of this topic the QT_WRC_EXECUTABLE and QT_WINE_EXECUTABLE are not properly set (from the analysis of the make file, they are empty). Could it be a problem of the "-DCMAKE_TOOLCHAIN_FILE=build/mingw32.mingw.cmake" parameter or maybe a caching problem (note that "it leads to a warning about being unused on subsequent times" because after the first time the values are read from the cmake cache instead of mingw32.mingw.cmake)?
In reply to Sorry if I chime in maybe too by ABL
Hmm, you point at the mscore/CMakeLists.txt and build/mingw32.mingw.cmake files of the master branch, but the problem happens only with the 2.1 branch, at least for me.
These files don't look fundamentally different there though:
https://github.com/musescore/MuseScore/blob/2.1/mscore/CMakeLists.txt#L…
https://github.com/musescore/MuseScore/blob/2.1/build/mingw32.mingw.cma…
so I guess the problem got to be somewhere else. I don't think it is cache, as I've deleted the build.qtc and win32install directories and also the CMakeLists.txt.user file, restarted QtCreatore, with a .bat that sets everything for Qt-5.4, configured it from scratch and still had the issue
In reply to Hmm, you point at the by Jojo-Schmitz
Care to share the build log?
In reply to Care to share the build log? by jeetee
Don't have one at hand currently
In reply to Don't have one at hand by Jojo-Schmitz
Can you please share the following files of the failing compilation?
CMakeLists.txt.user
build.qtc/CMakeCache.txt
build.qtc/mscore/CMakeFiles/mscore.dir/build.make
In reply to Can you please share the by ABL
I will, once I have the guts to try it again ;-)
In reply to Can you please share the by ABL
@ABL, I've ran into the exact same problem as described when Building MuseScore 2.1 on a fresh git checkout (in a seperate folder from my master checkout, so I loaded as a fresh separate project in QtCreator). Here is the errors in compile output (the failure of resfile.o happens right after built libmscore):
Attached are the files you requested Jojo to upload.
I'm going to try the workaround described in https://musescore.org/en/node/48891#comment-370551
In reply to @ABL, I've ran into the exact by ericfontainejazz
Assuming you are currently following the compile instructions correctly, I found that this results from leftover cached information from a previous *incorrect* build. In particular, even though you might currently be specifying the CMAKE_TOOLCHAIN_FILE correctly, you must have done an initial cmake run without it, and it remembers that and is refusing to honor the one you specify, and therefore isn't finding the necessary tool at all. After a bunch of attempts to clean things up directly, I finally just deleted the whole build.qtc folder and kicked off a new build, which worked. If you do this, you don't need to mess with editing the toolchain file or the build script or anything else. The "/home/ws" but is a red herring - even though it's there in the file, it's harmless.
*Except*, I also noted that QtCreator was "correcting" my CMAKE_BUILD_TYPE from DEBUG as I typed it to Debug, and as a result, I wasn't actually getting debug info. I had to manually add that (just as you do for CMAKE_TOOLCHAIN_FILE) and then do a make clean and rebuild, then I was up and running.
In reply to @ABL, I've ran into the exact by ericfontainejazz
@ericfontainejazz :
in your CMakelist.txt.user and CMakeCache the CMAKE_TOOLCHAIN_FILE variable pointing to build/mingw32.mingw.cmake is missing, therefore the variables QT_WRC_EXECUTABLE and QT_WINE_EXECUTABLE are not defined and in build.make instead of build/wrc.bat and build/wine.bat for the resfile.o option only empty strings are present.
Have you used the following arguments in a fresh build?
-DCMAKE_BUILD_TYPE=DEBUG -DCMAKE_TOOLCHAIN_FILE=build/mingw32.mingw.cmake -DCMAKE_INSTALL_PREFIX=../win32install
In the CMakelist.txt.user there is only the CMAKE_BUILD_TYPE option.
I think there is maybe an error in the above arguments: CMAKE_TOOLCHAIN_FILE should be defined relative to the folder in which cmake is launched. In the Makefile.mingw it is defined as (note the additional "../")
-DCMAKE_TOOLCHAIN_FILE=../build/mingw32.mingw.cmake
In reply to @ericfontainejazz : in your by ABL
What Marc pointed out here seems to have been true:
After I defined CMAKE_TOOLCHAIN_FILE correctly I pressed "Apply Configuration Changes" button and rebuilt, and that seemed to have done the trick.
But I'm not sure where I went wrong because I believed that I followed https://musescore.org/en/developers-handbook/compilation/compile-instru… to the letter (unless maybe I didn't). In particular I notice I had set CMAKE_TOOLCHAIN_FILE via Manage Kits -> selecting the Qt 5.4.2 version -> and selecting "Change" button for CMake Configuration and clicking OK twice. But I am noticing now that changing it to something bogus doesn't result in the Build Setting's window to reflect what I changed, and I notice there is a warning message "CMake configuration set by the kit was overridden in the project" and that the CMAKE_TOOLCHAIN_FILE variable doesn't reflect the bogus change. So maybe there was a change in qtcreator's ui, or maybe I actually didn't follow those instructions to the 't'.
Anyway it is working now that I modified CMAKE_TOOLCHAIN_FILE in the Build Settings window. I don't know if the handbook needs to be updated somehow, but I guess if I should try checking out musescore to another folder and trying from scratch.
In reply to What Marc pointed out here by ericfontainejazz
For whatever reason, this particular settings gets cached the first time it is specified and gets ignored after that. The compile instructions mention that fact specifically. So it is very important to get this right the first time you run cmake in any given project. Most likely QtCreator kicked off a cmake run before you got around to adding that option. With older versions of QtCreator, this wouldn't likely happen as you were forced to deal with a dialog specifying cmake options before it would ever think about trying to run cmake. Now, depending on how you do things from within QtCreator, it seems it may try an initial run before you specify these options. I'm not sufficiently expert on QtCreator to understand why this might be happening or how to prevent it.
I've faced the same issue and solutions from this thread didn't work for me.
BTW, the trick recommended by Nicolas had worked. I've added it to the instructions: https://musescore.org/en/handbook/developers-handbook/compilation/compi….