JOM files not being generated - qt

I'm porting a qt project that compiles on a MacOS to Windows. I've managed to more or less fix all of the compiler errors, but I'm now met with this:
18 warnings generated.
/OUT:debug\editor.exe #C:\Users\User\AppData\Local\Temp\editor.exe.10472.84781.jom
The system cannot find the path specified.
jom: C:\Source\build-project-qt-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\src\Makefile.Debug [debug\editor.exe] Error 1
jom: C:\Source\build-project-qt-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\src\Makefile [debug] Error 2
jom: C:\Source\build-project-qt-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\Makefile [sub-src-make_first] Error 2
02:32:53: The process "C:\Users\User\msvc_make.bat" exited with code 2.
Error while building/deploying project project (kit: Desktop Qt 5.12.9 MSVC2017 64bit)
When executing step "Make"
I've been looking for hours and I have no idea why this isn't being generated. I would very much like to not disable JOM if I don't have to (not that I haven't tried, setting CMake generator in the kit to NMake Makefiles with Codeblock instead of NMake Makefiles JOM with Codeblocks just gives me the same error).
EDIT: This is the part of the Makefile.debug file which seems to invoke the editor.exe:
####### Build rules
first: all
all: Makefile.Debug debug\editor.exe
debug\editor.exe: C:\Source\build-project-Desktop_Qt_5_12_9_MSVC2017_64bit-Debug\src\..\lib\cocos2d\debug\cocos2d.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5OpenGLd.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5Widgetsd.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5Guid.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5Xmld.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\Qt5Cored.lib C:\Qt\Qt5.12.9\5.12.9\msvc2017_64\lib\qtmaind.lib ui_mainwindow.h ui_setprojectpathdialog.h $(OBJECTS)
$(LIBAPP) $(LIBFLAGS) /OUT:$(DESTDIR_TARGET) #<<
[here is a list of paths to a bunch of obj files in a debug folder]
<<
Here are the variables I was able to find:
DESTDIR = debug\ #avoid trailing-slash linebreak
TARGET = editor.exe
DESTDIR_TARGET = debug\editor.exe
OBJECTS is a list of obj files in the debug folder.

It would seem that LIBAPP is indeed unset. Why that is the case, I don't know. It's dependency, using the same kit and compiler has it set just fine.
Solution I employed is to just set LIBAPP to, in my case, llvm-lib /NOLOGO.
I absolutely hate everything about this.

Related

Build a QT program from command line

I know this question has already been asked, but I encounter an issue that I haven't seen elsewhere.
I am trying to build automatically a QT program on Jenkins through a JenkinsFile.
So I want to build this program in command line.
On Qt Creator, everything works fine, my makefile is generated and the program compiles.
But when I manually type the exact commands that are executed in Qt on a terminal (cmd and cygwin), the compilation fails.
The errors are usually ld: cannot find -lXXXXXX
My guess is that it is an environment problem so I tried to add some lib paths in the $PATH, $LIBRARY_PATH, and $LD_LIBRARY_PATH variables but it doesn't resolve the problem. The error just becomes Undefined reference to ___XXXXXX
I would appreciate some help on this issue !
Thanks.
EDIT
The building (slave) machine is a windows 7. Here is a screenshot of the compilation stage in Qt (which works fine). The commands I try to type in a terminal are exactly the same as the blue lines on the screenshot. (sorry some lines are written in French)
From the error message ld: cannot find -lXXXXXX and the environment variables, I would suppose that you are compiling in Linux/Unix. Now, if you are compiling with g++, the environment variables $PATH, $LIBRARY_PATH, and $LD_LIBRARY_PATH won't have any effect on finding libraries. What you may try is an -L argument to the compiler telling it where the library is located, I mean:
g++ -L /path/to/libXXXXX.so -l XXXXX -o result source.cpp

pcl/pcl_config.h: No such file or directory

My environment is below.
・Operating System and version:windows 10 64bit
・Compiler:C:\msys64\mingw64\bin\g++.exe
・PCL Version:1.9.1
pcl_config.h not found as below error occurred when compiled under above env..
Certainly this header file is not included.
Let me know how to solve it.
PS C:\pcl\pcl\examples\common> g++ -o minmax -I ../../io/include -I ../../common/include .\example_get_max_min_coordinates.cpp
In file included from ../../common/include/pcl/PCLHeader.h:10,
from ../../common/include/pcl/point_cloud.h:47,
from ../../io/include/pcl/io/pcd_io.h:42,
from .\example_get_max_min_coordinates.cpp:2:
../../common/include/pcl/pcl_macros.h:64:10: fatal error: pcl/pcl_config.h: No such file or directory
#include
^~~~~~~~~~~~~~~~~~
compilation terminated.
Short answer
pcl_config.h is generated via pcl_config.h.in by the cmake tool. So it seems that compilation did not finish correctly.
Longer answer
Please make sure you have compiled the relevant modules of PCL (at least pcl-core) before proceeding
You might prefer a pre-built installation from releases or distributed by a package/source manager of your choice
PCL makes heavy use of other libraries and it is best to supply the dependencies (as mentioned below) via CMake or manually via the -I and -l options. If you provide the location of pcl_config.h, the compiler will complain about Eigen next.
The build instructions are available here. TL;DR: After satisfying the dependencies (cmake, c++ compiler, boost, eigen, flann, vtk and other depending on use-case), run the following commands
cd $PCL_SOURCE_DIR
mkdir -p build; cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make -j8
Feel free to use any build generator (like Ninja) or change build type to Debug or RelWithDebInfo as per your needs.

Cross compiling and deploying Valgrind to an embedded linux device

I am trying to cross compile Valgrind on my Fedora VM in order to get it to run on a custom embedded Linux device (running Yacto with a Kinetis KL2x MCU w/ ARM Cortex M4 CPU). I have a QT IDE properly configured to cross compile and deploy QT projects to the device. I was wondering what the best route to cross compile a non QT application. I tried making a new project (in QT>New Project>Import Project>Import Existing Project) using an existing project (Valgrind source code # http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2) and i keep getting this error:
17:20:46: Running steps for project valgrind...
17:20:46: Starting: "/usr/bin/make" all
make: *** No rule to make target `all'. Stop.
17:20:46: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project valgrind (kit: ----)
When executing step "Make"
17:20:46: Elapsed time: 00:00.
and I am not sure how to address it. Is it possible to compile Valgrind just using the cross compiler itself (arm-poky-linux-gnueabi-g++)? Am I better off changing the makefile to use the cross compiler instead of gcc and then use scp to send the file to my device(if so which of the many different makefiles do i use?)? Or is there a better way that I am missing? The system doesn't have any package management tools or compilers of its own. Any help/ input will be GREATLY appreciated.
Errors while building recipe after cross compile environment setup:
[----#localhost valgrind]$ source /opt/poky/default/environment-setup-cortexa8hf-vfp-neon-poky-linux-gnueabi
[----#localhost valgrind]$ bitbake -c build valgrind_3.12.0.bb
Traceback (most recent call last):
File "/opt/poky/1.8.2/sysroots/i686-pokysdk-linux/usr/lib/python2.7/site.py", line 553, in <module>
main()
File "/opt/poky/1.8.2/sysroots/i686-pokysdk-linux/usr/lib/python2.7/site.py", line 535, in main
known_paths = addusersitepackages(known_paths)
File "/opt/poky/1.8.2/sysroots/i686-pokysdk-linux/usr/lib/python2.7/site.py", line 266, in addusersitepackages
user_site = getusersitepackages()
File "/opt/poky/1.8.2/sysroots/i686-pokysdk-linux/usr/lib/python2.7/site.py", line 241, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/opt/poky/1.8.2/sysroots/i686-pokysdk-linux/usr/lib/python2.7/site.py", line 230, in getuserbase
from sysconfig import get_config_var
File "/opt/poky/1.8.2/sysroots/i686-pokysdk-linux/usr/lib/python2.7/sysconfig.py", line 10, in <module>
'stdlib': '{base}/'+sys.lib+'/python{py_version_short}',
AttributeError: 'module' object has no attribute 'lib'
An example of cross compiling valgrind with Yocto toolchain would be :
# setup workspace
mkdir workspace && cd workspace
# download Yocto sdk
wget http://gumstix-yocto.s3.amazonaws.com/sdk.sh
#Install it to workspace/sdk
./sdk.sh
source sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi
# download valgrind tarball
wget http://valgrind.org/downloads/valgrind-3.12.0.tar.bz2
# extract source
tar jxf valgrind-3.12.0.tar.bz2 && cd valgrind-3.12.0
# this fix issue with unknown arm architecture (see http://stackoverflow.com/questions/29514706/cross-compiling-valgrind-for-arm)
sed -i -e "s#armv7#arm#g" configure
./configure --host=arm-poky-linux-gnueabi --prefix="$(pwd)/out"
make -j16
make install
Here, the installation directory is out, you can also install to ${SDKTARGETSYSROOT}/usr with --prefix="${SDKTARGETSYSROOT}/usr"
Check this link for the basic example of cross compile with Yocto SDK
i think the easiest way is to build it in your yocto build environment
(source poky/oe_init_build_env)
and the build valgrind with
bitbake -c build valgrind
then look in the build folder tmp/work/"plattform"/valgrind/"version"/image/ for the files

The command "make serve" not working

I have installed the pNaCl SDK and have run the command "make serve", as instructed to by the website https://developers.google.com/native-client/dev/devguide/tutorial/tutorial-part1 into my console, it does not run any server and produces the error message:
C:\Users\USERNAME\Documents\nacl_sdk\nacl_sdk\pepper_33\getting_started>make serv
e
C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_33/tools/make -C part1 all
process_begin: CreateProcess(NULL, python C:/Users/USERNAME/Documents/nacl_sdk/na
cl_sdk/pepper_33/tools/getos.py, ...) failed.
make[1]: Entering directory 'C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper
_33/getting_started/part1'
make[1]: Makefile:27: pipe: No error
C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_33/toolchain/_pnacl/bin/pnac
l-clang++ -o hello_tutorial.bc hello_tutorial.cc -O2 -IC:/Users/USERNAME/Document
s/nacl_sdk/nacl_sdk/pepper_33/include -LC:/Users/USERNAME/Documents/nacl_sdk/nacl
_sdk/pepper_33/lib/pnacl/Release -lppapi_cpp -lppapi
process_begin: CreateProcess(NULL, C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/
pepper_33/toolchain/_pnacl/bin/pnacl-clang++ -o hello_tutorial.bc hello_tutorial
.cc -O2 -IC:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_33/include -LC:/Us
ers/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_33/lib/pnacl/Release -lppapi_cpp
-lppapi, ...) failed.
make (e=2): The system cannot find the file specified.
Makefile:50: recipe for target 'hello_tutorial.bc' failed
make[1]: *** [hello_tutorial.bc] Error 2
make[1]: Leaving directory 'C:/Users/USERNAME/Documents/nacl_sdk/nacl_sdk/pepper_
33/getting_started/part1'
Makefile:46: recipe for target 'part1_ALL_TARGET' failed
make: *** [part1_ALL_TARGET] Error 2
My username is inserted in the place of USERNAME.
Any ideas what is going on?
I looks like perhaps python is not present in you PATH? Can you run "python" on the command line? What does "where python" produce?
I'm somewhere surprised since python is required to install the SDK in the first place. I've opened a ticket to handle this failure mode:
https://code.google.com/p/chromium/issues/detail?id=348139
I solved this, had the same issues, what i did was (my setup):
It seems compile script doesn't like paths with spaces, like: "C:\Documents and ...".
Make sure python path is at environment variables. "C:\Python27"
Put nacl_sdk folder in "C:\stationary".
Put custom environment variable NACL_SDK_ROOT to "C:\stationary\nacl_sdk\pepper_34".
There i did immediate variable assignee.
A. "cd C:\stationary\nacl_sdk\pepper_34\getting_started".
B. "set NACL_SDK_ROOT C:\stationary\nacl_sdk\pepper_34". This must point to the pepper version you want to build against,
C. "make serve".
And that's it! Works, compiled!
I have encountered and solved the same issue. using comment on old post. I tried building one of the other examples and they seem to work while the getting started one doesn't.
"You will have a hard time building those ppapi tests. I suggest trying to build one of the examples provided with the SDK. If you really need to build that test (it isn't an example) you will need to use clang (another C/C++ toolchain). However, from a cursory look, those tests aren't actually built in NaCl, nor do they generate a PPAPI plugin. I have never gotten clang working on Windows, but it is apparently possible. See clang.llvm.org/get_started.html for instructions using Visual Studio. I would probably use MinGW instead, but I can't find decent instructions for that. – DRayX Oct 21 '13 at 16:08 "

compiling qt 4.7.3 on mingw32 with gcc 4.6.0

I am trying to compile Qt 4.7.3 on mignw32 using gcc 4.6.0.
I get the following error when running ./configure:
In file included from C:/work/qt-gcc-4.6.0/include/QtCore/private/qcore_unix_p.h:1:0,
from C:/work/qt-gcc-4.6.0/src/corelib/io/qfsfileengine_unix.cpp:45:
C:/work/qt-gcc-4.6.0/include/QtCore/private/../../../src/corelib/kernel/qcore_unix_p.h:59:3: error: #error "qcore_unix_p.h included on a non-Unix system"
The weird thing is that I am running Windows 7, and it is trying to include that.
Also in the Makefile it is using qfsfileengine_unix and qfsfileengine_iterator_unix instead of qfsfileengine_win and qfsfileengine_iterator_win.
If I change the Makefile to use the Windows' ones, I get the following error (the file does not exist):
In file included from C:/work/qt-gcc-4.6.0/include/QtCore/../../src/corelib/global/qglobal.h:62:0,
from C:/work/qt-gcc-4.6.0/include/QtCore/qglobal.h:1,
from C:/work/qt-gcc-4.6.0/mkspecs/win32-g++/qplatformdefs.h:53,
from C:/work/qt-gcc-4.6.0/src/corelib/io/qfsfileengine_win.cpp:43:
C:/work/qt-gcc-4.6.0/include/QtCore/qconfig.h:1:46: fatal error: ../../src/corelib/global/qconfig.h: No such file or directory
compilation terminated.
When compiling /qt/src/corelib/io/qfsfileengine_win.cpp
Suggestions?
Try ./configure --help
There is probably a flag for a ms-windows, x86 compilation.
It might be something like:
./configure --target-os=mingw32
Keep in mind -- the os parameter name might be different, and the selectable target values *might be different* -- with scripts from different authors -- some values you might encounter might be 'win32', 'win32-386', 'x86-windows32', etc.
See if
./configure --help
Won't give you a list...
You can also redirect its output to a file for easy reading in your favorite editor,
./configure --help > myconfighelp.txt
Good luck!

Resources