By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,498 Members | 1,564 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,498 IT Pros & Developers. It's quick & easy.

Another problem with the same program as before

P: 9
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:

Expand|Select|Wrap|Line Numbers
  1. Undefined                       first referenced
  2.  symbol                             in file
  3. void count(frequency,int&,int&)      main.o
  4. void print(frequency)         main.o
  5. ld: fatal: Symbol referencing errors. No output written to Alpha
  6. *** Error code 1
  7. make: Fatal error: Command failed for target `Alpha'
Here's the prototypes and calls to those functions:

Expand|Select|Wrap|Line Numbers
  1. void count(struct frequency, int&, int&);
  2. void print(struct frequency);
  3. count(AofS[0], counter, total);
  4. print(AofS[0]);
Here's the makefile, if it helps, and a list of files in the folder after a make attempt:

Expand|Select|Wrap|Line Numbers
  1. ################################################################
  2. #               makefile for Alpha
  3. #
  4. # Dependency List:
  5. # ================
  6. #
  7. #
  8. Alpha: main.cpp openFile.cpp count.cpp print.cpp struct.h algorithm.o code.o
  9. #
  10. # Action List:
  11. # ============
  12. #
  13. #
  14.         CC -g -o Alpha main.cpp openFile.cpp count.cpp print.cpp algorithm.o code.o
  15. #
  16. #
  17. #
  18.  
Expand|Select|Wrap|Line Numbers
  1. a.out           code.o          count.o         main.o          openFile.o      struct.h        
  2. algorithm.o     count.cpp       main.cpp        makefile        print.cpp       SunWS_cache     text.txt
  3. algorithm.txt   openFile.cpp    print.o      
What is wrong? Please help.
Apr 21 '08 #1
Share this Question
Share on Google+
1 Reply


P: 9
So, no one can help me?
Apr 25 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.