| | |
"already defined" error
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
My code :
Here is how DebugTest() defined :
The error given : I used the same code for some of my other programs too, but this is the first time it gives such an error.
Platform : WinXP Home
Compiler : VC++ 2005
Reason for error = ?
C++ Syntax (Toggle Plain Text)
int _tmain(int argc, _TCHAR* argv[]) { HINTERNET hInternet; BOOL bResult; hInternet = InternetOpen( (LPCTSTR) "NoAgent", (DWORD) INTERNET_OPEN_TYPE_DIRECT, (LPCTSTR) NULL, (LPCTSTR) NULL, (DWORD) INTERNET_FLAG_ASYNC); if (hInternet == NULL) { DebugTest("hInternet == NULL"); } DebugTest("Internet handle created!"); bResult = InternetCloseHandle((HINTERNET) hInternet); if (bResult == NULL) { DebugTest("InternetCloseHandle((HINTERNET) hInternet) == NULL"); } return 0; }
Here is how DebugTest() defined :
C++ Syntax (Toggle Plain Text)
VOID DebugTest(CHAR * lpzsErrorText) { if (MessageBox(NULL, lpzsErrorText, "Error", MB_ICONERROR | MB_OKCANCEL)==IDCANCEL) { } } VOID DebugTest(INT nText) //Overloaded { CHAR lpzsErrorText[32]; _itoa(nText, lpzsErrorText, 10); if (MessageBox(NULL, lpzsErrorText, "Error", MB_ICONERROR | MB_OKCANCEL)==IDCANCEL) { } }
The error given :
•
•
•
•
------ Build started: Project: Internet, Configuration: Debug Win32 ------
Compiling...
Internet.cpp
Linking...
stdafx.obj : error LNK2005: "void __cdecl DebugTest(char *)" (?DebugTest@@YAXPAD@Z) already defined in Internet.obj
C:\Documents and Settings\Ahmed Han\Belgelerim\Visual Studio 2005\Projects\Internet\Debug\Internet.exe : fatal error LNK1169: one or more multiply defined symbols found
Build log was saved at "file://c:\Documents and Settings\Ahmed Han\Belgelerim\Visual Studio 2005\Projects\Internet\Debug\BuildLog.htm"
Internet - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Platform : WinXP Home
Compiler : VC++ 2005
Reason for error = ?
![]() |
Similar Threads
- Error msg ' Operation Aborted' when accessing some websites. (Web Browsers)
- "Catastrophic file transfer error" ?? (Windows NT / 2000 / XP)
- Error While Trying to Launch "URLRepair.reg" (Viruses, Spyware and other Nasties)
- Error loading "bridge.dll" (Viruses, Spyware and other Nasties)
- RUNDLL error "Bridge.dll" (Viruses, Spyware and other Nasties)
- error loading "Bridge.dll" (Windows 95 / 98 / Me)
Other Threads in the C++ Forum
- Previous Thread: Need Help in Reading characters from a text file
- Next Thread: urgent help!!!
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamic dynamiccharacterarray email encryption error file forms fstream function functions game getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






