LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 05-11-2006, 07:38 AM   #1
vkmgeek
Member
 
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185
Blog Entries: 2

Rep: Reputation: 31
gcc -I option


Hey,
Its surprising!!

I do
gcc -c -I/home/vkmgeek sample.c .....It works
now if I give soft link of above path instead of actual path....it is not working....why is it so?

that is,
gcc -c -I/home/vkm/myinclude sample.c .........not working

Some GURU ....plz have light on this!!!!
 
Old 05-11-2006, 10:44 AM   #2
taylor_venable
Member
 
Registered: Jun 2005
Location: Indiana, USA
Distribution: OpenBSD, Ubuntu
Posts: 892

Rep: Reputation: 43
It works for me using gcc 3.4.4 on FreeBSD 6-STABLE. (I believe the recommended method for compiling the Linux kernel relies on symlinked directories.) Could it be a permissions problem?
 
Old 05-11-2006, 12:08 PM   #3
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Taylor_venable is absolutely correct: "-I" should work whether it points to a "real directory" or a symbolic link to a real directory.

Of course, the link could be messed up.

Did you try this:
Quote:
ls /home/vkmgeek
ls /home/vkm/myinclude
and verify they both listed the same files?
 
Old 05-12-2006, 01:55 AM   #4
vkmgeek
Member
 
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185

Original Poster
Blog Entries: 2

Rep: Reputation: 31
Quote:
Originally Posted by paulsm4
Of course, the link could be messed up.
No, the link is not messed up. ls for both gives same output.
I also checked permissions of that link...i., ls -l...it has all permissions -lrwxrwxrwx.

But, I have gcc 3.4.3... Could it be a gcc version problem?
 
Old 05-12-2006, 02:42 AM   #5
nhydra
Member
 
Registered: May 2006
Distribution: Fedora Core, FreeSpire, PC-BSD, NetBSD
Posts: 96

Rep: Reputation: 15
Check the mount path of you filesystem.
I tried to compile some programs on other filesystem and had such problems like you.
The link and real directory have to be in one and same filesystem.
I check your example, it works on my computer with Gentoo.
 
Old 05-12-2006, 02:49 AM   #6
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Quote:
Originally Posted by nhydra
Check the mount path of you filesystem.
I tried to compile some programs on other filesystem and had such problems like you.
The link and real directory have to be in one and same filesystem.
I check your example, it works on my computer with Gentoo.
You mean the symlink and the original path must reside on the same partition? That's new to me. The only UNIX-like system where that may be true, AFAIK, is QNX Neutrino. It certainly should not matter with Linux.
 
Old 05-12-2006, 02:56 AM   #7
nhydra
Member
 
Registered: May 2006
Distribution: Fedora Core, FreeSpire, PC-BSD, NetBSD
Posts: 96

Rep: Reputation: 15
Quote:
Originally Posted by daihard
You mean the symlink and the original path must reside on the same partition? That's new to me. The only UNIX-like system where that may be true, AFAIK, is QNX Neutrino. It certainly should not matter with Linux.
Let me expain.
I have 2 partitions, the first one has FAT filesystem, the second has reiserfs.
I have source files in partition number 1 and want to compile them.
I try compile but nothing then i move the sources in the partition that is mounted as / mountpoint. Aftere that i compile the sources without any problems.
This is on Slackware and Gentoo linux.I had this problems any time when i decide to compile some program on diferent partitions.

Just try.It depends on mount options. When the filesystem is mounted as "default" you could compile any source.
 
Old 05-12-2006, 03:17 AM   #8
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Quote:
Originally Posted by nhydra
Let me expain.
I have 2 partitions, the first one has FAT filesystem, the second has reiserfs.
I have source files in partition number 1 and want to compile them.
I try compile but nothing then i move the sources in the partition that is mounted as / mountpoint. Aftere that i compile the sources without any problems.
This is on Slackware and Gentoo linux.I had this problems any time when i decide to compile some program on diferent partitions.

Just try.It depends on mount options. When the filesystem is mounted as "default" you could compile any source.
Ah, okay, so you mean "filesystem" as in FAT, ext3 and what not. I was confused because I was using AIX at work today, where they use the term "filesystem" as synonymous to "partition."

I wish I could try it myself, but all my local filesystems are ext3.
 
Old 05-12-2006, 03:27 AM   #9
nhydra
Member
 
Registered: May 2006
Distribution: Fedora Core, FreeSpire, PC-BSD, NetBSD
Posts: 96

Rep: Reputation: 15
Quote:
Originally Posted by daihard
I wish I could try it myself, but all my local filesystems are ext3.
The filesystem is realy synonymous of "partition". Because on every partition you have a filesystem.
You can't get 2 filesystems on one partition.
Try it.
Choose the filesystem that is not mounted as "default".
 
Old 05-12-2006, 03:41 AM   #10
daihard
Member
 
Registered: Jul 2003
Location: Seattle, WA
Distribution: Kubuntu 14.04 LTS
Posts: 915

Rep: Reputation: 34
Quote:
Originally Posted by nhydra
The filesystem is realy synonymous of "partition". Because on every partition you have a filesystem.
You can't get 2 filesystems on one partition.
I think what it comes down to is the terms "filesystem" and "filesystem format." I usually refer to "filesystem" as synonymous to "filesystem format" (i.e. ext3, FAT, etc). So two different partitions can have one "filesystem."
 
Old 05-12-2006, 07:13 AM   #11
vkmgeek
Member
 
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185

Original Poster
Blog Entries: 2

Rep: Reputation: 31
Quote:
filesystem
Here filesystem is same. I have both on same partition that is root partition. I m not doing mount kind of thing even...
After looking at the posts, I rechecked about problem, but its still there....

I m using 2.6 kernel. Though it doesn't matter, for the sake of specifying I m just specifying.

Can anyone with correct reason?
 
Old 05-14-2006, 12:54 PM   #12
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
You can't compile most software on a FAT file system, since all the file attributes are not available.

File system and partition should never be considered to be the same thing. You can have a file sydtem that's not a partition and you can have a partition with no file system on it.

UMSDOS made it possible to have two file system on the same partition.
 
Old 05-14-2006, 04:21 PM   #13
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
vkmgeek - I thought you were squared away days ago!

And jeez - the amount of nonsense and disinformation in this thread!

Sigh...

KNOWN FACTS:
1. You're having some kind of compile error.
For lack of an exact error message, we can only speculate on what the real error actually is.

2. Yes, in general "-I" works with symbolic links

3. Yes, in general you can compile on a FAT filesystem just as well as any other kind of (read/write) partition (with, of course, certain obvious limitations - including security, file name length, and case sensitivity)

4. No, "hard links" cannot span filesystems (whereas "soft links" most definitely can!)

SUGGESTED GAMEPLAN:
1. Cut and paste your exact compile command, along with the exact error message.

2. Give any other (brief!) information you think is relevant.

3. We'll take it from there and help you resolve this little mystery.

Sound like a plan?

Thanx in advance .. PSM
 
Old 05-14-2006, 05:11 PM   #14
ioerror
Member
 
Registered: Sep 2005
Location: Old Blighty
Distribution: Slackware, NetBSD
Posts: 536

Rep: Reputation: 34
Quote:
Originally Posted by paulsm4
And jeez - the amount of nonsense and disinformation in this thread!
Indeed. I don't know whether to laugh or cry.

Quote:
Originally Posted by nhydra
The link and real directory have to be in one and same filesystem.
No, they don't. What are you talking about? The reason it won't work on your FAT filesystem is because FAT doesn't support symlinks.

A symlink can, by definition, point ANYWHERE. The target doesn't even have to exist.

Quote:
Originally Posted by nhydra
The filesystem is realy synonymous of "partition". Because on every partition you have a filesystem.
What? A partition is a division of a disk drive. A filesystem is a way of storing and organising information (files). They are no more synonymous than a bookshelf is synonymous with the books on it. (I.e. not at all, for those of you at the back).

vkmgeek, what exactly are you trying to do? The -l option links against the given library, but /home/vkmgeek is presumably your ~ dir, not the name of a library ? I don't understand your command line(s)? What is /home/vkm/myinclude ?

Last edited by ioerror; 05-14-2006 at 05:14 PM.
 
Old 05-15-2006, 02:17 AM   #15
vkmgeek
Member
 
Registered: Feb 2006
Location: Ahmedabad
Distribution: rhel5
Posts: 185

Original Poster
Blog Entries: 2

Rep: Reputation: 31
Quote:
Originally Posted by ioerror
The -l option links against the given library, but /home/vkmgeek is presumably your ~ dir, not the name of a library ? I don't understand your command line(s)? What is /home/vkm/myinclude ?
Well, everything is messed up here. Rather than solving a problem, discussion went on filesystem and partition - nonsense things.

ioerror - I have used -I option and not -l option. Former one is used to give a dir only. And there, my all header files are staying...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
gcc unrecognized option ruben22 Linux From Scratch 9 11-12-2008 04:41 AM
about -shared option in gcc George2 Programming 0 05-07-2006 03:43 AM
question about gcc/g++ -M option George2 Programming 4 04-27-2006 10:02 PM
what does the option -s of gcc mean ? hongxing Linux - Software 3 11-28-2005 08:12 PM
gcc option -E use. niverson Programming 2 10-11-2004 04:06 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration