Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

奇怪的VC40

0 views
Skip to first unread message

uff...@ms6.hinet.net

unread,
Jul 1, 1997, 3:00:00 AM7/1/97
to

以下是一個完整的windows程式, 在Link時會出現Error 訊息, "delete 被重複定義"
但若是把 fun() 這完全無關的函式拿掉, Link 卻能成功.
天啊!
這是怎麼回事,快救救我吧!我快想瘋了!


----------------------------------------------------------------
#include <windows.h>
#include <stdlib.h>
#include <fstream.h>

void fun() //<----------此函式
{
int a=0;
ofstream fs("file.dat");
fs << a;
fs.close();
}

void *operator new(UINT size)
{ return malloc(size); }

void operator delete(void *pnt)
{ free(pnt); }

int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPSTR lpCmdLine, int nCmdShow )
{ return 0; }

LRESULT CALLBACK MainWindowProc( HWND hWnd, unsigned uMsg,
WPARAM wParam, LPARAM lParam )
{ return 0;}

0 new messages