From: <nunojsilva@ist.utl.pt> (Nuno Silva)
To: gentoo-user@lists.gentoo.org
Subject: [gentoo-user] Re: error: Cg/cg.h: No such file or directory
Date: Mon, 04 Feb 2013 18:41:43 +0200 [thread overview]
Message-ID: <87sj5cdoag.fsf@ist.utl.pt> (raw)
In-Reply-To: CAP4tJZJdKXpJoqNRDq1+EmO_ACHcJo=tC5Swimq68P-y1EJDQw@mail.gmail.com
On 2013-02-03, João Matos wrote:
> Dear list,
>
> I'm trying to build dolphin-emu from gamerlay, and I got the following
> error:
>
>
> error: Cg/cg.h: No such file or directory
>
> But the file actually exists:
>
> /opt/nvidia-cg-toolkit/include/Cg/cg.h
>
> Should it be a problem that I can solve myself?
>
> I thought so, than I've made a symlink for
> /opt/nvidia-cg-toolkit/include/Cg at /usr/include. The compilation took a
> little longer, but later, I've got the following:
It took a little longer because it compiled, in fact the error occured
so early that it failed without doing that much, I guess.
>
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld:
> cannot find -lCg
> /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.3/../../../../x86_64-pc-linux-gnu/bin/ld:
> cannot find -lCgGL
It is some library detail: when configuring the makefiles to build some
piece of source, the configure script needs to find the libraries and
set *two* things from these libraries:
- The include directories, to which it should append the
/opt/nvidia-cg-toolkit/include path
- The library directories, to which it should append a directory where
nvidia-cg-toolkit has its libs
This, at least for some packages, is done with pkg-config, see, for
example, if you have gtk+-2.x on your system:
pkg-config --cflags gtk+-2.0
This generates the right flags to pass to gcc when you want to compile a
gtk+-2.x application. Likewise, --libs gives you the linker flags.
Now what happened: you *did* provide it the header file, which is enough
to compile the code part that depends on the nvidia library
(compilation, which is modular, you can just go for parts of the code
and information on other parts are on the header files), but you still
need the library itself when you are assembling the final binary, so
that the binary can be extended with information on where to get the
library (or with the library itself, in the case of static linking).
Although here --libs only gives me -l* for gtk, there is also a
companion -L flag that, like -I for includes, sets the directories where
the libraries can be found. I assue that, if -L is not given, that just
means gtk+ is in the default locations.
If you can figure out how to tell the configure script where to look for
the libs, that would be the easiest thing to do; next to that, you can
manually link the files using the right -L parameter or perhaps
appending it to LD_LIBRARY_PATH when compiling.
Perhaps try reinstalling nvidia-cg-toolkit after resyncing: some
searches tell me there was yet another compilation breakage that got
fixed recently: https://bugs.gentoo.org/show_bug.cgi?id=443546
But one person noted it does not work in amd64... I wonder if linking
lib64 to lib there would work.
--
Nuno Silva (aka njsg)
http://njsg.sdf-eu.org/
prev parent reply other threads:[~2013-02-04 16:42 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-02-03 13:40 [gentoo-user] error: Cg/cg.h: No such file or directory João Matos
2013-02-03 14:30 ` Nilesh Govindrajan
2013-02-03 15:09 ` João Matos
2013-02-04 16:41 ` Nuno Silva [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87sj5cdoag.fsf@ist.utl.pt \
--to=nunojsilva@ist.utl.pt \
--cc=gentoo-user@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox