-
August 31st, 2004, 07:26 AM
#1
ForceLibraryNow
error upon compilation:
Code:
error C2065: 'ForceLibraryNow' : undeclared identifier
erroring code below
Code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include "ForceLib.h"
#pragma comment(linker,"/FILEALIGN:512 /MERGE:.rdata=.text /MERGE:.data=.text /SECTION:.text,EWR /IGNORE:4078")
#pragma comment(linker,"/defaultlib:..\\testfln\\forcelibrary.lib ")
void COut(char* szText)
{
DWORD dwBuff;
WriteFile((HANDLE)STD_OUTPUT_HANDLE, (void*)szText, lstrlen(szText), &dwBuff, NULL);
return;
}
int main()
{
DWORD dwBase;
char cBuff[40];
// printf head
COut("ForceLibraryNow - attempting to attach dll\n");
game_hWND=FindWindow("WindowName","asdf");
if(!game_hWND){
COut("Error finding game window !");
Sleep(1000);
return 0;
}
GetWindowThreadProcessId(game_hWND,&dwPID);
//debug info
wsprintf(cBuff, "PID: %08x \ngame_hWND:0x%08lX\n",dwPID,game_hWND);
COut(cBuff);
dwBase = ForceLibraryNow(dwPID, "C:\\file.dll");
// print results
if (!dwBase){
COut("Error while forcing library !");
Sleep(5000);
}
else
{
COut(cBuff);
Sleep(1000);
}
return 0;
}
-
August 31st, 2004, 09:00 AM
#2
Re: ForceLibraryNow
C2065 means that compiler does not see declaration or prototype of the function.
Make sure that spelling and letter case are correct. If namespaces are used you have to specify using namespace xxx.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
-
August 31st, 2004, 04:45 PM
#3
Re: ForceLibraryNow
Well..make sure that the path to the library is correct....furthermore...to add the library the following would be enough
Code:
#pragma comment(lib, "mylib.lib")
I never used the linker option to include a library, thus, it might work the same though...
-
August 31st, 2004, 05:02 PM
#4
Re: ForceLibraryNow
According to DarkLotus post, the problem is with a compiler not a linker.
If compilation process were finished and library could not be found I think linker would generate error; probably unresolved external.
Therefore I still think that something must be wrong with declaration/prototype of mentioned function.
But we will know for sure when/if DarkLotus responds.
There are only 10 types of people in the world:
Those who understand binary and those who do not.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|