Oh and i did what you told me but now i have different kind of error at compile.:
libcpmtd.lib(xdebug.obj) : warning LNK4098: defaultlib 'libcmt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
Main.obj : error LNK2019: unresolved external symbol __CrtDbgReportW referenced in function "public: struct bullet * & __thiscall std::vector<struct bullet *,class std::allocator<struct bullet *> >::operator[](unsigned int)" (??A?$vector@PAUbullet@@V?$allocator@PAUbullet@@@std@@@std@@QAEAAPAUbullet@@I@Z)
libcpmtd.lib(stdthrow.obj) : error LNK2001: unresolved external symbol __CrtDbgReportW
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __malloc_dbg referenced in function "void * __cdecl operator new(unsigned int,struct std::_DebugHeapTag_t const &,char *,int)" (??2@YAPAXIABU_DebugHeapTag_t@std@@PADH@Z)
libcpmtd.lib(xdebug.obj) : error LNK2019: unresolved external symbol __free_dbg referenced in function "void __cdecl operator delete(void *,struct std::_DebugHeapTag_t const &,char *,int)" (??3@YAXPAXABU_DebugHeapTag_t@std@@PADH@Z)
Debug\Project PAF vs Aliens.exe : fatal error LNK1120: 3 unresolved externals
Build log was saved at "file://f:\arif projects\Project PAF vs Aliens\Project PAF vs Aliens\Debug\BuildLog.htm"
Project PAF vs Aliens - 5 error(s), 1 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
Here is my rewritten code:
struct bullet
{
int id;
int life;
};
vector<bullet*> bul;
void makebullet(int obj,int limb, int lif)
{
int i=bul.size() + 201;
bul.push_back(new bullet);
dbMakeObjectCube(i,10.0);
float x,y,z,ax,ay,az;
x=dbObjectPositionX(i);
y=dbObjectPositionY(i);
z=dbObjectPositionZ(i);
ax=dbObjectAngleX(i);
ay=dbObjectAngleY(i);
az=dbObjectAngleZ(i);
dbPositionObject(i,x,y,z);
dbRotateObject(i,ax,ay,az);
}
void updatebullet()
{
for ( int i=0 ; i<bul.size();i++)
{
if ( dbObjectExist(bul[i]->id))
{
dbMoveObject(bul[i]->id,1);
bul[i]->life--;
if (bul[i]->life<0)
{
dbDeleteObject(bul[i]->id);
delete bul[i];
bul.erase(bul.begin()+i);
}
}
}
}
ALLAH IS THE GREATEST
May he forgive me