Curl and Macosx 10.12 - c++

I am trying to write code in C++ to get content from a url. I have found this url: https://curl.haxx.se/docs/install.html
I tried to:
export MACOSX_DEPLOYMENT_TARGET="10.6"
./configure --with-darwinssl
make
make install
But not sure what it is the new file created? What is the output of running these commands?
After unzipping the files from the zip downloaded I see a file curl.h, I guess I can use that one on my C++ program?
Any help will be appreciated.
UPDATE 1
I have found: "make install" just copies compiled files into appropriate locations.
Which are these locations?
UPDATE 2
Making all in lib
/Applications/Xcode.app/Contents/Developer/usr/bin/make
I understand now that "makefile" is the one setting where to copy files, etc.

You should use Homebrew. It is a package manager for OS X, and has tons of packages you can install from, including curl.

Related

Loris package installing issue

I'm trying to install Loris package link which is a library also for Python (my language). I have installed the package through bash commands in my OSX 10.12 system following these steps:
cd to the directory containing the package's source code and type
./configure to configure the package for your system. If you're
using csh on an old version of System V, you might need to type
sh ./configure instead to prevent csh from trying to execute
configure itself.
Running `configure' takes awhile. While running, it prints some
messages telling which features it is checking for.
Type `make' to compile the package.
Optionally, type `make check' to run any self-tests that come with
the package.
Type `make install' to install the programs and any data files and
documentation.
You can remove the program binaries and object files from the
source code directory by typing make clean. To also remove the
files that configure created (so you can compile the package for
a different kind of computer), type make distclean. There is
also a make maintainer-clean target, but that is intended mainly
for the package's developers. If you use it, you may have to get
all sorts of other programs in order to regenerate files that came
with the distribution.
The problem is that when I run both python 2.7 IDLE and the Atom editor it says that the module named Loris was not found. By default, make install will install the package's files in
/usr/local/bin,/usr/local/man.
Is this the problem? How can I install properly this library?

OpenCV Contrib Module Installation on Mac

I have searched here on StackOverflow and other sites to figure out how to install OpenCV 3.0 the Contrib Modules. I have downloaded the extra modules and extracted the zip file to the /opt/local/include/opencv2/opencv_contrib/ folder. I've navigated to the /opt/local/include/opencv2 folder and typed the following command in the terminal:
cmake -DOPENCV_EXTRA_MODULES_PATH=/opt/local/include/opencv2/opencv_contrib/modules/ /opt/local/include/opencv2
I get:
-bash: $: command not found
If I just type in cmake -D, I get:
CMake Error: -D must be followed with VAR=VALUE.
CMake Error: Problem processing arguments. Aborting.
So I know it recognizes the cmake command with the -D tag.
Any ideas?
Nobody said that installing OpenCV and their modules was easy.
Just like you, I already had Opencv 3.0.0 installed and running and wanted to add the contrib modules.
Steps:
1st- Delete and download again the OpenCV3.0.0 folder (is not necessary, but after twitching around, I prefer to download a new one) download the openccv_contrib and place them in the same folder.
2nd- Go to the OpenCV3.0.0 and create the build folder.
3rd- Open Cmake gui and follow the steps form https://github.com/itseez/opencv_contrib.
3.1- Fill “Where is the source code” with the rotute of where is openCV3.0.0. (my case /Users/Rafearl/Program/ComputerVision/opencv-3.0.0)
3.2- Fill “Where to build binaries” with the build route(/Users/Rafearl/Program/ComputerVision/opencv-3.0.0/build)
3.3- Press configure
3.4- In the search bar search for “OPENCV_EXTRA_MODULES_PATH” and fill with the Opencv_contrib modules(/Users/Rafearl/Program/ComputerVision/opencv_contrib-master/modules)
3.5- Click configure again and then click generate. By default current generator: Unix makefiles
4th- In terminal go to your build folder
5th- make -j4 (4 is the number of cores of the processor)
6th- sudo make install
Now you can check the lib in the build folder that the contrib libraries are added
If you don´t want to download the OpenCV3.0.0 again just follow the same steps without downloading or deleting anything.
If you already have Opencv in Xcode, everything should work but just as a piece of advise; many of the OpenCV2.4 examples does´t work in the 3.0 version.

Importing Armadillo C++ library into Xcode

I'm a mac user and am trying to install and import C++ Armadillo library. Here are the steps I've had so far:
1) I downloaded the Armadillo library from its website.
2) I went over the Readme.txt file in the download file explaining how to install it.
3) I used CMake to make the armadillo download files into binary files.
4) Then by using terminal and the code sudo make install, I installed the binary codes and they generated some "library-like" files: libarmadillo.4.0.2.dylib, libarmadillo.4.dylib, lib armadillo.dylib
5) I then copied all these files into /url/lib directory.
6) Now I have my Xcode program running and I'm trying to include the armadillo library via the include command. The problem is Xcode highlights this line and it says "armadillo file not found". Could anyone please help me solve this issue?
Thanks very much,
You need to set the following things in your build settings:
Header Search Paths: /path/to/armadillo/include (e.g. something like /url/lib/armadillo/include)
This is all you need for your source to compile. However, in order to get your program to link, you will also need the following:
Library Search Paths: /path/to/armadillo/libraries (e.g. something like /url/lib/armadillo/lib)
Other Linker Flags: -larmadillo (or: add the armadillo library to your Link build phase using the GUI)
If you're not exactly sure how to properly build and install armadillo (e.g. which prefix to use when configuring), I highly recommend using a package manager such as MacPorts to do it for you,
Install port from here
run the following command:
sudo port install armadillo
Your header path and library path will be: /opt/local/include and /opt/local/lib respectively

./Configure for non-boost ASIO

I take a look inside the asio folder there are
asio.manifest
autogen.sh
boost_asio.manifest
boostify.pl
configure.ac
include/
INSTALL
src/ (there are asio_ssl.cpp and asio.cpp)
I didn't see any configure script where I can execute. How do I build this asio?
I read asio is a header only library.
So, what I can make out of those files in the asio folder?
If you got it from a tarball, you should already have a configure script ready to be executed. If you checked from the repository, you probably need to run ./autogen.sh to generate the configure script for you, using configure.ac as input.
The convention is:
./bootstrap: it invokes autoconf to process configure.ac and spit out configure. Often it also invokes automake to process all Makefile.am files and turn them into Makefile.in. Many moons ago, the name autogen.sh was used instead of bootstrap. And configure.in was used instead of configure.ac.
./configure: detects everything on the system and creates config.status, then executes it.
./config.status: processes all *.in files into versions without the .in suffix. That includes Makefile.in -> Makefile. You don't have to run this script by hand.
INSTALL: this SHOULD contain build instructions, such as "run ./autogen.sh if you checked out a copy from the repository". Shame on the ASIO developers, they just point the user to look for a non-existing "doc" directory.
You need autoconf (and friends) installed to transform configure.ac into configure. Once that is done, the build system becomes self-contained. That is, you can do a make dist-gzip to pack all the sources (and the configure script), transfer the tar.gz it to another system, and follow from the ./configure step, even if autoconf is not installed there.
So, Here are the steps I've followed just now.
I went to http://think-async.com, which is the website that hosts the non-boost asio.
Their download link led me to sourceforge, and version 1.4.8 of the software.
I then extracted the folder, and looking inside, I see the usual layout.
So the following steps include ./configure, make, and probably sudo make install.

Building c++ project in Ubuntu Linux with Makefile.am/Makefile.in

I am new in Ubuntu/Linux and I've been working with java using the NetBeans IDE, so I don't have much experience with building c++ projects. But now I have to provide a proof of concept and I need to connect a C++ client with my ActiveMQ server. I downloaded The ActiveMQ-CPP API from this link, but I can't build/run it.
The download came with the files: Maklefile.am and Makefile.in. I searched it and I found that I need automake/autoconf to build it. I tried running ./configure but it says that it couldn't find such file or directory. I tried
sudo apt-get update
sudo apt-get install automake
sudo apt-get install autoconf
and a lot of other commands that I found on the Internet. None of then worked. I know that this question is really basic and it seems to be already answered somewhere else, but every attempt I've made failed. I think I'm missing something. I even tried the solution provided in the last message in this topic but it didn't work either.
Can anyone help me install autoconf/automake, or tell me how to use Makefile.am / Makefile.in to build the project I downloaded, or even suggest me some other way of building it?
Since you're open to other methods of building your project, I'm going to suggest CMake. It is a far better build system than autotools (at least from where I stand).
#CMakeLists.txt
project(MyProject CXX)
set_minimum_required(VERSION 2.8)
add_executable(foobar foo.cpp bar.cpp)
That example will build an executable called "foobar" by compiling and linking foo.cpp and bar.cpp. Put the above code in a file called CMakeLists.txt, then run the following commands:
cmake <path to project> #run in the folder you want to build in
make #this does the actual work
The really cool thing about CMake is that it generates a build system (Makefiles by default) but you can use it to generate project files for Eclipse, a Visual Studio solution, and a bunch of other things. If you want more information, I'd check out their documentation.
The "configure" script should be in your ActiveMQ-cpp source directory. From the Linux command line, you should be able to:
1) "cd" into your ActiveMQ* directory
2) "ls -l" to see the "configure" script
3) "./configure" to set things up for building the library\
4) "make" to actually build the library
This is mentioned in comments, but this particular point of confusion has been common for well over a decade and I think needs to be clarified as often as possible. You DO NOT need to have autoconf or automake installed to build a project that used those tools. The entire point of the autotools is to generate a build system that will build on a system using only the standard tools (make, a c compiler, sh, and few others.) Unfortunately, many developers release tarballs that do not build cleanly. If you unpack the tarball and it does not contain a configure script, or if the configure script is broken, that is a bug in the package. The solution is absolutely not to install autoconf/automake/libtool and try to produce a working configure script. The solution is to report the build error as a bug to the package maintainer.
The world would be a better place if Linux distributions stopped installing multiple versions of the autotools by default as less than .002% of the population needs those tools, and anyone who actually needs to have the tools should be capable of installing it themselves. Anyone incapable of acquiring and installing the tools has no business using them.