Another problem with the same program as before

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sejoro
    New Member
    • Feb 2008
    • 9

    #1

    Another problem with the same program as before

    I fixed the operand problem (thanks) and now a new one has risen up. I have to compile it with a makefile which I have made and I am getting more strange errors I don't know how to fix.

    Well, first of all, I don't know how to open a file in one function and use the same ifstream in another function in a separate file.

    And second of all, I keep getting the following error:

    Code:
    Undefined                       first referenced
     symbol                             in file
    void count(frequency,int&,int&)      main.o
    void print(frequency)         main.o
    ld: fatal: Symbol referencing errors. No output written to Alpha
    *** Error code 1
    make: Fatal error: Command failed for target `Alpha'
    Here's the prototypes and calls to those functions:

    Code:
    void count(struct frequency, int&, int&);
    void print(struct frequency);
    count(AofS[0], counter, total);
    print(AofS[0]);
    Here's the makefile, if it helps, and a list of files in the folder after a make attempt:

    Code:
    ################################################################
    #               makefile for Alpha
    #
    # Dependency List:
    # ================
    #
    #
    Alpha: main.cpp openFile.cpp count.cpp print.cpp struct.h algorithm.o code.o
    #
    # Action List:
    # ============
    #
    #
            CC -g -o Alpha main.cpp openFile.cpp count.cpp print.cpp algorithm.o code.o
    #
    #
    #
    Code:
    a.out           code.o          count.o         main.o          openFile.o      struct.h        
    algorithm.o     count.cpp       main.cpp        makefile        print.cpp       SunWS_cache     text.txt
    algorithm.txt   openFile.cpp    print.o
    What is wrong? Please help.
  • Sejoro
    New Member
    • Feb 2008
    • 9

    #2
    So, no one can help me?

    Comment

    Working...