g++ from msys2 is generating .o file only - g++

g++ -c -I"C:/Users\hp/Documents/Projects/arb" test_arb.cpp
it is generating test_arb.o file but no .exe
./a.out is not working either.
How do I run it then?
PS: I am on windows 10. I have msys2 installed followed by g++ installed via pacman on msys2.

Related

Apache Httpd Build from source: fatal error: expat.h: No such file or directory

I am trying to build Apache Server v 2.4.38 on RHEL 7.3 and I am using apr 1.6.5, apr-util 1.6.1, and pcre 8.42.
I am running following commands
./configure --with-included-apr --with-pcre=/data/abc/installed/pcre_installed --prefix=/data/abc/installed/httpd_installed
make
While running 'make' I am receiving error
/bin/sh /data/abc/installed/httpd-2.4.38/srclib/apr/libtool --silent --mode=compile gcc -g -O2 -pthread -DHAVE_CONFIG_H -DLINUX -D_REENTRANT -D_GNU_SOURCE -I/data/abc/installed/httpd-2.4.38/srclib/apr-util/include -I/data/abc/installed/httpd-2.4.38/srclib/apr-util/include/private -I/data/abc/installed/httpd-2.4.38/srclib/apr/include -o xml/apr_xml.lo -c xml/apr_xml.c && touch xml/apr_xml.lo
xml/apr_xml.c:35:19: fatal error: expat.h: No such file or directory
#include <expat.h>
Download expat-2.2.6.tar.bz2 from https://libexpat.github.io/.
Extract expat using following command
tar xvjf expat-2.2.6.tar.bz2 -C /path-to-dir
Change to the extracted expat directory.
Build expat using following commands
./configure --prefix=/path-to-expat-installation-dir
make
make install
While building Apache Httpd from source specify --with-expat
./configure --with-included-apr --prefix=/path-to-apache-installation --with-expat=/path-to-expat-installation-dir
For anyone else coming across this:
OP had to do this because they didn't have sudo access. If you do, usually you don't need to download the source of expat manually; installing via package manager is way easier. Unless the software you are compiling requires a newer version of expat than your RPM repos provide.
So for the RHEL family of OSes you can just do sudo <dnf|yum> install expat expat-devel, then proceed with what you were compiling.
Do you have the expat library installed? (Because that's where the expat.h comes from.)
https://libexpat.github.io/
If you cannot install it globally to the system, I'm sure Apache's ./configure script must have an option to support a custom location for the library as well.
Tried In Ubuntu
apt install libexpat1-dev
For RHEL, I would suggest #cyqsimon's answer

Getting error java.lang.UnsatisfiedLinkError: no jzmq in java.library.path in IntelliJ ide with windows 10

I have a java project which have zeromq implementation. i have installed zeromq windows version in my windows 10 OS.
When running the application i am getting above error.
I have downloaded zeromq (windows) installer from http://zeromq.org/area:download and installed it in C:\ZeroMQ4.0.4 folder.
Any idea what further action i have to take?
As i am not able to successfully work it in windows i have installed it in a ubuntu 16 vm under my windows 10 machine
Steps i have done are
Installed java in ubuntu
apt-get install -y libtool pkg-config build-essential autoconf automake uuid-dev libzmq3-dev checkinstall
Download Required Package
wget https://github.com/zeromq/zeromq4-x/releases/download/v4.0.8/zeromq-4.0.8.tar.gz
wget https://github.com/zeromq/jzmq/archive/v2.2.2.zip
tar -xzf zeromq-4.0.8.tar.gz
unzip v2.2.2.zip
Install ZMQ
cd zeromq-4.0.8
./configure
make
checkinstall it will creat deb package to be removed easily if required
ldconfig
install jzmaq
cd jzmq-2.2.2/
./autogen.sh
./configure
make
make install
*** In case error show up --- autogen.sh: error: could not find libtool. libtool is required to run autogen.sh. run the mentioned command.
ln -s /usr/bin/libtoolize /usr/bin/libtool
Set java_home path in ubuntu
Still i am getting same error when debugging it from my windows 10 machine with Intellij IDE

how to compile this cpp file that uses gmp with g++ cygwin

I followed all the instructions for setting up gmp with cygwin,
./configure make make install and make check.
The libgmp.a is in the path C:/C++/gmp-6.1.2/.libs
I'm using this command to compile with g++
g++ -L/C:/C++/gmp-6.1.2/.libs -I/C:/C++/gmp-6.1.2 C:/foo/foo.cpp -lgmp
I get an error message that says : could not find -lgmp
What am i missing?
Why not install the gmp from the cygwin distribution?

No g++ is found after installing a g++ package in Cygwin

I have installed mingw64-x86_64-gcc-g++ package in Cygwin. However, which g++ does not show any installed g++. Where is the installed compiler?
/bin/g++ is part of the gcc-g++ package.
/bin/x86_64-w64-mingw32-g++ is part of the mingw64-x86_64-gcc-g++ package.
Example

install mlpy 3.5.0 on mac 10.9 error.Please help me

The following is the error which I am getting. Please help me to fix it.
apple:mlpy-3.5.0 apple$ python setup.py install
running install
running build
running build_py
running build_ext
building 'mlpy.gsl' extension
cc -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -Qunused-arguments -Qunused-arguments -arch x86_64 -arch i386 -pipe -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -I/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c mlpy/gsl/gsl.c -o build/temp.macosx-10.9-intel-2.7/mlpy/gsl/gsl.o
mlpy/gsl/gsl.c:223:10: fatal error: 'gsl/gsl_sf.h' file not found
#include "gsl/gsl_sf.h"
^
1 error generated.
MLPy depends on GNU Scientific Library (GSL), which you need to install first.
You can install it either with brew install gsl or manually from source.
For manual installation, instructions can be found here. The relevant steps are as follows:
go to: http://www.gnu.org/prep/ftp.html
click on an ftp link close to your location
find the gsl/ directory and click on it
find the gsl-VERSION.tar.gz file, where version is 1.14 or greater. Click on that file to download it.
In a terminal window extract the tar.gz file using tar -xzf gsl-VERSION.tar.gz and then cd to the ./gsl-VERSION directory
Look at the INSTALL file. It will probably tell you to run ./configure, then make, and then make install (and you might have to
login as the superuser (sudo)
I am actually getting the same issue today while installing mlpy. Based on the mlpy documentation. Here is the method to solve this issue.
According to the installation section in the mlpy documentation:
If the GSL header files or shared library are in non-standard locations on your system, use the --include-dirs
and --rpath options to build_ext:
$ python setup.py build_ext --include-dirs=/path/to/header --rpath=/path/to/lib
$ python setup.py install
We have to assign the header and lib. Based on How to obtain and install GSL,
Under Search Paths/Header Search Paths type /opt/local/include
Under Search Paths/Library Search Paths type /opt/local/lib
The quick answer is running the below command:
sudo python setup.py build_ext --include-dirs=/opt/local/include --rpath=/opt/local/lib
sudo python setup.py install
Hope this will be helpful.