[nmglug] Unix symbolic links
Le Nguyen
lenguyen0 at gmail.com
Fri Jul 3 11:55:24 PDT 2009
>
> Hi Antonio K
I haven't touched Unix for quite a while now, so I may be wrong. I hope the
other experts will correct me on this.
Basically you're trying to create a symbolic link for the compiler to find a
specific include file. The compiler will (unless told otherwise via the
-I... flag on the $CC command line) go to a specific location to find the
include files which are mentioned at the top of your C programs ( the
default pathname used by the compiler is /include or /usr/include, my
memory is failing, please double-check).
This way you can "upgrade" to newer source code or keep several version of
the source code around, and whatever include subtree is linked to
/usr/include is what the compiler will use.
So I'd run the following command once (assuming your login has the
permissions to create a symlink - note that the first 2 letters of the
command are LN in lower-case):
ln -s /usr/src/linux-headers-2.6.28-13-generic/include /usr/include
on the other hand, if the other include files under /usr/include are just
fine, and you just want to use the kernel includes for this specific
version, then the following command would be better:
ln -s /usr/src/linux-headers-2.6.28-13-generic/include/linux
/usr/include/linux
After this the compiler will see the whole subtree of include files (under
/usr/include/linux) which go with your linux kernel version 2.6.28-13
Your proposed command is a little bit too restrictive, and you may end up
creating dozens of symlinks when a single one at the proper location of the
include subtree will do.
Let me know how it goes.
Le Nguyen
>
> ---------- Forwarded message ----------
> From: a <akaluta at taosnet.com>
> To: nmglug at nmglug.org
> Date: Fri, 03 Jul 2009 07:41:35 -0600
> Subject: [nmglug] Write loadable kernel module
> Attempting to follow several basic tutorials, writing first loadable
> kernel module, each attempt has been foiled by something like the
> following:
>
> Example:
> #include <linux/module.h> error: linux/module.h no such file or
> directory.
>
> linux/module.h does reside
> in: /usr/src/linux-headers-2.6.28-13-generic/include/linux/module.h
>
> Without creating further errors can I: ln
> -s /usr/src/linux-headers-2.6.28-13-generic/include/linux/module.h
> /linux/module.h
>
> Is the suggetion workable,alternately can you suggest another?
>
>
> Thanks,Antonio
>
>
>
>
>
> _______________________________________________
> nmglug mailing list
> nmglug at nmglug.org
> https://nmglug.org/mailman/listinfo/nmglug
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nmglug.org/pipermail/nmglug-nmglug.org/attachments/20090703/40b339f5/attachment.htm>
More information about the nmglug
mailing list