Newbie:- Why am i getting a linking error 
Author Message
 Newbie:- Why am i getting a linking error

#include <iostream>

using namespace std;

class CCard  
{
public:
        int Suit;
        int Value;

Quote:
};

CCard Cards[52];

int main()
{
        int CaSuit;
        int CaValue;
        int CaCount;

        for (CaSuit= 1;CaSuit<=4;CaSuit++)
        {
                for (CaValue = 1; CaValue <=13; CaValue++)
                {
                        Cards[CaCount].Suit = CaSuit;
                        Cards[CaCount].Value = CaValue;
                        CaCount++;
                }
        }

        return 0;

Quote:
}

When I try to build it I get the following error messages:

LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol

PokerGame___Win32_Debug/PokerGame.exe : fatal error LNK1120: 1
unresolved externals

Can you tell me why I am getting this?



Mon, 05 Dec 2005 19:25:26 GMT  
 Newbie:- Why am i getting a linking error
I used to find #include <afx.h> worked to solve this,
although the official resolution is to go to project or
build menu, settings, then on the Link tab, choose Output
from the drop down, and in the top right text box type
wWinMainCRTStartup
This defines the entry point for the application.
Regards
Ben

Quote:
>-----Original Message-----
>#include <iostream>

>using namespace std;

>class CCard  
>{
>public:
>    int Suit;
>    int Value;
>};

>CCard Cards[52];

>int main()
>{
>    int CaSuit;
>    int CaValue;
>    int CaCount;

>    for (CaSuit= 1;CaSuit<=4;CaSuit++)
>    {
>            for (CaValue = 1; CaValue <=13; CaValue++)
>            {
>                    Cards[CaCount].Suit = CaSuit;
>                    Cards[CaCount].Value = CaValue;
>                    CaCount++;
>            }
>    }

>    return 0;
>}

>When I try to build it I get the following error messages:

>LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved
external symbol

>PokerGame___Win32_Debug/PokerGame.exe : fatal error
LNK1120: 1
>unresolved externals

>Can you tell me why I am getting this?
>.



Mon, 05 Dec 2005 20:23:26 GMT  
 Newbie:- Why am i getting a linking error
Wolfborn,

See if this resolves the problem.
http://support.microsoft.com/default.aspx?scid=kb;en-us;131204

--
Regards,
  Kobi Ben Tzvi


Quote:
> #include <iostream>

> using namespace std;

> class CCard
> {
> public:
> int Suit;
> int Value;
> };

> CCard Cards[52];

> int main()
> {
> int CaSuit;
> int CaValue;
> int CaCount;

> for (CaSuit= 1;CaSuit<=4;CaSuit++)
> {
> for (CaValue = 1; CaValue <=13; CaValue++)
> {
> Cards[CaCount].Suit = CaSuit;
> Cards[CaCount].Value = CaValue;
> CaCount++;
> }
> }

> return 0;
> }

> When I try to build it I get the following error messages:

> LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol

> PokerGame___Win32_Debug/PokerGame.exe : fatal error LNK1120: 1
> unresolved externals

> Can you tell me why I am getting this?



Mon, 05 Dec 2005 20:39:01 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Why I am getting Error C2091: function returns function

2. Don't understand why I am getting the C2236 error

3. Why am I getting this error - compiler bug?

4. Why am I getting an ExecutionEngineException?

5. Why am I not getting correct position?

6. Why am I getting a segmentation fault?

7. Why am I getting a General protection Fault?

8. Why am I not getting a LIB?

9. Why am i getting a exception illegal operation?

10. MissingManifestResourceException, why am I getting this?

11. Please help me - I am getting linker error !!!

12. Help a Newbie at Visual C++ (I am not a newbie at C++)

 

 
Powered by phpBB® Forum Software