How to use a .rc file? - windows

I haven't used a .rc file yet. I was looking for how to set the filename/version/product name etc of a Qt assembly file, found this. I created an empty file named resources.rc and the version.h header and added in the .pro file RC_FILE = resources.rc. But when I went to build the application I get this error:
gcc: error: Message\: No such file or directory
gcc: error: Kernel: No such file or directory
windres: preprocessing failed.
Makefile.Release:158: recipe for target 'release/resources_res.o' failed
mingw32-make[1]: *** [release/resources_res.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/jack/Desktop/foo/build-Message Kernel-Desktop_Qt_5_5_0_MinGW_32bit-Release'
mingw32-make: *** [release] Error 2
makefile:34: recipe for target 'release' failed
00:43:58: The process "C:\Qt2\Qt5.5.0\Tools\mingw492_32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project Message Kernel (kit: Desktop Qt 5.5.0 MinGW 32bit)
When executing step "Make"
How do I fix this?

Found the error! Hope this is useful to anyone!
My project name contains white spaces, by looking carefully at compiler output tab (in Qt creator) I noticied that the path passed to windres utility wasn't surrounded by quotes (as a path with spaces in name should be) causing the error:
gcc: error: Message: No such file or directory
So I just removed the spaces from project name and this worked just fine.
Here's the Qt version this is happening:

Related

Lua 5.1.5's Makefile Produces Errors for Me

If I try to run the Makefile that comes with the source of Lua 5.1.5, I get the following errors:
gcc: error: #: No such file or directory
gcc: error: DLL: No such file or directory
gcc: error: needs: No such file or directory
gcc: error: all: No such file or directory
gcc: error: object: No such file or directory
gcc: error: files: No such file or directory
What do these errors mean? I would try fixing this issue myself before asking this question, but I don't know how to interpret these errors. If more context is needed, here is the full output.
This is a bug recorded here.
Just edit Makefile and remove # DLL needs all object files.

Pachi cant find caffe/caffe.hpp: No such file or directory

I am attempting to compile Go/Baduk engine Pachi (https://github.com/pasky/pachi) with Caffe (http://caffe.berkeleyvision.org) support.
Caffe install is OK and its located in /something/PACHI_GO_ENGINE/caffe/
caffe.hpp is located in:
/something/PACHI_GO_ENGINE/caffe/distribute/include/caffe/caffe.hpp
/something/PACHI_GO_ENGINE/caffe/include/caffe/caffe.hpp
I also updated the Pachi Makefile as instructed:
- Edit Makefile, set DCNN=1, point it to where caffe is installed and build.
I even made a copy of ...include/caffe/ to /usr/local/lib because this supposed to be a default location.
Makefile changes:
DCNN=1
#CAFFE_LIB=/usr/local/lib
CAFFE_LIB=/something/PACHI_GO_ENGINE/caffe/distribute/include
#(and several variations of this)
And I still get:
[CC] fbook.c
[CC] chat.c
[CXX] dcnn.cpp
dcnn.cpp:13:27: fatal error: caffe/caffe.hpp: No such file or directory
compilation terminated.
Makefile.lib:78: recipe for target 'dcnn.o' failed
make: *** [dcnn.o] Error 1
CAFFE_LIB variable is to point to the path where caffe.so or caffe.a is present. In your case, the dcnn.cpp cannot find the header files.
Though the header files are present in /something/PACHI_GO_ENGINE/caffe/distribute/include they won't be detected by pachi because, header file paths are mentioned using the variable INCLUDES. You will have to append this path to the INCLUDES variable and not the CAFFE_LIB.

Qt Creator Error 258

I'm trying to use Qt Creator for the first time, but I can't manage to get Hello World running. This is what my kit looks like:
Name: MyKit
File system name: MyKitFileSystemName
Device type: Desktop
Device: Local PC
Sysroot: (blank)
Compiler: (long path leading to mingw32\bin\g++.exe)
Environment: No changes.
Debugger: (long path leading to mingw32\bin\gdb.exe)
Qt version: 5.7.0 MSVC2015 64bit
Qt mkspec: (blank)
CMake Tool: (long path leading to cmake\bin\cmake.exe)
CMake Generator: CodeBlocks - MinGW Maketiles
CMake Configuration: (left this as default)
There are some things I should note about the kit. If I use an auto-detected kit, I can't select my compiler. There's also a red octagon next to the kit, I'm not really sure what that means.
When I try to run the Hello World program(from https://wiki.qt.io/Qt_for_Beginners), I get the following issue:
[debug] Error 258
And here's the output:
15:08:56: Running steps for project myProject...
15:08:56: Configuration unchanged, skipping qmake step.
15:08:56: Starting: "C:\Program Files (x86)\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin\mingw32-make.exe"
C:/Program Files (x86)/mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0/mingw32/bin/mingw32-make -f Makefile.Debug
/usr/bin/sh: -c: line 0: syntax error near unexpected token `('
/usr/bin/sh: -c: line 0: `C:/Program Files (x86)/mingw-w64/i686-5.3.0-posix-dwarf-rt_v4-rev0/mingw32/bin/mingw32-make -f Makefile.Debug'
Makefile:34: recipe for target 'debug' failed
mingw32-make: *** [debug] Error 258
15:08:58: The process "C:\Program Files (x86)\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin\mingw32-make.exe" exited with code 2.
Error while building/deploying project myProject (kit: MyKit)
When executing step "Make"
After a quick search, I found this piece of advice: "remove c:/Program Files (x86)/Git/bin from %PATH% environment variable, and make sure QT installation and your project directory not locate at any directory with space or any special characters".
Git was not in my PATH, and there were no spaces or special characters in the QT installation directory or project directory(although there are spaces in the compiler's path).
What am I doing wrong? My best guess is that it's a problem with the compiler. The path has both "mingw-w64" and "mingw32" so I'm not really sure if it's 32-bit or 64-bit. I'm guessing that it would not work if it was 32-bit.
I hope that I'm missing something obvious so that this can be easily resolved!

PROTOBUF_INLINE_NOT_IN_HEADERS

I'm trying to install Open Transactions, the open-source project, on a debian 8. I've installed all the dependencies and am having an issue when compiling (make). The following error is showing at my terminal, even though i made sure to install the protobuf project:
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:64:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Generics.pb.h:501:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:65:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Markets.pb.h:2062:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:66:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Bitcoin.pb.h:833:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
In file included from /root/opentxs/src/../include/opentxs/core/OTStoragePB.hpp:67:0,
from /root/opentxs/src/core/OTStorage.cpp:47:
/root/opentxs/build/src/core/otprotob/Moneychanger.pb.h:1026:6: error: "PROTOBUF_INLINE_NOT_IN_HEADERS" is not defined [-Werror=undef]
#if !PROTOBUF_INLINE_NOT_IN_HEADERS
^
cc1plus: all warnings being treated as errors
src/core/CMakeFiles/opentxs-core.dir/build.make:1368: recipe for target 'src/core/CMakeFiles/opentxs-core.dir/OTStorage.cpp.o' failed
make[2]: *** [src/core/CMakeFiles/opentxs-core.dir/OTStorage.cpp.o] Error 1
make[2]: Leaving directory '/root/opentxs/build'
CMakeFiles/Makefile2:586: recipe for target 'src/core/CMakeFiles/opentxs-core.dir/all' failed
make[1]: *** [src/core/CMakeFiles/opentxs-core.dir/all] Error 2
make[1]: Leaving directory '/root/opentxs/build'
Makefile:150: recipe for target 'all' failed
make: *** [all] Error 2
Any ideas on how to deal with this? Couldn't find any help online.
I had the same problem on Ubuntu 14.04 and I fix it as you said . But I am just writing to explain more the issue.
So , After googling the error I found this discussion . In which they describe that the problem arises from the fact that the google coders are relying on the fact that the C++ standard allows you to treat an undefined preprocessor symbol as evaluating to 0. So there is a bunch of #if directives testing the value of PROTOBUF_INLINE_NOT_IN_HEADERS when it hasn’t been defined anywhere; this is legal and should be treated as if it’s a zero.
I fixed this by adding -DPROTOBUF_INLINE_NOT_IN_HEADERS=0 into CCFLAGS in the the top-level SConstruct and CXXFLAGS in src/SConscript (CXXFLAGS) and that seemed to catch it.
So to fix this , you should add this line in the CMakeList.txt that you find in opentxs main folder :
add_definitions(-DPROTOBUF_INLINE_NOT_IN_HEADERS=0)
And don't forget to repeat the cmake step .
Hope this is more clear and helpful .
Fixed this by adding this line at the top of the CMakelists.txt
add_definitions(-DPROTOBUF_INLINE_NOT_IN_HEADERS=0)

QCA Library for windows

I am compiling the QCA Library for windows and using the steps from INSTALL File for for configure I am using the following command in windows console:
configure.exe --qtdir=C:\QtSDK\Desktop\Qt\4.7.3\mingw
The response is:
Configuring Qt Cryptographic Architecture (QCA) ...
Reason: There was an error compiling 'conf'. See conf.log for details.
I am trying to compile using Qt in windows directly and shows the following error:
-I"c:\QtSDK\Desktop\Qt\4.7.3\mingw\include\ActiveQt" -I"release" -I"." -I"c:\QtSDK\Desktop\Qt\4.7.3\mingw\mkspecs\win32-g++" -o release\mlock.o ..\..\Encryption-QCA\src\botantools\botan\ml_win32\mlock.cpp
In file included from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/objbase.h:73,
from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/ole2.h:9,
from c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/windows.h:114,
from ..\..\Encryption-QCA\src\botantools\botan\ml_win32\mlock.cpp:37:
c:\qtsdk\mingw\bin\../lib/gcc/mingw32/4.4.0/../../../../include/objidl.h:95: error: expected unqualified-id before string constant
mingw32-make[2]: Leaving directory `C:/Users/AlejoLina/Documents/Alejandro/Compacta/SE-HA_Tool/Encryption-QCA-build-desktop/src'
mingw32-make[1]: Leaving directory `C:/Users/AlejoLina/Documents/Alejandro/Compacta/SE-HA_Tool/Encryption-QCA-build-desktop/src'
mingw32-make[2]: *** [release/mlock.o] Error 1
mingw32-make[1]: *** [release] Error 2
mingw32-make: *** [sub-src-make_default] Error 2
The process "C:\QtSDK\mingw\bin\mingw32-make.exe" exited with code 2.
Error while building project qca (target: Desktop)
When executing build step 'Make'
Thanks in advance for the help
I can't say for sure that this is your problem but you may want to try using the make that is available with MSYS. I've always had better success with it. From MinGW's own FAQ..
The "native" (i.e.: MSVCRT dependent)
port of make is lacking in some
functionality and has modified
functionality due to the lack of POSIX
on Win32.
The problem in the configure was that the executable doesnt find the windows make (mingw-make).
The solution is to put the right path to the envinronment variables (qt and mingw bin path).

Resources