unresolved external

This is a discussion on unresolved external within the C++ Programming forums, part of the General Programming Boards category; hey all, hope you're having a fine evening. you know you're moving up in the world when you finally get ...

  1. #1
    Registered User blight2c's Avatar
    Join Date
    Mar 2002
    Posts
    266

    unresolved external

    hey all, hope you're having a fine evening.

    you know you're moving up in the world when you finally get an error you've only read about Does someone mind pointing this out for me? Thanks.

    error:Error: Unresolved external 'f_deal(int[13] *, const char * *, const char * *)' r
    eferenced from C:\BORLAND\BCC55\BIN\POKER.OBJ

    Code:
    #include <iostream>
    #include <iomanip>
    #include <cstdlib>
    #include <ctime>
    
    using namespace std;
    
    
    void f_shuffle (int [] [13]);
    void f_deal (const int [] [13], const char *[], const char *[]);
    
    main()
    {	const char *suit [4]={
    							"Hearts", "Diamonds", "Clubs", "Spades",};
    	const char *face [13]={
    							"Ace", "Deuce", "Three", "Four",
    							"Five", "Six", "Seven", "Eight",
    							"Nine", "Ten", "Jack", "Queen", "King",};
    	int deck [4] [13]={0};
    	srand (time(0));
    
    	f_shuffle (deck);
    	f_deal (deck, face, suit);
    
    	return(0);
    }
    
    
    
    void f_shuffle (int _deck [] [13])
    {	int row, column;
    	for ( int card = 1; card <=52; card++)
    	{	do
    		{	row=rand() %4;
    			column=rand() %13;
    		}while (_deck [row] [column] !=0);
    		_deck [row] [column] = card;
    	}}
    
    void deal (const int _deck [] [13], const char *_face, const char *_suit[])
    {
    	for (int card=1; card <=52; card++)
    	{	for (int row=0; row<=3; row++)
    		{	for (int column=0; column <=12; column++)
    			{	if (_deck [row] [column] == card)
    				{	cout<<setw(5)<<setiosflags(ios::right)
    						<<_face[column]<<" of "
    						<<setw(8)<<setiosflags(ios::left)
    						<<_suit[row]
    						<<(card %2 ==0 ? '\n' : '\t');
    				}}}}
    		
    
    	}

  2. #2
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    Your function definition for f_deal should look like this:
    void f_deal (const int _deck [] [13], const char *_face[], const char *_suit[])

    Sometimes it helps to include the names in your prototype and then copy and paste that as your definition. That way you're sure that both the prototype and definition are the same.

    -Prelude
    My best code is written with the delete key.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Compiling sample DarkGDK Program
    By Phyxashun in forum Game Programming
    Replies: 6
    Last Post: 01-27-2009, 02:07 AM
  2. C++ std routines
    By siavoshkc in forum C++ Programming
    Replies: 33
    Last Post: 07-28-2006, 12:13 AM
  3. Including lib in a lib
    By bibiteinfo in forum C++ Programming
    Replies: 0
    Last Post: 02-07-2006, 01:28 PM
  4. debug to release modes
    By DavidP in forum Game Programming
    Replies: 5
    Last Post: 03-20-2003, 02:01 PM
  5. Unresolved external symbols in OGL
    By Shadow12345 in forum Game Programming
    Replies: 4
    Last Post: 08-04-2002, 09:46 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21