First off, this is homework and I do my classes online and the teacher doesn't respond to my e-mails in the fastest fashion. I've been getting linker errors all day and I'd like at least an explanation of why they happen.

here is my problem.
Main.obj : error LNK2019: unresolved external symbol "public: __thiscall Dictionary::Dictionary(int)" (??0Dictionary@@QAE@H@Z) referenced in function _main
C:\Documents and Settings\Keith Acevedo\My Documents\Visual Studio 2008\Projects\RosarioWeek3\Debug\RosarioWeek3.exe : fatal error LNK1120: 1 unresolved externals

I get these two when I try to compile my program. It also does this when I try to put composition in it.

the problem is in the dictionary file. It's not seeing myDictionary.loadDictionary(); for some reason and I don't know why.

Also if you guy/gals would I have included a second zip of an alternate way I was going with the project maybe you can tell me what I am doing wrong there too.

The one I really want to focus is week 3 they are both the same program it's just I was trying different things and yes, the menu funtions thing is supposed to be in controller. I have included them both to show supposed to show my problems in composition and this inheritance error. Any help will be appreciated.

Recommended Answers

All 5 Replies

Define this constructor.

Dictionary(int word = 1);

Thanx it it worked! Now if I could figure out the composition thing... Thanks a lot man u r awesome!

and i have also linker error in this code :>

#include <vcl.h>
#include "MT262io.h"
#include <stdio.h>
#pragma hdrstop

//---------------------------------------------------------------------------

#pragma argsused
int main(int argc, char* argv[])
{
  int i;
  int square;
  i=10;
    while ( i>=10 && i<=31){
      square=i*i;

      if((square/100)==(square%10))
       {
         WriteIntPr("the input is palindromic",square);
       }
        else
         {
           puts("the input it not palindromic");
            i++;
         }
       }

        getchar();
        return 0;
}

[Linker Error] Unresolved external 'WriteIntPr(System::AnsiString, int)' referenced from C:\MT262\BLOCK I\ASMA3.OBJ

#include<stdio.h>
#include<conio.h>
void main()
{
int a,d,c,b,ch;
int add(int a,int b=20,int c=40);
int sub(int a,int b=39,int c=5);
int div(int a,int b=4);
int multi(int a,int b=10,int c=5);
clrscr();

cout<<"\n enter the number:";
cin>>a>>b>>c;
cout<<"\n 1.add 2,sub 3.div 4.multi";
cout<<"enter a choice";
cin>>ch;
switch(ch)
{
case 1:
cout<<"\n one argument is passed";
d=add(a);
cout<<" sum is"<<d;
d=add(a,b);
cout<<"\n two arguments s passed";
cout<<" sum is"<<d;
d=add(a,b,c);
cout<<"\n 3 arguments is passed";
cout<<" sum is"<<d;
break;

case 2:
cout<<"\n one argument is passed";
d=sub(a);
cout<<" sub is"<<d;
d=sub(a,b);
cout<<"\n two arguments s passed";
cout<<" sub is"<<d;
d=sub(a,b,c);
cout<<"\n 3 arguments is passed";
cout<<" sub is"<<d;
break;

case 3:
cout<<"\n one argument is passed";
d=multi(a);
cout<<" multi is"<<d;
d=multi(a,b);
cout<<"\n two arguments s passed";
cout<<" multi is"<<d;
d=multi(a,b);
cout<<"\n 3 arguments is passed";
cout<<" multi is"<<d;
break;

case 4:
cout<<"\n one argument is passed";
d=div(a);
cout<<" div is"<<d;
d=div(a,b);
cout<<"\n two arguments s passed";
cout<<" div is"<<d;
break;
}
getch();
}

#include<iostream.h>
#include<conio.h>
void main()
{
int a,d,c,b,ch;
int add(int a,int b=20,int c=40);
int sub(int a,int b=39,int c=5);
int div(int a,int b=4);
int multi(int a,int b=10,int c=5);
clrscr();

cout<<"\n enter the number:";
cin>>a>>b>>c;
cout<<"\n 1.add 2,sub 3.div 4.multi";
cout<<"enter a choice";
cin>>ch;
switch(ch)
{
case 1:
cout<<"\n one argument is passed";
d=add(a);
cout<<" sum is"<<d;
d=add(a,b);
cout<<"\n two arguments s passed";
cout<<" sum is"<<d;
d=add(a,b,c);
cout<<"\n 3 arguments is passed";
cout<<" sum is"<<d;
break;

case 2:
cout<<"\n one argument is passed";
d=sub(a);
cout<<" sub is"<<d;
d=sub(a,b);
cout<<"\n two arguments s passed";
cout<<" sub is"<<d;
d=sub(a,b,c);
cout<<"\n 3 arguments is passed";
cout<<" sub is"<<d;
break;

case 3:
cout<<"\n one argument is passed";
d=multi(a);
cout<<" multi is"<<d;
d=multi(a,b);
cout<<"\n two arguments s passed";
cout<<" multi is"<<d;
d=multi(a,b);
cout<<"\n 3 arguments is passed";
cout<<" multi is"<<d;
break;

case 4:
cout<<"\n one argument is passed";
d=div(a);
cout<<" div is"<<d;
d=div(a,b);
cout<<"\n two arguments s passed";
cout<<" div is"<<d;
break;
}
getch();
}

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.