header not found even though `PKG_CONFIG_PATH` is set correctly
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I've installed a library to ~/.local
. The environment variables are set as shown below:
$ echo $LD_LIBRARY_PATH
/home/saga//.local/lib
$ echo $PKG_CONFIG_PATH
/home/saga//.local/lib/pkgconfig
There's an re2.pc file in /home/saga//.local/lib/pkgconfig
whose contents are:
prefix=/home/saga//.local
exec_prefix=/home/saga//.local
includedir=/home/saga//.local/include
libdir=/home/saga//.local/lib
Name: re2
Description: RE2 is a fast, safe, thread-friendly regular expression engine.
Version: 0.0.0
Cflags: -std=c++11 -pthread -I$includedir
Libs: -pthread -L$libdir -lre2
There's an re2
directory in /home/saga//.local/include
which contains re2.h
. But when I try to compile a program which includes re2.h, I get the following error:
$ g++ tst.cpp
tst.cpp:1:9: fatal error: re2/re2.h: No such file or directory
#include<re2/re2.h>
^~~~~~~~~~~
compilation terminated.
and
$ g++ tst2.cpp
tst.cpp:1:9: fatal error: re2.h: No such file or directory
#include<re2.h>
^~~~~~~
compilation terminated.
The output of pkg-config --libs re2
is -L/home/saga//.local/lib -pthread -lre2
How can I fix this?
compiling pkg-config cpp
add a comment |Â
up vote
0
down vote
favorite
I've installed a library to ~/.local
. The environment variables are set as shown below:
$ echo $LD_LIBRARY_PATH
/home/saga//.local/lib
$ echo $PKG_CONFIG_PATH
/home/saga//.local/lib/pkgconfig
There's an re2.pc file in /home/saga//.local/lib/pkgconfig
whose contents are:
prefix=/home/saga//.local
exec_prefix=/home/saga//.local
includedir=/home/saga//.local/include
libdir=/home/saga//.local/lib
Name: re2
Description: RE2 is a fast, safe, thread-friendly regular expression engine.
Version: 0.0.0
Cflags: -std=c++11 -pthread -I$includedir
Libs: -pthread -L$libdir -lre2
There's an re2
directory in /home/saga//.local/include
which contains re2.h
. But when I try to compile a program which includes re2.h, I get the following error:
$ g++ tst.cpp
tst.cpp:1:9: fatal error: re2/re2.h: No such file or directory
#include<re2/re2.h>
^~~~~~~~~~~
compilation terminated.
and
$ g++ tst2.cpp
tst.cpp:1:9: fatal error: re2.h: No such file or directory
#include<re2.h>
^~~~~~~
compilation terminated.
The output of pkg-config --libs re2
is -L/home/saga//.local/lib -pthread -lre2
How can I fix this?
compiling pkg-config cpp
Did you try querying pkgconfig so you can find out where the header is located?
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:34
@Ignacio Vazquez-Abramshow do I do that?
â saga
Nov 10 '17 at 17:35
@IgnacioVazquez-Abrams The output ofpkg-config --libs re2
is-L/home/saga//.local/lib -pthread -lre2
â saga
Nov 10 '17 at 17:44
Okay. Did you try telling that tog++
?
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:44
Tried the solution offered below, getting the same error.
â saga
Nov 10 '17 at 17:50
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I've installed a library to ~/.local
. The environment variables are set as shown below:
$ echo $LD_LIBRARY_PATH
/home/saga//.local/lib
$ echo $PKG_CONFIG_PATH
/home/saga//.local/lib/pkgconfig
There's an re2.pc file in /home/saga//.local/lib/pkgconfig
whose contents are:
prefix=/home/saga//.local
exec_prefix=/home/saga//.local
includedir=/home/saga//.local/include
libdir=/home/saga//.local/lib
Name: re2
Description: RE2 is a fast, safe, thread-friendly regular expression engine.
Version: 0.0.0
Cflags: -std=c++11 -pthread -I$includedir
Libs: -pthread -L$libdir -lre2
There's an re2
directory in /home/saga//.local/include
which contains re2.h
. But when I try to compile a program which includes re2.h, I get the following error:
$ g++ tst.cpp
tst.cpp:1:9: fatal error: re2/re2.h: No such file or directory
#include<re2/re2.h>
^~~~~~~~~~~
compilation terminated.
and
$ g++ tst2.cpp
tst.cpp:1:9: fatal error: re2.h: No such file or directory
#include<re2.h>
^~~~~~~
compilation terminated.
The output of pkg-config --libs re2
is -L/home/saga//.local/lib -pthread -lre2
How can I fix this?
compiling pkg-config cpp
I've installed a library to ~/.local
. The environment variables are set as shown below:
$ echo $LD_LIBRARY_PATH
/home/saga//.local/lib
$ echo $PKG_CONFIG_PATH
/home/saga//.local/lib/pkgconfig
There's an re2.pc file in /home/saga//.local/lib/pkgconfig
whose contents are:
prefix=/home/saga//.local
exec_prefix=/home/saga//.local
includedir=/home/saga//.local/include
libdir=/home/saga//.local/lib
Name: re2
Description: RE2 is a fast, safe, thread-friendly regular expression engine.
Version: 0.0.0
Cflags: -std=c++11 -pthread -I$includedir
Libs: -pthread -L$libdir -lre2
There's an re2
directory in /home/saga//.local/include
which contains re2.h
. But when I try to compile a program which includes re2.h, I get the following error:
$ g++ tst.cpp
tst.cpp:1:9: fatal error: re2/re2.h: No such file or directory
#include<re2/re2.h>
^~~~~~~~~~~
compilation terminated.
and
$ g++ tst2.cpp
tst.cpp:1:9: fatal error: re2.h: No such file or directory
#include<re2.h>
^~~~~~~
compilation terminated.
The output of pkg-config --libs re2
is -L/home/saga//.local/lib -pthread -lre2
How can I fix this?
compiling pkg-config cpp
edited Nov 10 '17 at 17:45
asked Nov 10 '17 at 17:31
saga
874219
874219
Did you try querying pkgconfig so you can find out where the header is located?
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:34
@Ignacio Vazquez-Abramshow do I do that?
â saga
Nov 10 '17 at 17:35
@IgnacioVazquez-Abrams The output ofpkg-config --libs re2
is-L/home/saga//.local/lib -pthread -lre2
â saga
Nov 10 '17 at 17:44
Okay. Did you try telling that tog++
?
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:44
Tried the solution offered below, getting the same error.
â saga
Nov 10 '17 at 17:50
add a comment |Â
Did you try querying pkgconfig so you can find out where the header is located?
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:34
@Ignacio Vazquez-Abramshow do I do that?
â saga
Nov 10 '17 at 17:35
@IgnacioVazquez-Abrams The output ofpkg-config --libs re2
is-L/home/saga//.local/lib -pthread -lre2
â saga
Nov 10 '17 at 17:44
Okay. Did you try telling that tog++
?
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:44
Tried the solution offered below, getting the same error.
â saga
Nov 10 '17 at 17:50
Did you try querying pkgconfig so you can find out where the header is located?
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:34
Did you try querying pkgconfig so you can find out where the header is located?
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:34
@Ignacio Vazquez-Abramshow do I do that?
â saga
Nov 10 '17 at 17:35
@Ignacio Vazquez-Abramshow do I do that?
â saga
Nov 10 '17 at 17:35
@IgnacioVazquez-Abrams The output of
pkg-config --libs re2
is -L/home/saga//.local/lib -pthread -lre2
â saga
Nov 10 '17 at 17:44
@IgnacioVazquez-Abrams The output of
pkg-config --libs re2
is -L/home/saga//.local/lib -pthread -lre2
â saga
Nov 10 '17 at 17:44
Okay. Did you try telling that to
g++
?â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:44
Okay. Did you try telling that to
g++
?â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:44
Tried the solution offered below, getting the same error.
â saga
Nov 10 '17 at 17:50
Tried the solution offered below, getting the same error.
â saga
Nov 10 '17 at 17:50
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
0
down vote
You're not actually using pkg-config
...
$ g++ $(pkg-config --cflags re2) tst.cpp
Just tried it, I'm getting the same error.
â saga
Nov 10 '17 at 17:42
"There's anre2
directory in/home/saga//.local/include
which containsre2.h
."
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:42
@saga I first misread the question. Sorted now.
â Kusalananda
Nov 10 '17 at 17:47
Still getting the same error. The output ofpkg-config --cflags re2
is-std=c++11 -pthreads
â saga
Nov 10 '17 at 17:48
Shouldn't there be an-I/
there as well.
â saga
Nov 10 '17 at 17:49
 |Â
show 3 more comments
up vote
0
down vote
You can try running pkg-config in debug mode with:
$ pkg-config --cflags-only-I re2 --debug
It should print something like this:
< cut >
Looking for package 're2'
Looking for package 're2-uninstalled'
Reading 're2' from file '/home/saga/.local/lib/pkgconfig/re2.pc'
Parsing package file '/home/saga/.local/lib/pkgconfig/re2.pc'
line>prefix=/home/saga//.local
Variable declaration, 'prefix' has value '/home/saga//local'
line>exec_prefix=/home/saga//.local
Variable declaration, 'exec_prefix' has value '/home/saga//local'
line>includedir=/home/saga//.local/include
Variable declaration, 'includedir' has value '/home/saga//.local/include'
line>libdir=/home/saga//.local/lib
Variable declaration, 'libdir' has value '/home/saga//.local/lib'
line>
line>Name: re2
line>Description: RE2 is a fast, safe, thread-friendly regular expression engine.
line>Version: 0.0.0
line>Cflags: -std=c++11 -pthread -I$includedir
line>Libs: -pthread -L$libdir -lre2
Path position of 're2' is 1
Adding 're2' to list of known packages
pre-remove: re2
post-remove: re2
original: re2
sorted: re2
adding CFLAGS_I string "-I/home/saga//.local/include "
returning flags string "-I/home/saga//.local/include "
-I/home/saga//.local/include
You can see that the last line is what you're currently missing.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
You're not actually using pkg-config
...
$ g++ $(pkg-config --cflags re2) tst.cpp
Just tried it, I'm getting the same error.
â saga
Nov 10 '17 at 17:42
"There's anre2
directory in/home/saga//.local/include
which containsre2.h
."
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:42
@saga I first misread the question. Sorted now.
â Kusalananda
Nov 10 '17 at 17:47
Still getting the same error. The output ofpkg-config --cflags re2
is-std=c++11 -pthreads
â saga
Nov 10 '17 at 17:48
Shouldn't there be an-I/
there as well.
â saga
Nov 10 '17 at 17:49
 |Â
show 3 more comments
up vote
0
down vote
You're not actually using pkg-config
...
$ g++ $(pkg-config --cflags re2) tst.cpp
Just tried it, I'm getting the same error.
â saga
Nov 10 '17 at 17:42
"There's anre2
directory in/home/saga//.local/include
which containsre2.h
."
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:42
@saga I first misread the question. Sorted now.
â Kusalananda
Nov 10 '17 at 17:47
Still getting the same error. The output ofpkg-config --cflags re2
is-std=c++11 -pthreads
â saga
Nov 10 '17 at 17:48
Shouldn't there be an-I/
there as well.
â saga
Nov 10 '17 at 17:49
 |Â
show 3 more comments
up vote
0
down vote
up vote
0
down vote
You're not actually using pkg-config
...
$ g++ $(pkg-config --cflags re2) tst.cpp
You're not actually using pkg-config
...
$ g++ $(pkg-config --cflags re2) tst.cpp
edited Nov 10 '17 at 17:43
answered Nov 10 '17 at 17:39
Kusalananda
105k14207325
105k14207325
Just tried it, I'm getting the same error.
â saga
Nov 10 '17 at 17:42
"There's anre2
directory in/home/saga//.local/include
which containsre2.h
."
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:42
@saga I first misread the question. Sorted now.
â Kusalananda
Nov 10 '17 at 17:47
Still getting the same error. The output ofpkg-config --cflags re2
is-std=c++11 -pthreads
â saga
Nov 10 '17 at 17:48
Shouldn't there be an-I/
there as well.
â saga
Nov 10 '17 at 17:49
 |Â
show 3 more comments
Just tried it, I'm getting the same error.
â saga
Nov 10 '17 at 17:42
"There's anre2
directory in/home/saga//.local/include
which containsre2.h
."
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:42
@saga I first misread the question. Sorted now.
â Kusalananda
Nov 10 '17 at 17:47
Still getting the same error. The output ofpkg-config --cflags re2
is-std=c++11 -pthreads
â saga
Nov 10 '17 at 17:48
Shouldn't there be an-I/
there as well.
â saga
Nov 10 '17 at 17:49
Just tried it, I'm getting the same error.
â saga
Nov 10 '17 at 17:42
Just tried it, I'm getting the same error.
â saga
Nov 10 '17 at 17:42
"There's an
re2
directory in /home/saga//.local/include
which contains re2.h
."â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:42
"There's an
re2
directory in /home/saga//.local/include
which contains re2.h
."â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:42
@saga I first misread the question. Sorted now.
â Kusalananda
Nov 10 '17 at 17:47
@saga I first misread the question. Sorted now.
â Kusalananda
Nov 10 '17 at 17:47
Still getting the same error. The output of
pkg-config --cflags re2
is -std=c++11 -pthreads
â saga
Nov 10 '17 at 17:48
Still getting the same error. The output of
pkg-config --cflags re2
is -std=c++11 -pthreads
â saga
Nov 10 '17 at 17:48
Shouldn't there be an
-I/
there as well.â saga
Nov 10 '17 at 17:49
Shouldn't there be an
-I/
there as well.â saga
Nov 10 '17 at 17:49
 |Â
show 3 more comments
up vote
0
down vote
You can try running pkg-config in debug mode with:
$ pkg-config --cflags-only-I re2 --debug
It should print something like this:
< cut >
Looking for package 're2'
Looking for package 're2-uninstalled'
Reading 're2' from file '/home/saga/.local/lib/pkgconfig/re2.pc'
Parsing package file '/home/saga/.local/lib/pkgconfig/re2.pc'
line>prefix=/home/saga//.local
Variable declaration, 'prefix' has value '/home/saga//local'
line>exec_prefix=/home/saga//.local
Variable declaration, 'exec_prefix' has value '/home/saga//local'
line>includedir=/home/saga//.local/include
Variable declaration, 'includedir' has value '/home/saga//.local/include'
line>libdir=/home/saga//.local/lib
Variable declaration, 'libdir' has value '/home/saga//.local/lib'
line>
line>Name: re2
line>Description: RE2 is a fast, safe, thread-friendly regular expression engine.
line>Version: 0.0.0
line>Cflags: -std=c++11 -pthread -I$includedir
line>Libs: -pthread -L$libdir -lre2
Path position of 're2' is 1
Adding 're2' to list of known packages
pre-remove: re2
post-remove: re2
original: re2
sorted: re2
adding CFLAGS_I string "-I/home/saga//.local/include "
returning flags string "-I/home/saga//.local/include "
-I/home/saga//.local/include
You can see that the last line is what you're currently missing.
add a comment |Â
up vote
0
down vote
You can try running pkg-config in debug mode with:
$ pkg-config --cflags-only-I re2 --debug
It should print something like this:
< cut >
Looking for package 're2'
Looking for package 're2-uninstalled'
Reading 're2' from file '/home/saga/.local/lib/pkgconfig/re2.pc'
Parsing package file '/home/saga/.local/lib/pkgconfig/re2.pc'
line>prefix=/home/saga//.local
Variable declaration, 'prefix' has value '/home/saga//local'
line>exec_prefix=/home/saga//.local
Variable declaration, 'exec_prefix' has value '/home/saga//local'
line>includedir=/home/saga//.local/include
Variable declaration, 'includedir' has value '/home/saga//.local/include'
line>libdir=/home/saga//.local/lib
Variable declaration, 'libdir' has value '/home/saga//.local/lib'
line>
line>Name: re2
line>Description: RE2 is a fast, safe, thread-friendly regular expression engine.
line>Version: 0.0.0
line>Cflags: -std=c++11 -pthread -I$includedir
line>Libs: -pthread -L$libdir -lre2
Path position of 're2' is 1
Adding 're2' to list of known packages
pre-remove: re2
post-remove: re2
original: re2
sorted: re2
adding CFLAGS_I string "-I/home/saga//.local/include "
returning flags string "-I/home/saga//.local/include "
-I/home/saga//.local/include
You can see that the last line is what you're currently missing.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
You can try running pkg-config in debug mode with:
$ pkg-config --cflags-only-I re2 --debug
It should print something like this:
< cut >
Looking for package 're2'
Looking for package 're2-uninstalled'
Reading 're2' from file '/home/saga/.local/lib/pkgconfig/re2.pc'
Parsing package file '/home/saga/.local/lib/pkgconfig/re2.pc'
line>prefix=/home/saga//.local
Variable declaration, 'prefix' has value '/home/saga//local'
line>exec_prefix=/home/saga//.local
Variable declaration, 'exec_prefix' has value '/home/saga//local'
line>includedir=/home/saga//.local/include
Variable declaration, 'includedir' has value '/home/saga//.local/include'
line>libdir=/home/saga//.local/lib
Variable declaration, 'libdir' has value '/home/saga//.local/lib'
line>
line>Name: re2
line>Description: RE2 is a fast, safe, thread-friendly regular expression engine.
line>Version: 0.0.0
line>Cflags: -std=c++11 -pthread -I$includedir
line>Libs: -pthread -L$libdir -lre2
Path position of 're2' is 1
Adding 're2' to list of known packages
pre-remove: re2
post-remove: re2
original: re2
sorted: re2
adding CFLAGS_I string "-I/home/saga//.local/include "
returning flags string "-I/home/saga//.local/include "
-I/home/saga//.local/include
You can see that the last line is what you're currently missing.
You can try running pkg-config in debug mode with:
$ pkg-config --cflags-only-I re2 --debug
It should print something like this:
< cut >
Looking for package 're2'
Looking for package 're2-uninstalled'
Reading 're2' from file '/home/saga/.local/lib/pkgconfig/re2.pc'
Parsing package file '/home/saga/.local/lib/pkgconfig/re2.pc'
line>prefix=/home/saga//.local
Variable declaration, 'prefix' has value '/home/saga//local'
line>exec_prefix=/home/saga//.local
Variable declaration, 'exec_prefix' has value '/home/saga//local'
line>includedir=/home/saga//.local/include
Variable declaration, 'includedir' has value '/home/saga//.local/include'
line>libdir=/home/saga//.local/lib
Variable declaration, 'libdir' has value '/home/saga//.local/lib'
line>
line>Name: re2
line>Description: RE2 is a fast, safe, thread-friendly regular expression engine.
line>Version: 0.0.0
line>Cflags: -std=c++11 -pthread -I$includedir
line>Libs: -pthread -L$libdir -lre2
Path position of 're2' is 1
Adding 're2' to list of known packages
pre-remove: re2
post-remove: re2
original: re2
sorted: re2
adding CFLAGS_I string "-I/home/saga//.local/include "
returning flags string "-I/home/saga//.local/include "
-I/home/saga//.local/include
You can see that the last line is what you're currently missing.
answered Nov 11 '17 at 9:02
virtualdj
113
113
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403792%2fheader-not-found-even-though-pkg-config-path-is-set-correctly%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Did you try querying pkgconfig so you can find out where the header is located?
â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:34
@Ignacio Vazquez-Abramshow do I do that?
â saga
Nov 10 '17 at 17:35
@IgnacioVazquez-Abrams The output of
pkg-config --libs re2
is-L/home/saga//.local/lib -pthread -lre2
â saga
Nov 10 '17 at 17:44
Okay. Did you try telling that to
g++
?â Ignacio Vazquez-Abrams
Nov 10 '17 at 17:44
Tried the solution offered below, getting the same error.
â saga
Nov 10 '17 at 17:50