السلام عليكم هذا الخطأ ظهر لي عند عمل compile ولم اعرف الحل
--------------------Configuration: Expansion - Win32 Debug-------------------- Linking... LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16 Debug/Expansion.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. Expansion.exe - 2 error(s), 0 warning(s)
وهذا هو برنامجي
ملف Main
#include<iostream>
#include"CB.h"
using namespace std;
int main()
{
int Carray[4][4],raw=0,col=0,*pRAW,*pCOL,EXP1=0,EXP2=0,REST1=0,REST2=0,*pMIN,minterm=0;
//Main array :: array raw value :: array column value :: pointer to the raw
//:: pointer to the column :: expand about bit1 :: expand about bit2 :: the rest bit1
//:: the rest bit2 :: pointer to the MinTerm :: The function value "minterm""1 position in
//the function"
pRAW=&raw; //assigning the pointer to the right value of the raw
pCOL=&col;
for(int i=0;i<4;i++) //initializing loop
for(int j=0;j<4;j++)
Carray[j]=0;
cout<<"Enter The Expand about Bits Respectivily\n"<<endl;
cin>>EXP1>>EXP2;
cout<<"Enter Your Minterms Please, your Values Should be from 0 to 15"<<endl;
cout<<"If you had finished entering your values type -1 and press Enter\n";
cout<<"your Value will be processed and stored automatically\n";
i=0;
while(1)
{
cin>>minterm;
pMIN=new int; //creating space for the Minterm Number
pMIN=&minterm;
if(minterm==-1)break; //checking the value to break out of the loop
Convert_Binary(pMIN,EXP1,EXP2,REST1,REST2,pRAW,pCOL); //sending the variables
Carray[raw][col]=1; // Storing the Final result for the function before
//determining and processing the reduced table chart
i++;
delete pMIN; //deleting the pointer from the heap
}
return 0;
}ملف CB.h
// this function converts the incoming MinTerm value into an array of 4 bit binary
//numbers and pass the data to another function to update the values of the raw and columns
// for the MAIN File
#ifndef THISFILE //Multiple declaration for the file
#define THISFILE
#include"CD.h"
void Convert_Binary(int *pArrayMember,int EXP1,int EXP2,int REST1,int REST2,int *pRAW,int *Pcol);//Function declaration
void Convert_Binary(int *pAM,int EXP1,int EXP2,int REST1,int REST2,int *pRAW,int*pCOL) //Function def...
{
int i=3,BMT[4],*pBMT; //counter:: binary array :: pointer to the binary array
pBMT=BMT; //assigning the array to a pointer
while(i>-1) //converting to 4=bit Binary
{
BMT=*pAM%2;
*pAM=*pAM/2.0;
--i;
}
*pRAW=Convert_B_Decimal(pBMT,EXP1,EXP2); //waiting for RAW result from the function
*pCOL=Convert_B_Decimal(pBMT,REST1,REST2); //waiting for Column result from the function
}
#endif
//end of the function implementationملف CD.h
//this function converts the Binary minterm into a decimal equevalent for
//the expand about variables and the FAI variables
#ifndef ThisFile
#define ThisFile
int Convert_B_Decimal(int*pBinaryArray,int EXPAND1,int EXPAND2); //function declaration
int Convert_B_Decimal(int*pB,int EX1,int EX2) //function def...
{ // X1 X2 | D
if((pB[EX1]=0)&&(pB[EX2]=0))return 0; // 0 0 | 0
if((pB[EX1]=0)&&(pB[EX2]=1))return 1; // 0 1 | 1
if((pB[EX1]=1)&&(pB[EX2]=0))return 2; // 1 0 | 2
if((pB[EX1]=1)&&(pB[EX2]=1))return 3; // 1 1 | 3
}
#endif
//end of the function implementationارجوا المساعدة لاني حتى الان لم اجد جوابا في هذا المنتدى لاي موضوع اضعه ولا اعرف ما هو السبب :(
