Results 1 to 3 of 3
  1. #1
    Junior Member bradsouthern's Avatar
    Join Date
    Mar 2009
    Location
    Denver Colorado
    Posts
    11

    Default GCC Compile Problem

    Basic Information:
    West Host Business Pro Plan
    Development Applications Installed
    • GNU Compiler Collection 1.0
    • Java JRE 1.5
    • Perl 5.8.8
    • PHP 5.2.6
    • Python 2.2.2


    Source Name: Astrolog540
    File downloaded from:
    http://www.magitech.com/astrolog/astrolog/astfile.htm
    • Astrolog 5.40 for Unix: Source code supporting X11. (1465K shell archive.)


    I uploaded the file ast54unx.shr. Using the West Host File Manager I click on the Execute a Command button and typed in:
    Code:
    sh ast54unx.shr
    This extracted all of the files perfectly.

    I tried to execute the Makefile but it would not work. I did a Google search and found this very useful page:
    Compiling C and C++ Programs
    http://pages.cs.wisc.edu/~beechung/ref/gcc-intro.html

    Using the West Host File Manager Execute a Command button and typing this command:
    Code:
    gcc -c -O *.c; gcc -o astrolog *.o -lm -lX11
    I can get the source files to compile, however, it does not create the executable file (astrolog).

    My experience with compiling programs from binary files is very limited. I have tried it on Red Hat and Mandrake OS's and my success rate is about 50%.

    I think that there is probably an error in my syntax which I just don't have enough experience to see. I will give the original source code from the Makefile below.

    If you can see what I am doing wrong, please let me know. Any help would be greatly appreciated.

    Code:
    # Astrolog (Version 5.40) File: Makefile (Unix version)
    #
    # IMPORTANT NOTICE: The graphics database and chart display routines
    # used in this program are Copyright (C) 1991-1998 by Walter D. Pullen
    # (Astara@msn.com, http://www.magitech.com/~cruiser1/astrolog.htm).
    # Permission is granted to freely use and distribute these routines
    # provided one doesn't sell, restrict, or profit from them in any way.
    # Modification is allowed provided these notices remain with any
    # altered or edited versions of the program.
    #
    # First created 11/21/1991.
    #
    # This Makefile is included only for convenience. One could easily compile
    # Astrolog on a Unix system by hand with the command:
    # % cc -c -O *.c; cc -o astrolog *.o -lm -lX11
    # Generally, all that needs to be done to compile once astrolog.h has been
    # edited, is compile each source file, and link them together with the math
    # library, and if applicable, the main X library.
    #
    NAME = astrolog
    OBJ = astrolog.o data.o data2.o general.o io.o\
     calc.o matrix.o placalc.o placalc2.o\
     charts0.o charts1.o charts2.o charts3.o intrpret.o\
     xdata.o xgeneral.o xdevice.o xcharts0.o xcharts1.o xcharts2.o xscreen.o
    # If you don't have X windows, delete the "-lX11" part from the line below:
    LIBS = -lm -lX11
    CFLAGS = -O
    
    astrolog:: $(OBJ)
    	cc -o $(NAME) $(OBJ) $(LIBS)
    	strip $(NAME)
    #
    "O ye that love mankind! Ye that dare oppose, not only the tyranny, but the tyrant, stand forth! Every spot of the old world is overrun with oppression. Freedom hath been hunted round the globe. Asia, and Africa, have long expelled her. Europe regards her like a stranger, and England hath given her warning to depart. O! receive the fugitive, and prepare in time an asylum for mankind."

    Thomas Paine - Common Sense - Thoughts On The Present State Of American Affairs... 1774

  2. #2
    Moderator wildjokerdesign's Avatar
    Join Date
    Jun 2003
    Location
    Kansas City Mo
    Posts
    5,720

    Default

    I tried to execute the Makefile but it would not work.
    What do you mean it did not work? What did you actually do? Did you run configure, make, and then make install or something else? With WestHost is is best to run configure with a prefix other then default because we do not have full access.
    EXAMPLE:
    Code:
    ./configure --prefix=/home/yourusername
    Matt's WH Help page has some info on installing in alternate prefixes: http://www.domsch.com/westhost/
    Shawn
    Please remember your charity of choice: http://www.redcross.org

    Handy Links: wildjokerdesign.net | Plain Text Editors: EditPlus | Crimson

  3. #3
    Junior Member bradsouthern's Avatar
    Join Date
    Mar 2009
    Location
    Denver Colorado
    Posts
    11

    Default

    Thank you Shawn for your reply. Sorry to take so long to respond. I did not think to subscribe to the thread since I was the one who posted it. I thought I was automatically subscribed.

    Anyway, I did some research on the web and came up with a newer install script which I had some limited success.

    Code:
    NAME = astrolog
    OBJ = astrolog.o data.o data2.o general.o io.o\
     calc.o matrix.o charts0.o charts1.o charts2.o charts3.o\
     intrpret.o intrpalt.o\
     swe_call.o swejpl.o swemplan.o sweph.o\
     swedate.o swemmoon.o swephlib.o\
     xdata.o xgeneral.o xdevice.o xcharts0.o xcharts1.o xcharts2.o xscreen.o
    # If you don't have X windows, delete the "-lX11" part from the line below:
    # LIBS = -lm -lX11
    # with Debian Linux and X windows worked 
    # LIBS = -lm -L/usr/X11R6/lib -lX11
    LIBS= -lm
    #
    CFLAGS = -O -DHPUX_SOURCE
    #
    # CFLAGS from 5.41 original sources
    # CFLAGS = -g -Aa -DHPUX_SOURCE
    #
    # Planetery ephemeris are built into code. To drop them and use external file, 
    # use additional flag -DPAIR_SWEPH
    #
    astrolog:: $(OBJ)
    	cc -o $(NAME) $(OBJ) $(LIBS)
    	strip $(NAME)
    #
    This compiled the executable file (astrolog). Now I can get a text output from the program.

    I tried every way I could think of, changing the syntax over and over again to get the X11 libraries to compile into the program. The program would compile with
    Code:
    LIBS = -lm -L/usr/X11R6/lib -lX11
    but it would not run. It printed out an error (can not find - no file or directory).

    To answer your question
    What did you actually do?
    I followed the instructions in the file
    Upload the files and type make.
    If you can see what I am doing wrong with the X11 libraries, please let me know. Any help would be greatly appreciated.
    "O ye that love mankind! Ye that dare oppose, not only the tyranny, but the tyrant, stand forth! Every spot of the old world is overrun with oppression. Freedom hath been hunted round the globe. Asia, and Africa, have long expelled her. Europe regards her like a stranger, and England hath given her warning to depart. O! receive the fugitive, and prepare in time an asylum for mankind."

    Thomas Paine - Common Sense - Thoughts On The Present State Of American Affairs... 1774

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •