I have downloaded the source of GoldenDict using Git, and run lrelease for the locales. Now I have a weird problem where I get this makefile log:
14:55:54: Running build steps for project goldendict...
14:55:54: Starting: "c:\qtsdk\desktop\qt\4.8.1\msvc2010\bin\qmake.exe" D:\GoldenDictSrc\goldendict\goldendict.pro -r -spec win32-msvc2010 "CONFIG+=release"
14:55:56: The process "c:\qtsdk\desktop\qt\4.8.1\msvc2010\bin\qmake.exe" exited normally.
14:55:56: Starting: "C:\QtSDK\QtCreator\bin\jom.exe"
C:\QtSDK\QtCreator\bin\jom.exe -f Makefile.Release
Error: dependent 'folding.cc' does not exist.
jom 1.0.8 - empower your cores
jom: D:\GoldenDictSrc\goldendict-build-desktop-Qt_4_8_1_for_Desktop_-_MSVC2010__Qt_SDK__Release\Makefile [release] Error 2
14:55:56: The process "C:\QtSDK\QtCreator\bin\jom.exe" exited with code 2.
Error while building project goldendict (target: Desktop)
When executing build step 'Make'
while the file folding.cc is available in the same directory, in which the qmake file is.
I have even tried adding the absolute path of folding.cc to the qmake file, but no use.
I'm using QtCreator.
What can be causing this?
Thank you for any efforts.
I have the same problem, and narrowed it down to the fact that QT only supports 122 characters for the path+filename of all dependent files (#includes or .cpp files).
If the path (relative or otherwise) is 123 characters or more, qt gives this error.
Just shorten your folder names, or filename to get the full path+filename to 122 characters or less.
Related
I am trying to create custom directories and copy files into a test folder during the build process of CMake. (This is needed so I can conveniently run a test script that tests another executable which requires certain directories to be available. The target does not actually build any real outputs.)
The goal is to create empty directories called models and logs in the build directory of my target, custom-test.
The CMake command I am using in CMakeLists.txt:
add_custom_target(custom-test ALL
COMMAND ${CMAKE_COMMAND} -E make_directory models logs
)
# Copy files into build dir and the dirs created above
configure_file("config.json" . COPYONLY)
configure_file("temp-model.txt" ./models COPYONLY)
When I build, the logs directory is always created successfully, but weirdly the models directory always produces a build error:
Error creating directory "models".
make[2]: *** [tests/custom-test/CMakeFiles/custom-test.dir/build.make:71: tests/custom-test/CMakeFiles/custom-test] Error 1
make[1]: *** [CMakeFiles/Makefile2:451: tests/custom-test/CMakeFiles/custom-test.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
If I run ls -l tests/custom-test from the BUILD directory, I can see the following entries, which shows that logs was created but models is some kind of dead filepath:
drwxrwxr-x 2 reid reid 4096 Nov 1 10:58 logs
-rw-rw-r-- 1 reid reid 0 Nov 1 10:58 models
My question is why is it only failing to create the models directory? I tried renaming the directory name to modelsdir and other names instead and those all seem to work. But my other applications that I am testing expect there to be a directory called models.
Possibly important side-note: Previously, in my source code I had a subdirectory called models that created a cmake library target models. I have since completely refactored this to another name since I thought cmake might be getting confused, even though that library was unrelated to this test target. I have deleted and regenerated my build directory several times since the refactor which has not helped.
Any help is greatly appreciated :)
EDIT I actually think it may have more to do with the configure_file commands that copy into the newly created directory.
The question comes from my puzzlement when compiling a makefile for Deep Learning framework Caffe on Ubuntu, but it relates, I believe, to a more general phenomenon of the nature of compiling a C++ makefile.
After "make all", the resulting files from the compilation were put in a hidden folder: .build_release, not in the respective folders where the cpp files are.
Then when I tried to run the following lines:
./data/mnist/get_mnist.sh
./examples/mnist/create_mnist.sh
I was getting an error that the system does not find the file:
./create_mnist.sh: 16: ./create_mnist.sh: build/examples/mnist/convert_mnist_data.bin: not found
But the file actually existed in the .build_release folder.
What happened and how to fix this problem?
The issue is not with make, you simply need to follow the instructions carefully. The BUILD_DIR is specified by Makefile.config. By default this folder is named build. Once you followed the compilation instructions:
cp Makefile.config.example Makefile.config
# Adjust Makefile.config (for example, if using Anaconda Python)
make all
make test
make runtest
Navigate to build:
cd build
./data/mnist/get_mnist.sh
./examples/mnist/create_mnist.sh
I am configuring CMake build project on Windows for MSVC++ project.It build ok the executable,then installs it into a defined directory.In my cases that's:
${CMAKE_SOURCE_DIR}/x64/${CMAKE_BUILD_TYPE}/
The executable has got a folder in the same directory with files which it loads upon the launch.If I launch the .exe manually it opens up and runs ok.But I want to do it via ctest.
I defined ctest like this:
add_test(ENGINE_TEST1 ${CMAKE_SOURCE_DIR}/x64/${CMAKE_BUILD_TYPE}/MyApp.exe
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}/x64/${CMAKE_BUILD_TYPE})
When I call from the cmd:
ctest
The executable is starting up but crashes immediately with the error:
Debug Error!
Program:../..../.../MyApp.exe
R6010 -abort() has
been called.
Indeed,when checking the CMake's Last Test.log file it shows that it runs the test not in "WORKING_DIRECTORY but in the directory where the MyApp.exe has been built by CMake.How do I change that?
As I am not CMake pro I am sure the following answer is not the optimal way to do it,but at least it works for me.
Again,I was trying to run ctest on an executable from within the directory into which cmake had installed it.The exe on the startup was trying to load dependent files which were in the same directory.But it was crashing because it couldn't fin the files.
It appears that the cmake default workspace directory is the directory where the cmake files and projects are generated.That's 'build' directory.So when the executable is launched via ctest it search the paths of the files to load relative to the build directory.
Now,CMAKE has 2 variations of add_test() method.One is simple with arguments:
add_test([test_name] [test exe path])
It doesn't take care of the working directory.
And another one which is explained here does include an argument for explicit setup of the working directory.
Frankly speaking,I wasn't able to get this advanced function working as it was demanding to supply some test .config which I didn't understand how to setup.So what I did,I used the simple add_test function.
And then I set the working directory to the location of my executable using this:
set_tests_properties(mytest PROPERTIES WORKING_DIRECTORY "${TEST_WOKRING_DIR}")
And it fixed the problem.
After reorganizing my source files into subdirectories and directing output like
CONFIG( debug, debug|release ) {
DESTDIR = $$PWD/build/debug
} else {
DESTDIR = $$PWD/build/release
}
OBJECTS_DIR = $$DESTDIR/.obj
MOC_DIR = $$DESTDIR/.moc
RCC_DIR = $$DESTDIR/.qrc
UI_DIR = $$DESTDIR/.ui
it seems that a resource file included with
RC_FILE += res/projectname.rc
is not compiled into a corresponding .res file, as jom.exe quickly returns
C:\QtSDK\QtCreator\bin\jom.exe -f Makefile.Debug
Error: dependent '"c:\path\to\projectname\build\debug\.obj\projectname.res"' does not exist.
The file indeed does not exist.
If I manually run "C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\RC.exe /r projectname.rc" and copy the resulting .res file to the folder specified in the Makefile.Debug in LIBS and RES_FILE and in one of the first build rules it works fine.
So the question is, why is the file not created anymore (it works with the old project with all source files in the project directory and default "release" and "debug" dirs).
Adding debug options to Qt Creator's Project>Build Settings for qmake (-Wall) and jom (VERBOSE=2) did not produce much more information about what goes wrong.
The Makefile.Debug has a target for the .res file, where the source file is without absolute path, but even when I complete the path it does not work.
How can I get more debug output from jom to see whether rc.exe is called at all?
Here is the output when it fails:
18:39:45: The process "c:\qtsdk\desktop\qt\4.8.1\msvc2010\bin\qmake.exe" exited normally.
18:39:45: Starting: "C:\QtSDK\QtCreator\bin\jom.exe" VERBOSE=2
C:\QtSDK\QtCreator\bin\jom.exe -f Makefile.Debug
Error: dependent '"c:\path\to\projectname\build\debug\.obj\projectname.res"' does not exist.
jom 1.0.8 - empower your cores
jom: c:\path\to\projectname\Makefile [debug] Error 2
18:39:46: The process "C:\QtSDK\QtCreator\bin\jom.exe" exited with code 2.
Error while building project projectname (target: Desktop)
When executing build step 'Make'
I have also added the SDK's path to the system variables. I am using VS C++ 2010 Express to compile.
Possible cause: Redefining the build directory apparently caused the tools to use the absolute path which contains spaces, resulting in a program call to fail (but which? rc.exe's`)
Solution: No further information about getting proper debugging output of the toolchain (jom and qmake), but making sure no spaces are in the path resolved the problem: the executable has its resource information embedded again..
I am trying to compile the Hello example in directory lib/Transforms/Hello, which is basically a Hello World of LLVM pass, but I get the following error when I try to compile it using make.
../../../Makefile.common:61: ../../../Makefile.config: No such file or directory
../../../Makefile.common:69: /Makefile.rules: No such file or directory
make: *** No rule to make target `/Makefile.rules'. Stop.
Any idea what is the problem and how to fix it?
If you built LLVM + Clang according to instructions, the Hello sample should have already been built. Go to lib/Transforms/Hello in the build directory (where you ran configure and then make). There should be a Debug+Asserts (or whatever configuration you compiled) there. And you can also run make from there again.
In general, you always make from the build directory, not the source directory. The build directory has all the Makefiles properly set up.