LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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-05-2010, 02:25 PM   #1
pmagunia
LQ Newbie
 
Registered: May 2010
Posts: 4

Rep: Reputation: 0
Lost gcc .bash_profile Paths


Recently I tried compiling a simple Hello World with gcc but didn't have any luck. I got this message:

Code:
junk.c:1:19: error: stdio.h: No such file or directory
gcc was installed and configured correctly at one point but I think I changed the the .bash_profile since then.

I checked where stdio.h lives. The path is:

Code:
~/lib/gcc/i586-pc-linux-gnu/4.4.0/include/ssp
The following is my current .bash_profile. I changed some of the absolute paths to '~' for security.

Code:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs
CC="gcc"
PATH=$PATH:$HOME/bin:/usr/bin
cd $HOME/html
LDFLAGS=-L/~/lib
CPPFLAGS=-I/~/lib/gcc/i586-pc-linux-gnu/4.4.0/include

export CPPFLAGS
export LDFLAGS
export PATH
export SBCL_HOME=~/lib/sbcl
I think at some point there was an LD_LIBRARY_PATH's path too.

Here is the contents of my hello world program:

Code:
#include <stdio.h>

main()
{
  for(;;)
      {
          printf ("Hello World!\n");
      }
}
I am not sure what to do. If somebody could help solve this problem for me I would appreciate it. Thank you

pmagunia
 
Old 05-05-2010, 03:10 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 167Reputation: 167
Clarification-- are you setting your actual paths to 'LDFLAGS=-L/~/lib' for example or for an example 'LDFLAGS=-L/var/lib'? Also as an aside, obfuscating paths... waste of time. passwords, ip addresses, etc... sure worth the effort often more for sake of privacy than security but... paths-- not so much. Your stdio.h should probably be /usr/include/stdio.h or something very similar. My real question is... why are you changing all this and messing with it if you have no real understanding of how it works and the defaults typically work flawlessly (provided you actually have what you need installed.)
 
Old 05-05-2010, 07:03 PM   #3
pmagunia
LQ Newbie
 
Registered: May 2010
Posts: 4

Original Poster
Rep: Reputation: 0
The LDFLAGS path I have is absolute. I used the tilde to cover up the path to my home directory. In actuality it starts with '-L/home/...'

The reason I am asking is because the software is all on my server: I only have a basic hosting plan without access to 'make' or tools like 'yum'. I can not install software by the usual means.

So I recreated the home directory path on my home computer and compiled everything at home, and then uploaded these files to the server. It worked: I have working versions of Maxima and R on my server now. They are still working but I can't seem to compile anything. Which is where I was hoping someone could help me do. When I compiled the software at home I made sure there were no other development tools other than what was available in my home directory

I tried a variety a ways but nothing seems to compile without errors. I gave an example of what I tried in the first post. I would like to be able to compile something at least. A simple 'hello world' would be a great start.
 
  


Reply



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
Installing GCC. I am so lost Dopamine Linux - Newbie 11 11-10-2009 10:17 AM
After GCC package install- Lost DSL connection Marlinnhag@aol.com SUSE / openSUSE 0 10-12-2006 03:07 PM
GCC, Environ paths and Vars(Nvidia drivers too) Trov Linux - Newbie 8 08-28-2006 05:35 PM
lost .bashrc .bash_profile $100 reward ; ) Sabicas Slackware 4 10-06-2004 12:24 AM
Automatically resolving WINDOWS paths to pre-configured Linux paths gazzy Linux - General 1 09-05-2003 10:15 PM

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

All times are GMT -5. The time now is 12:29 AM.

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