GammaRay icon indicating copy to clipboard operation
GammaRay copied to clipboard

Fails to build with Visual Studio project files

Open krf opened this issue 6 years ago • 10 comments

Reported by: Jan Willemsen [email protected]

Problem:

10>Generating C:/Work/Development/Elsyca/GammaRay/KDAB-GammaRay-7988a77/common/classesiconsindex_data.cpp
10>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppCommon.targets(171,5): error MSB6006: "cmd.exe" exited with code -1073741511.

I suspect that the CMake custom target for classesiconsindex_data is problematic when being executed from Visual Studio project files. The build succeeds when the NMake Makefiles generator is used in CMake.

krf avatar Sep 19 '17 12:09 krf

The build fails for me mainly because the directory that contains qmake.exe of my selected qt version is not in the PATH. OTOH, it should NOT be in the path. The GammaRay cmake files build tools that they also want to execute. That does NOT work on Windows because the Qt .dll files are not copied to that directory! Additionally, some dependencies are probably not set up correctly because I need multiple passes to compile the solution in VS2015. But in the end it works. "Building" the INSTALL target compile a whole bunch more and every lands in the install destination.

Again, the Qt .dll files are NOT deployed to that directory.

The whole process does not seem to be tested on Windows at all.

Additionally, it doesn't work as gammray.exe describes itself: "When run without any options, gammaray.exe will present a list of running Qt-applications from which you can attach the selected injector." Instead, it just prints the help text.

hsattler avatar Oct 17 '17 11:10 hsattler

BTW: don't use nmake on Windows -> only compiles with 1 CPU!

GNU make is also unreliable on Windows (randomly fails to work).

Ninja build tool seems to be the nicest console tool but the project to be build kind of has to comply with it. It did not test it for GammaRay.

With Visual Studio, the console using "cmake --build ." does not work for GammaRay but the IDE does with a bit of help.

hsattler avatar Oct 17 '17 11:10 hsattler

And something wrong with the cmake files because during building the solution, some files already pop up in "C:\Program Files\GammaRay" (I've built it for Qt 5.9 64-bit). That's actually a no-go :-/

hsattler avatar Oct 17 '17 14:10 hsattler

For the record: ninja works fine with GammaRay, we've been using it for ages with it.

krf avatar Oct 19 '17 09:10 krf

And something wrong with the cmake files because during building the solution, some files already pop up in "C:\Program Files\GammaRay" (I've built it for Qt 5.9 64-bit). That's actually a no-go :-/

@hsattler Please be more precise, which files end up there? And also, please create a new/separate bug report for this. It's unrelated to this issue.

krf avatar Oct 19 '17 09:10 krf

@krf: Everything produced by the multilib sub-build. That's due to not using an intermediate install directory for that sub-build but ${CMAKE_INSTALL_PREFIX}. You should use a local directory and an additional install(DIRECTORY) command to copy it over. Then it may also work with CPack. OTOH, maybe I did something wrong? Could be the special property EXCLUDE_FROM_DEFAULT_BUILD vs. EXCLUDE_FROM_ALL.

hsattler avatar Oct 19 '17 11:10 hsattler

BTW: Good to know that ninja is a tested build configuration, will use it next time instead...

hsattler avatar Oct 19 '17 11:10 hsattler

@krf hi, i am tring to compile GammaRay in windows with nmake/mingw, but both failed,could you tell me how to use ninja to compile GammaRay? is it same as using nmake(cmake -G "NMake Makefile" ..)?

TrigoldenZx avatar May 25 '18 09:05 TrigoldenZx

Hi,

it is as simple as cd <build_dir> cmake -Gninja -DCMAKE_BUILD_TYPE=Release <source_dir> cmake --build . --target install

Or simply start cmake-gui from that shell.

Am 25. Mai 2018 11:16:07 MESZ schrieb TrigoldenZx [email protected]:

@krf hi, i am tring to compile GammaRay in windows with nmake/mingw, but both failed,could you tell me how to use ninja to compile GammaRay? is it same as using nmake(cmake -G "NMake Makefile" ..)?

-- You are receiving this because you were mentioned. Reply to this email directly or view it on GitHub: https://github.com/KDAB/GammaRay/issues/440#issuecomment-391993402

hsattler avatar May 26 '18 11:05 hsattler

@hsattler thank you very much for your help!

TrigoldenZx avatar May 28 '18 00:05 TrigoldenZx