CMD searching for mingw32-gcc instead of mingw64-gcc - cmd

C:\Windows\System32>luarocks install krpc
Installing https://luarocks.org/krpc-0.4.8-0.rockspec
Missing dependencies for krpc 0.4.8-0:
luasocket (not installed)
protobuf (not installed)
penlight (not installed)
krpc 0.4.8-0 depends on lua >= 5.1, < 5.3 (5.1-1 provided by VM)
krpc 0.4.8-0 depends on luasocket (not installed)
Installing https://luarocks.org/luasocket-3.1.0-1.src.rock
luasocket 3.1.0-1 depends on lua >= 5.1 (5.1-1 provided by VM)
mingw32-gcc -O2 -c -o src/mime.o -IC:\Program Files (x86)\LuaRocks\include src/mime.c -DLUASOCKET_DEBUG -DWINVER=0x0501
"mingw32-gcc" no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.
Error: Failed installing dependency: https://luarocks.org/luasocket-3.1.0-1.src.rock - Build error: Failed compiling object src/mime.o
Since some parts are in spanish, I'll explain real quick:
"mingw32-gcc" doesn't exist on my computer (="is not recognized as an external or internal command"). I have the 64 bit version installed. By default it searches for the 34 bit version that doesn't work on my computer (I have already tried it out). Where/how do I change my command prompt or just the install command of luarocks to search for the 64 bit version instead?
(I'm sorry if the tags are messed up, but I can't think of better tags and it's my first time using stack overflow)
What I've tried:
I did change my CMakeLists.txt to this
SET(CMAKE_C_COMPILER "C:/msys64/mingw64/bin/gcc.exe")
SET(CMAKE_CXX_COMPILER "C:/msys64/mingw64/bin/g++.exe")
but it still searches for the 32 bit one. There is a Path to the bin of the 64 bit version, and I have deleted the 32 bit Paths. Still isn't working.

Related

Package gtk4 was not found in the pkg-config search path

I've installed MSYS2 on Windows 7 and I have successfully executed
pacman -S mingw-w64-x86_64-gtk3
(the above as per Step 2 of Setting up GTK for Windows) and
pacman -S mingw-w64-x86_64-toolchain base-devel
but when I try to compile the hello world with
gcc -o hello-world-gtk hello-world-gtk.c `pkg-config --cflags --libs gtk4`
I get the following
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk4', required by 'virtual:world', not found
bash: gcc: command not found
If I try from MinGW 64-bit shell the output is
MyHome#MyHome-PC MINGW64 ~
$ gcc -o hello-world-gtk hello-world-gtk.c `pkg-config --cflags --libs gtk4`
Package gtk4 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk4.pc'
to the PKG_CONFIG_PATH environment variable
Package 'gtk4', required by 'virtual:world', not found
hello-world-gtk.c:1:10: fatal error: gtk/gtk.h: No such file or directory
1 | #include <gtk/gtk.h>
| ^~~~~~~~~~~
compilation terminated.
I've also checked that
$ echo $PKG_CONFIG_PATH
/mingw64/lib/pkgconfig:/mingw64/share/pkgconfig
the above as per Step 2 of Setting up GTK for Windows
They seem to have some outdated instructions on their site.
I actually have had to setup the following package
pacman -S mingw-w64-x86_64-gtk4
A couple of possible runtime issues
Then I could compile the example but it is not running fine. I still get a runtime error:
---------------------------
hello-world-gtk.exe - Errore di sistema
---------------------------
Impossibile avviare il programma perché libgio-2.0-0.dll non è presente nel computer. Per risolvere il problema, provare a reinstallare il programma.
Looking at this issue I've tried adding C:\msys64\mingw64\bin to my sys PATH: it does not show the runtime error but the exe is really not working anyway (the app does not show up as expected).
AFAICS gtk4-demo-application itself is not running fine on my Windows, so finally I've had to revert to GTK3 and I compiled the example the GTK3 getting started
gcc `pkg-config --cflags gtk+-3.0` -o example-1 example-1.c `pkg-config --libs gtk+-3.0`
and the above compiles and runs fine.
Solution of the runtime issue
Otherwise, there is the option to build GTK4 on Windows from source without MSYS2.
It is very important this note
It works out of the box on my VirtualBox machine, however on my physical PC with an intel GPU, I get a crash at startup:
Unhandled exception at 0x5211345E (ig4icd32.dll) in gtk4-demo.exe: 0xC0000005: Access violation reading location 0x00000050
This can be worked around by using cairo rendering:
C:\src\gtk>set GSK_RENDERER=cairo
C:\src\gtk>C:\gnome\bin\gtk4-demo.exe
Conclusion: procedure for GTK4 on MSYS2
In conclusion set GSK_RENDERER=cairo is the same fix that does the trick also to run the executable compiled under MSYS2, therefore the final solution consists of
installing pacman -S mingw-w64-x86_64-gtk4
adding C:\msys64\mingw64\bin; in the start of the PATH system environment variable
adding a new GSK_RENDERER system environment variable with value cairo
use the MSYS2 MinGW 64 bit shell to compile (as GTK4) and run the exe

Error while compiling Halide program using Linux command in Windows environment through Cygwin

I downloaded Halide binaries for Linux. For compiling the tutorial programs(especially the autoscheduler program), I need to install g++ version 5.3. But, I am not able to install this particular version. How to solve the problem? Please find the instructions below copied from the link : https://github.com/halide/Halide/releases
Update 1:
I ran the command sudo apt install g++-5.3 . I got the error "Unable to locate the package g++5.3"
Update 2:
These are some of the errors I get.
Update 4:
I want to run this program :
https://halide-lang.org/tutorials/tutorial_lesson_21_auto_scheduler_generate.html.
The linux command is given at the very top of the above link. I am pasting it below:
g++ lesson_21_auto_scheduler_generate.cpp ../tools/GenGen.cpp -g -std=c++11 -fno-rtti -I ../include -L ../bin -lHalide -lpthread -ldl -o lesson_21_generate
Additionally, I moved the "libHalide.a" file from the lib folder to the bin folder and executed the commmand.
The problem is that you're on Windows, as your references to x86_64-pc-cygwin and /cygdrive/c in your screenshot indicate, but you're trying to use the Linux binaries. Cygwin is only source-compatible with Linux programs, not binary-compatible. Here's your choices:
Use the Windows or MinGW downloads instead of the Linux ones (you may have to switch to MinGW)
In Ubuntu in VirtualBox, just install g++ instead of g++-5.3, and then use the Linux download there

Compiling Qt statically on Windows XP and MinGW fail. Is it possible to achieve?

I need to compile Qt statically. I have to do it on a virtual machine running Windows XP. Because of this requirement, I can't use the PowerShell 3.0 script suggested in the wiki page How to build a static Qt for Windows/MinGW (PowerShell 3.0 can't be installed on WinXP).
I tried to read the script and do its work step by step manually.
I added to the end of C:\Qt\5.3\Src\qtbase\mkspecs\win32-g++\qmake.conf file:
# [QT-STATIC-PATCH]
QMAKE_LFLAGS += -static -static-libgcc
QMAKE_CFLAGS_RELEASE -= -O2
QMAKE_CFLAGS_RELEASE += -Os -momit-leaf-frame-pointer
DEFINES += QT_STATIC_BUILD
I ran the configuration:
mkdir C:\Qt\5.3\Static-build
cd C:\Qt\5.3\Static-build
..\Src\configure.bat -static -debug-and-release -platform win32-g++ \
-prefix C:\Qt\5.3\Static -qt-zlib -qt-pcre -qt-libpng -qt-libjpeg \
-qt-freetype -opengl desktop -qt-sql-sqlite -no-openssl -opensource \
-confirm-license -make libs -nomake tools -nomake examples -nomake tests
and that seems OK:
This is the Qt for Windows Open Source Edition.
You have already accepted the terms of the license.
Creating qmake...
mingw32-make: Nothing to be done for 'first'.
Running configuration tests...
Environment:
INCLUDE=
Unset
LIB=
Unset
PATH=
C:\Qt\5.3\mingw482_32\bin
C:\Qt\Tools\mingw482_32\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\Program Files\Git\git-cheetah\..\bin
C:\WINDOWS\system32
C:\WINDOWS
C:\WINDOWS\System32\Wbem
C:\Program Files\Git\cmd
C:\Program Files\TortoiseGit\bin
C:\Program Files\CMake\bin
C:\Python27
C:\StrawberryPerl\perl\bin
C:\StrawberryPerl\win32
C:\WINDOWS\system32\WindowsPowerShell\v1.0
Configuration:
pcre
debug
compile_examples
Qt Configuration:
minimal-config
small-config
medium-config
large-config
full-config
debug_and_release build_all release
debug
c++11
static
zlib
gif
jpeg
png
freetype
build_all
accessibility
opengl
audio-backend
native-gestures
qpa
iconv
concurrent
QMAKESPEC...................win32-g++ (commandline)
Architecture................i386, features:
Host Architecture...........i386, features:
Maketool....................mingw32-make
Debug build.................yes (combined)
Default build...............debug
Force debug info............no
C++11 support...............yes
Link Time Code Generation...no
Accessibility support.......yes
RTTI support................yes
SSE2 support................yes
SSE3 support................yes
SSSE3 support...............yes
SSE4.1 support..............yes
SSE4.2 support..............yes
AVX support.................yes
AVX2 support................yes
NEON support................no
IWMMXT support..............no
OpenGL support..............yes
Large File support..........yes
NIS support.................no
Iconv support...............yes
Evdev support...............no
Mtdev support...............no
Inotify support.............no
eventfd(7) support..........no
Glib support................no
CUPS support................no
OpenVG support..............no
OpenSSL support.............no
Qt D-Bus support............no
Qt Widgets module support...yes
Qt GUI module support.......yes
QML debugging...............yes
DirectWrite support.........no
Use system proxies..........no
QPA Backends:
GDI.....................yes
Direct2D................no
Third Party Libraries:
ZLIB support............qt
GIF support.............yes
JPEG support............yes
PNG support.............yes
FreeType support........yes
Fontconfig support......no
HarfBuzz-NG support.....no
PCRE support............qt
ICU support.............no
ANGLE...................no
Dynamic OpenGL..........no
Styles:
Windows.................yes
Windows XP..............yes
Windows Vista...........yes
Fusion..................yes
Windows CE..............no
Windows Mobile..........no
Sql Drivers:
ODBC....................no
MySQL...................no
OCI.....................no
PostgreSQL..............no
TDS.....................no
DB2.....................no
SQLite..................yes (qt)
SQLite2.................no
InterBase...............no
Sources are in..............C:\Qt\5.3\Src\qtbase
Build is done in............C:\Qt\5.3\Static-build\qtbase
Install prefix..............C:\Qt\5.3\Static
Headers installed to........C:\Qt\5.3\Static\include
Libraries installed to......C:\Qt\5.3\Static\lib
Arch-dep. data to...........C:\Qt\5.3\Static
Plugins installed to........C:\Qt\5.3\Static\plugins
Library execs installed to..C:\Qt\5.3\Static\bin
QML1 imports installed to...C:\Qt\5.3\Static\imports
QML2 imports installed to...C:\Qt\5.3\Static\qml
Binaries installed to.......C:\Qt\5.3\Static\bin
Arch-indep. data to.........C:\Qt\5.3\Static
Docs installed to...........C:\Qt\5.3\Static\doc
Translations installed to...C:\Qt\5.3\Static\translations
Examples installed to.......C:\Qt\5.3\Static\examples
Tests installed to..........C:\Qt\5.3\Static\tests
WARNING: Using static linking will disable the use of plugins.
Make sure you compile ALL needed modules into the library.
Generating Makefiles...
Qt is now configured for building. Just run mingw32-make.
To reconfigure, run mingw32-make confclean and configure.
But the compilation with mingw32-make failed at some point:
cd qml/ && ( test -e Makefile || c:/Qt/5.3/Static-build/qtbase/bin/qmake.exe C:/Qt/5.3/Src/qtdeclarative/tools/qml/qml.pro -o
Makefile ) && c:/Qt/Tools/mingw482_32/bin/mingw32-make -f Makefile
'QT_PLUGIN_PATH' n'est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.
Project ERROR: Failed to parse qmlimportscanner output.
Makefile:94: recipe for target 'sub-qml-make_first' failed
mingw32-make[2]: *** [sub-qml-make_first] Error 3
mingw32-make[2]: Leaving directory 'c:/Qt/5.3/Static-build/qtdeclarative/tools'
Makefile:66: recipe for target 'sub-tools-make_first' failed
mingw32-make[1]: *** [sub-tools-make_first] Error 2
mingw32-make[1]: Leaving directory 'c:/Qt/5.3/Static-build/qtdeclarative'
Makefile:101: recipe for target 'module-qtdeclarative-make_first' failed
mingw32-make: *** [module-qtdeclarative-make_first] Error 2
Sorry for the french wording. The interesting point is:
'QT_PLUGIN_PATH' is not recognized as internal or external command, an executable program or a command file
I found other people having the same issue (here) and tried the solution they suggested (from here):
I added
QMAKE_LFLAGS_STATIC_LIB += -static
to qtbase/mkspecs/win32-g++/qmake.conf and added
static:win32: QMAKE_LFLAGS += $$QMAKE_LFLAGS_STATIC_LIB
to qtbase/mkspecs/features/default_post.prf
I still have the error.
So I have 2 questions:
Do you know if it is possible to compile Qt 5.3 on Windows XP with MinGW?
Does someone know how to fix the error 'QT_PLUGIN_PATH' is not recognized [...]?
Ok, for a weird reason, after closing my console, re-opening it and re-trying, it worked :/ I leave this question open in case that someone have a better explanation for "'QT_PLUGIN_PATH' is not recognized [...]" error. Apparently I was not the first to get stuck on this error.

How to Compile 32-bit Apps on 64-bit RHEL?

I'm trying to compile a 32-bit C application on RHEL 7 64-bit using gcc 4.8. I'm getting a compiler error /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory. What do I need to do to get 32 bit apps compiled and linked?
To get RHEL 7 64-bit to compile gcc 4.8 32-bit programs, you'll need to do two things.
Make sure all the 32-bit gcc 4.8 development tools are completely installed:
sudo yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686
Compile programs using the -m32 flag
gcc pgm.c -m32 -o pgm

mingw32-g++ compile to 16bit instead of 32 or 64

I'm compiling very simple code in windows7 64bit.
(in C:\MinGw\bin) "mingw32-g++.exe -c -Wall filepath\filename.cpp -o filepath\filename.exe"
When the .exe run, it give me 16-bit incompatibility error on the system.
Adding -m32 in the compiling arguments, the result are the same;
I'm using MinGwfrom www.mingw.com actually I don't want use IDE.
What could be the solution?
p.s. This happen since I've installed and try various IDE, it is possible that some of these have installed a different version of mingw, have changed some path or have changed the configuration somewhere. I tried code::blocks, codelite, microsoft visual studio express(didn't go right).
Thanks

Resources