| | |
"already defined" error
Please support our C++ advertiser: Programming Forums - DaniWeb Sister Site
![]() |
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!!!
Views: 5560 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
6 api application array arrays assignment based beginner binary c++ c/c++ calculator char char* class classes code coding compile compiler console conversion convert count data database delete developer display dll dynamiccharacterarray email encryption error file format forms fstream function functions game generator givemetehcodez graph iamthwee ifstream image input int java lib list loop looping loops map math matrix memory multidimensional multiple newbie news number numbertoword output pointer problem program programming project python random read recursion recursive reference return rpg search sort sorting string strings struct template templates text tree url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






