Link C++ Library in Xcode [Mac] - c++

First of all, I am completely new to C++. What I have:
Mac
Installed Xcode
Thats it. No prior knowledge about anything Xcode/C++ related.
I need to use a few functions from GSL library, to run a code for my project. What I did:
From GSL library site I downloaded a file called "gsl-latest.tar.gz".
Moved it to my C++ folder on desktop and unpacked it.(attached screenshoot of unpacked folder and what it includes)
Created an Xcode project by: Xcode -> create a new project -> command line.
Opened a file for this project which contains functions from mentioned library.
I know that in order to use functions I have to include them, i.e:
#include <gsl/gsl_randist.h>
#include <gsl/gsl_rng.h>
#include <gsl/gsl_sf_gamma.h>
But before "including" functions, I need to link gsl library to my project. How to do it?
Help.

Related

Autocompletion not working for external C++ library in VSode

I'm using VScode on a Linux workstation and I have some problems with Intellisense. In particular, I have a C++ library installed in my home directory. Then, on my desktop folder, I have a C++ project that is including headers from that library.
I created a folder .vscode with the file c_cpp_properties.json (adapted from here). Now, if I right-click an a type coming from that library, VScode successfully goes to definitions and declarations into the headers of the library. The only thing that is not working is the autocompletion. I tried with ctrl-space, and every time I get No suggestions.

Including TensorFlow into JUCE project

I am trying to include the TensorFlow C Library in my JUCE project. Until now, with no luck.
When following the TensorFlow guide on how to install the library for C I get lost after the extraction part (developing with Windows). I Add the files inside the include folder to my project using the Projucer. The library with the dll and lib file is added as well. When running Visual Studio, however, there are some includes not inside the provided include folder. My guess is, that I need to link the included library with the full TensorFlow blackened.
Did anyone manage to include TensorFlow inside a JUCE project?
Tutorials I've looked at already:
https://www.tensorflow.org/install/lang_c
https://forum.juce.com/t/has-anyone-managed-to-integrate-tensorflow-api-in-a-juce-project/28019
How to use the tensorflow 2.0 C API?

How do I use the Crypto++ library within Eclipse? (C++)

I'm having trouble getting Crypto++ to work from within the C++ Eclipse IDE. I think I installed it correctly, but every time I try to do any sort of include in the file so I can use the new library, it does not compile. It will compile C++ normally, but it won't let me use the new library. (Bear in mind, I am not too familiar with this whole process with libraries as a whole.)
My process:
Downloaded 7.0 from here: https://www.cryptopp.com/#download
Unzipped it into a folder on my Desktop called Crypto++
Created a new project, it compiled.
Right click on new project, properties -> C/C++ Build -> settings ->
Tool settings
Clicked add, file system, and then clicked the folder I created, and
hit apply.
So, it is listed under library search path, but this include does not work:
#include "cryptlib.h"
Did I install the library properly, or am I missing something?
Edit:
fatal error: cryptlib.h: No such file or directory

Linking libjpeg to an xCode project for iOS dev

Good evening,
I have been working on a C++ project from someone of my University which I had to improve for my Bachelor thesis. It basically uses the library libjpeg to do some computation resulting in a steganographic process in order to embed a message into a given image.
Now that the C++ code works smoothly, I'd like to create a little iOS app allowing the user to encrypt whatever message he'd like into an image of his choice. So I created an xCode project following this procedure: using c++ in an iOS app
I also found the following file: libjpeg for iOS which allowed me to compile libjpeg for iOS. Since I'm not so sure how to use the framework freshly created and couldn't find anything sufficiently convincing on the internet, I put all the files (.c and .h) of the libjpeg library into my "include" folder where I have my own .hpp.
xCode only throws me the following error:
xCode error
From what I could gather on several posts, I have to modify the build options of my xCode project to link manually the library, so I tried the following:
Other linking flags
Library search path
This wasn't enough to do the trick and I'm still struggling with the same error xCode throws at me. Any help would be very appreciated on how to proceed!
Thanks a lot,
Theo.
Do not add the .c files to your project, add the libjpeg.a file produced by your build to your project. Add the .h files as you are already doing, or edit the project settings to include their containing folder in the search path.
HTH

Linking Codeblock glut project with assimp library

Hello I am new with assimp and have a problem.
When I try to include the:
#include <assimp/cimport.h>
#include <assimp/scene.h>
#include <assimp/postprocess.h>
in a c++ glut project it says No such file or directory, so I obviously need to link some libraries to the project. The question is where can I find that library.
I downloaded assimp view 3.0 and opened the object i need to inport in c++ with it and so far it look ok.
http://assimp.sourceforge.net/lib_html/usage.html .. Is the link to how to use assimp with c++ but no info how to link it
You should have read up on the very site you linked.
http://assimp.sourceforge.net/lib_html/install.html
These are installation directions. The very top looks like it talks about using prebuilt libraries and telling you what to link into your visual studio project.
One last note: you are using the c interface according to your question. After reading the documentation I see that they have a C++ specific importer header you may want to use instead.
#include <assimp/Importer.hpp>
EDIT: This answer assumes you are using visual studio of course. However, that link also provides building from scratch instructions as well as other ways of building and installing the library. So if you are a linux/unix user I imagine you can make do with these instructions.