boost on python on Mac - c++

I am trying to use boost library on Python. In C++ I include boost\python.hpp but it says it cannot open pyconfig.h. How should I do that? I have a Mac with Parallels installed and my C++ code is in Visual Studio on Parallels. I installed homebrew and boost from the terminal, I already had boost on the Parallels side which I have used different times in C++. In short, I did a mess. How can I fix this?
Thanks!!

You need to find pyconfig.h on your machine, then add its directory to your build like -I/some/path. Often it will be in a directory called python3.7 or whatever version you have.

Related

What is an easy way to install a unix terminal with a C++ mingw compiler?

I'm going to teach students to use SFML with C++, and I'm afraid the school doesn't have visual studio C++ installed, or will be a bit heavy to use for those students.
I want to have a plan B and have the option of a simple makefile that I can build on windows with SFML.
https://www.sfml-dev.org/download/sfml/2.5.1/ this page offers binaries compiled with different, specific versions of mingw with their respective mingw package links, unfortunately mingw doesn't include an unix terminal, like the one included with git-bash, so I can run a makefile.
What are the steps required to have a problem unix terminal, running in windows, minsys, msys2 or not, that can work well with those mingw packages? I have trouble finding help or proper instructions.
You want https://www.msys2.org/
It provides bash terminal and already contains mingw compiler. Perhaps it even has SFML packages already.

not able to install boost library for c++ in windows

I am trying to install boost library for c++ in windows. I am using a GCC compiler. I searched for it on the internet but everywhere the only installation of boost library in visual studio is given.
I found somewhere to go to boost/tools/build and then to run bootstrap.sh, but the following error is being shown:
C:\Program Files\boost_1_73_0\tools\build>bootstrap.sh The system cannot execute the specified program.
How should I resolve this issue?
https://www.boost.org/doc/libs/1_73_0/more/getting_started/windows.html#install-boost-build
here is instruction to install boost on windows. File you want to open is shell script (probably taken from Linux instructions), which generally should not be called on Windows. Use bootstrap.bat instead.

Installation and use of GDAL library in mingw for windows

I try to use GDAL library in MinGW on a Windows 7 system. I downloades the GDAL 2.0.0 from gdal.org and did the built and install like described here: https://trac.osgeo.org/gdal/wiki/BuildingWithMinGW. This worked fine without any errors. When I now try to include gdal.h or gdal_priv.h in a C++ file msys says: fatal error: gdal.h: no such file or directory. Did I forget anything? Do I need to place the built dll files anywhere else?
Thank you very much for your help!
Cheers,
Joachim

C++ Development CodeBlock Ubuntu with Boost Library

I majorly work in Java but I have to switch to C++ for development for one project.
I done my research and find that in order to do portable code in C++, I need to use Boost or QT libraries etc. Therefore, now I download CodeBlock IDE in Ubuntu but afraid how to start building project. I search alot in the web to how to use Boost with CodeBlock but each time I only find it working/configure with Windows. http://wiki.codeblocks.org/index.php?title=BoostWindowsQuickRef
Can please guide me regarding how to configure Boost library with CodeBlock in Ubuntu so that I can write Portable code.
Please also let me know if I am wrong in direction to write portable code which must be support in both Linux and Windows environment.
Have a look at http://www.boost.org/doc/libs/1_52_0/more/getting_started/unix-variants.html
If you dont't need the latest version of boost you should install boost on ubuntu using
apt-get install libboost*

Eclipse Ganymede and MinGW in Windows

I'm trying to get eclipse to work with MinGW.
I've done the following:
Downloaded CDT for eclipse.
Installed MinGW.
Added C:\MinGW\bin to my path.
Opening a command prompt (CMD) and typing g++ or alike works fine.
I run eclipse, create a "New C++ Project", and only get the option saying "other toolchains".
There's a MILLION tutorials out there saying eclipse should identify MinGW on its own. It doesn't, and I don't know what to do. I've tried reinstalling everying in just about every order posible. Still no luck.
I've also noted some tutorials say something about creating a "Managed C++ Project". I've no such option, all I get is "C++ Project" and "C Project"
edit:
I have eclipse ganymede, windows x86_64, version 3.4.2
http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/index.php
Running the "Eclipse IDE for C/C++ developers" fails, since there's no x64 version for windows. The x86 version requires x86 JAVA installed as well, and installing two versions of java, gave nothing but trouble in the past.
The instructions for setting up MinGW in Ganymede are located here.
The following are instructions and
links on how to install the current
version of MinGW. Note that these
links may become inaccurate over time
as new versions of MinGW components
are introduced. Please check the MinGW
File Release section for the latest
versions.
Download and run the MinGW setup program, MinGW-5.1.3.exe.
Select download and install the MinGW base tools and the g++ compiler.
You may select the Current or
Candidate version of these tools. You
may also install any of the other
available compilers as well.
Do not install the MinGW Make feature as the MSYS version of make
from step 5 is a more complete
implementation of make.
The MinGW setup program currently does not install the gdb
debugger. To install the debugger,
download the file from the following
location: gdb-6.6.tar.bz2
Extract the contents of the file gdb-6.6.tar.bz2 to the same location
where you installed MinGW.
If you want to use Makefile projects, download and run the setup
program from the following location:
MSYS-1.0.10.exe. MSYS provides an
implementation of make and related
command line tools. This is not
required for other types of projects
with the MinGW toolchain, which use
CDT's internal build tools to perform
the build.
Following this process resolved any problems I had.
I had the same exact problem with Eclipse Galileo and CDT 6.0.1. It turns out that CDT only recognized MinGW when it's located under c:\mingw. I had it in c:\msys\mingw so that was the problem. After I changed that everything worked fine.
The distinction between managed make projects and makefile project was removed in CDT 4.x, I think. Now there is only one type of project, but you can select different builders. CDT includes an internal builder which does not use makefiles and another one which does.
First, save yourself the effort of "reinstalling in every order possible". That is also known as trial-and-error, and will only make you more frustrated. Apply the normal problem-solving skills you have as a programmer.
Given that you have MinGW installed, what happens if you download "Eclipse IDE for C/C++ developers", start eclipse.exe, and try to create a C++-project with a MinGW toolchain?
EDIT: remember: the key in getting help with problems like these is to produce a minimal example which fails. Also, it would help if you provided URLs to the packages you installed (MinGW, Eclipse, etc.).
EDIT: I just installed CDT using the Ganymede update site, downloaded and installed MinGW from here, and restarted Eclipse, and everything worked fine. I know that doesn't help you, but it does prove that the toolchain detection isn't completely broken. Something is weird on your side.
You could try Wascana Desktop Developer. Its a distribution of Eclipse CDT configured specifically for developing on Windows.
I had the same problem (i.e. Eclipse not finding MinGW on the PATH) after I removed some of the unused files/folders from MinGW. It was ~600 MB and I was tasked to trim it down before adding to source control. I got it down to a workable ~200 MB. When I tried to re-create an Eclipse workspace afterwards, MinGW disappeared from available toolchains. It reappeared after I put the original MinGW install on the path.
HTH