Click here to Skip to main content
15,889,876 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionconst issue... [modified] Pin
paulstandard18-Apr-08 3:29
paulstandard18-Apr-08 3:29 
GeneralRe: const issue... Pin
David Crow18-Apr-08 4:47
David Crow18-Apr-08 4:47 
GeneralRe: const issue... Pin
paulstandard18-Apr-08 5:01
paulstandard18-Apr-08 5:01 
GeneralRe: const issue... Pin
Matthew Faithfull18-Apr-08 6:49
Matthew Faithfull18-Apr-08 6:49 
GeneralRe: const issue... Pin
CPallini18-Apr-08 9:10
mveCPallini18-Apr-08 9:10 
Generalthat answers problem 2...thanks Mathew [modified] Pin
paulstandard18-Apr-08 9:56
paulstandard18-Apr-08 9:56 
Generalcause of problem one ... Pin
paulstandard18-Apr-08 10:35
paulstandard18-Apr-08 10:35 
QuestionHow to get rid of these errors [modified] Pin
pl_kode18-Apr-08 3:25
pl_kode18-Apr-08 3:25 
error LNK2001: unresolved external symbol _pay
fatal error LNK1120: 1 unresolved externals

I am trying out a simple code and getting the above two errors. Kindly please help me out to get rid of them.

My code is below

Source..
#include "cdll.h"
#include <iostream.h>

__declspec(dllexport) int pay(int days,int salary)
{
int total;
total=days*salary;
return total;
}

Header...
#ifndef CDLL_H
#define CDLL_H


__declspec(dllexport)int pay(int days,int salary);

#endif

main..
#include <stdio.h>
#include "cdll.h"
#include <conio.h>

void main()
{
int days;
long salary;
char name[30];

printf("Enter name of employee:");
scanf("%s",name);
printf("\n Enter days worked:");
scanf("%d",&days);
printf("\n Enter wages per day:");
scanf("%d",&salary);

printf("\n NAME:%s",name);
printf("\n MONTHLY INCOME:%d",pay(days,salary));

getch();
}

Please help me out.

Thanks

modified on Friday, April 18, 2008 9:31 AM

GeneralRe: How to get rid of these errors Pin
David Crow18-Apr-08 4:01
David Crow18-Apr-08 4:01 
QuestionRe: How to get rid of these errors Pin
CPallini18-Apr-08 4:02
mveCPallini18-Apr-08 4:02 
GeneralRe: How to get rid of these errors Pin
pl_kode18-Apr-08 4:24
pl_kode18-Apr-08 4:24 
QuestionRe: How to get rid of these errors Pin
David Crow18-Apr-08 4:43
David Crow18-Apr-08 4:43 
GeneralRe: How to get rid of these errors Pin
pl_kode18-Apr-08 5:00
pl_kode18-Apr-08 5:00 
QuestionRe: How to get rid of these errors Pin
David Crow18-Apr-08 5:07
David Crow18-Apr-08 5:07 
GeneralRe: How to get rid of these errors Pin
Iain Clarke, Warrior Programmer18-Apr-08 4:10
Iain Clarke, Warrior Programmer18-Apr-08 4:10 
QuestionMultiGraph Programming in VC++ Pin
Andy Rama18-Apr-08 2:40
Andy Rama18-Apr-08 2:40 
QuestionHow can I read the attributes of files? Pin
ritz123418-Apr-08 2:23
ritz123418-Apr-08 2:23 
AnswerRe: How can I read the attributes of files? Pin
Rajesh R Subramanian18-Apr-08 2:45
professionalRajesh R Subramanian18-Apr-08 2:45 
AnswerRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 2:55
David Crow18-Apr-08 2:55 
GeneralRe: How can I read the attributes of files? Pin
ritz123418-Apr-08 3:05
ritz123418-Apr-08 3:05 
QuestionRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 3:09
David Crow18-Apr-08 3:09 
GeneralRe: How can I read the attributes of files? Pin
ritz123418-Apr-08 3:12
ritz123418-Apr-08 3:12 
GeneralRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 3:18
David Crow18-Apr-08 3:18 
GeneralRe: How can I read the attributes of files? Pin
ritz123418-Apr-08 3:42
ritz123418-Apr-08 3:42 
GeneralRe: How can I read the attributes of files? Pin
David Crow18-Apr-08 3:57
David Crow18-Apr-08 3:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.