WxWidgets with Mingw wx/msw/libraries.h: not found - c++

I'm using Debian 11, I installed Mingw and built WxWidgets with the following command:
../configure --prefix=/usr/x86_64-w64-mingw32 --host=x86_64-w64-ming32 --build=x86_64-linux --with-msw && make && sudo make install
And I'm using the following command to build:
x86_64-w64-mingw32-g++ wx.cpp `wx-config --cxxflags --libs std,aui`
I receive the following error:
wx/msw/libraries.h: not found
But file exists at: /usr/x86_64-w64-mingw32/include/wx-3.2/wx/msw/libraries.h
Where am I going wrong?
PS: I don't use any kind of IDE.

Friends, it finally worked, that's what you said above, the wx-config that is linked to the terminal, is only for linux, what was with the compilation for Windows inside /usr/x86_64-w64-mingw32/bin /wx-config.
When I want to compile for linux I pass:
g++ wx.cpp `wx-config --cxxflags --libs std,aui`
When I go to Windows I pass:
x86_64-w64-mingw32-g++ wx.cpp `/usr/x86_64-w64-mingw32/bin/wx-config --cxxflags --libs std,aui`
PS: I had to copy some dlls to the application folder, but it all worked out.
Thank you very much for everyone's patience.

Related

Setting up a .pro file for a WxWidgets project in QtCreator in Ubuntu 18.04

I installed WxWidgets-3.2 from source on Ubuntu 18.04 following these instructions:
$ cd buildgtk
$ ../configure --with-gtk
$make
$ sudo make install
$ sudo ldconfig
Everything was installed successfully.
Also I have a QtCreator 4.5.2, Qt 5.9.5,GCC compiler 7.3, qmake.
Here is wx-config result:
wx-config --cxxflags
-I/usr/local/lib/wx/include/gtk3-unicode-3.2 -I/usr/local/include/wx-3.2 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXGTK__ -pthread
wx-config --libs
-L/usr/local/lib -pthread -lwx_gtk3u_xrc-3.2 -lwx_gtk3u_html-3.2 -lwx_gtk3u_qa-3.2 -lwx_gtk3u_core-3.2 -lwx_baseu_xml-3.2 -lwx_baseu_net-3.2 -lwx_baseu-3.2
Now I want to create my first WxWidgets project in QtCreator in Ubuntu 18.04.
To do this, I need to correctly configure a .pro file.
Let me know what the .pro project file should look like so I can run a simple WxWidgets example

geos: No such file or directory

I am trying to use the geos library on a Raspbery Pi 3, using Debian. I am trying to compile a program in C ++.
The same program can be compiled on other computers, this means that the source code of my program is correct.
When executing the command geos-config --version, version 3.7.1 is returned to me.
A while ago, a friend compiled and has been using the same code in Raspibian. However, I can't run it on Debian. My friend does not remember how he installed the geos library.
Would anyone know of anything that could help me?
make
Building target using GCC compiler: sources/geometry-manager.cpp
g++ -g -c sources/geometry-manager.cpp -std=c++17 -w -c -rdynamic -W `wx-config --cxxflags --libs --gl-libs` `geos-config --cflags` -lgeos -lglut -lGLU -lGL -lm -lGLEW -o builded/geometry-manager.o `pkg-config --libs geographiclib`
In file included from sources/geometry-manager.cpp:14:
sources/../include/geometry-manager.hpp:26:10: fatal error: geos.h: No such file or directory
#include <geos.h>
^~~~~~~~
compilation terminated.
make: *** [Makefile:37: builded/geometry-manager.o] Error 1
geos-config --includes : /usr/include.
geos-config --cflags : -I/usr/include.
geos-config --libs : -L/usr/lib/aarcg64-linux-gnu -lgeos-3.7.1 .
I installed via apt-get. However, as it didn't work, I installed it from the cloned github repository. –
Solution:
I uninstalled geos from my computer. Afterwards, I deleted all the folders related to geos that were still on the computer.
For some reason, the installation from the current repository did not work. So I cloned an old version of the geos.
https://github.com/libgeos/geos.git
I ran autogen.sh script (which didn't work before).
And this time it compiled and installed it successfully.
Thanks

How to develop libvirt C++ apps in Mac OS

I want to develop c++ apps that use libvirt api (libvirt/libvirt.h) in Mac OS. In Ubuntu once I installed libvirt-dev, it was compiling fine. but in mac I cannot find a way to install libvirt-dev. Can someone point me to the correct path. Thanks :D
If you install homebrew first, from the Homebrew website, then you will be able to simply install libvirt with:
brew install libvirt
If you want to compile against libvirt, I would further suggest you install pkgconfig with:
brew install pkgconfig
After that you can use pkgconfig to find the switches and flags you need for libvirt like this:
pkg-config --cflags --libs libvirt
which will give you something like:
-I/usr/local/Cellar/libvirt/3.4.0/include -L/usr/local/Cellar/libvirt/3.4.0/lib -lvirt
So, in conclusion, you will then be able to compile C code with:
gcc program.c $(pkg-config --cflags --libs libvirt) -o program
or
clang program.c $(pkg-config --cflags --libs libvirt) -o program
or C++ code with:
clang++ program.cpp $(pkg-config --cflags --libs libvirt) -o program

SDL with g++ on OSX Lion

Dose anyone know how to set up SDL (simple direct media layer) on OSX Lion so I can compile my code with g++ ?
I have read the "readme" that comes with the package and I have placed the frameworks folder in the relevant directory, however, this does not seem to be enough.
Can anyone help me ?
(I do not want to use Xcode)
If you're not using XCode, and are compiling SDL projects using gcc, you can run:
gcc -o test SDLTest.c `sdl-config --cflags --libs`
g++ -o test SDLText.c `sdl-config --cflags --libs`
This works happily for me on my mac - sdl-config --version returns 1.2.14, and I can run test :)

WxGTK won't link under Arch Linux

So I have this Wx application written in C++ that I've tested under Linux Mint, Ubuntu, and even Mac but under Arch Linux it doesn't seem to link correctly. I've installed the wxgtk library required and the compilation works fine but when it gets to the linking stage I get a lot of output saying that none of the Wx methods could be found. wx-config --libs output looks correct to me so I'm not sure what's causing the problem. I will post my Makefile if necessary but it seems this issue is only specific to Arch Linux so far.
Just in case anyone is bashing their head over this I changed the linker line from
g++ `wx-config --libs` -o $(OBJS)
to
g++ -o $(OBJS) `wx-config --libs`
The reason for this is detailed in rodrigo's comment below.