Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
How do I import libraries that I can include with #include <> in C++. Specifically, I am trying to import the SDL library, I am using Atom, and my operating system is ubuntu 16.04.
There is default path where compiler searches libraries.
What are the GCC default include directories?
If you are using gcc/g++:
gcc -xc++ -E -v -
Or you have to specify path to the library:
#include "../folder1/header1.h"
#include "../folder2/header2.h"
As already mentioned, you should have this library on your local system.
Related
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
I am trying to link libpcap to my project, but I achive an error
skipping incompatible /usr/lib/i386-linux-gnu/libpcap.so when searching for -lpcap
I'm using cross compiler arm linux gcc.
I've found some topics with related problems but i haven't found solution for me.
How to link this lib correctly?
You need to provide libpcap.so built for arm..
You can check for architecture by calling:
file libpcap.so
Output:
/usr/lib/x86_64-linux-gnu/libpcap.so.1.5.3: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=916b377cfe593106dc0b054d63bc4ed0af4ad269, stripped
You can crosscompile the pcap lib from here
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am used with using OpenCV with python. But does someone have an idea how to add openCV library to a C++ compiler (such DevCpp or CodeBlocks...).
If there is a compiler on which it's easier to install OpenCV library no problem, I have no restriction conserning the compiler.
I followed some tutos on the net but they were not so clear.
Thanks.
C++ has two important phases of compilation. First, each individual .cpp file is needed. You need the library header files (.h) for this. Secondly, the separate parts are linked together, and you need the library files themselves. (.lib/.a depending on platform).
So, you need to provide paths to both. The compiler knows which exact headers are needed from the #include statement, but the libraries to link must be explicitly listed.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
This is a newb question. I'm not sure if "external libraries" is the right terminology, but I see some programs include or use libraries or modules that are not programmer-defined. Do I need to do anything special when compiling - do I need to tell the compiler where to find these external libraries?
For example, on this page http://www.unidata.ucar.edu/software/netcdf/examples/programs/, SimpleXyWr.cpp and simple_xy_wr.f90 both reference the netCDF library/module. How does the compiler know where to find the library/module? Do I need to provide the path myself at some point in the compilation?
Typically for GNU compilers -L options tells where to find library and -l tells what library to link. For example,
f77 -o run main.f -L/usr/local/lib -llapack -lblas
will look for libraries in /usr/local/lib driectory and link with lapack and blas libraries
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
how i can compile boost under linux without write in system folders.
I need to get headers files and shared libraries of boost in one my specific folder.
You don't need to be root to compile Boost on Linux. Moreover, many Boost libraries are header only so no compilation is needed. see also Building and Installing the Library and Easy Build and Install for more details.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Why there are different includes between gcc48 and clang when you want use int32_t or memcpy?
when use gcc, after you include <iostream>, you also should include <stdint.h> and <string.h> for using int32t and memcopy
when use clang, you just need include <iostream>, and you can free use int32t and memcopy, stdint.h and string.h automatically included.
Why is that?
And can I run clang as gcc behavior ?
I use Mac OS.
Probably that's because clang's standard library happens to include <stdint.h> and <string.h> already in <iostream> for its own private reasons; this is not guaranteed, and, as you can see, your gcc's standard library doesn't work that way.
Don't rely on such behavior; always include the needed files regardless of these coincidences.