[Linker Fatal Error] Fatal: Unable to open file 'WINDOWS.OBJ
-
- Posts: 12
- Joined: Fri Jul 09, 2004 2:09 pm
- Location: China
- Contact:
[Linker Fatal Error] Fatal: Unable to open file 'WINDOWS.OBJ
C++Builder 6
Uncheck Build with rumtime packages.
Uncheck Build with rumtime packages.
-
- Posts: 12
- Joined: Fri Jul 09, 2004 2:09 pm
- Location: China
- Contact:
Code: Select all
#include <madCodeHook.hpp>
#include <madRemote.hpp>
#pragma comment(lib, "madCodeHook_.lib")
#pragma comment(lib, "madRemote_.lib")
...
-
- Posts: 12
- Joined: Fri Jul 09, 2004 2:09 pm
- Location: China
- Contact:
yes.madshi wrote:You don't need the pragma links. Using that #include is enough. Does the problem still occur when using #include only?
I find text "WINDOWS.OBJ" in file madCodeHook.obj, but can't find file "WINDOWS.OBJ" in any directory. I add $(BCB)\Source\Windows.pas to the project, OK, but another error occured:
Code: Select all
[Linker Fatal Error] Fatal: Unable to open file 'SYSTEM.OBJ'
Code: Select all
[Pascal Error] pasall.tmp(4): Identifier redeclared: 'system'
-
- Posts: 12
- Joined: Fri Jul 09, 2004 2:09 pm
- Location: China
- Contact:
-
- Posts: 12
- Joined: Fri Jul 09, 2004 2:09 pm
- Location: China
- Contact:
Oh, when using #include only:madshi wrote:You don't need the pragma links. Using that #include is enough. Does the problem still occur when using #include only?
Code: Select all
[Linker Error] Unresolved external '__stdcall Madcodehook::AmSystemProcess()' referenced from D:\PROGRAM FILES\BORLAND\CBUILDER6\PROJECTS\UNIT1.OBJ
-
- Posts: 12
- Joined: Fri Jul 09, 2004 2:09 pm
- Location: China
- Contact:
madshi wrote:I've tested it again. With runtime packages you don't need the #pragma stuff. But not using runtime packages you need to add this:
#pragma link "madCodeHook.obj"
Code: Select all
[Linker Fatal Error] Fatal: Unable to open file 'WINDOWS.OBJ'
-
- Posts: 12
- Joined: Fri Jul 09, 2004 2:09 pm
- Location: China
- Contact:
-
- Posts: 12
- Joined: Fri Jul 09, 2004 2:09 pm
- Location: China
- Contact:
Finally got BCB6 (enterprise edition) now. Created a new project, added a button to the main form. Double clicked it. Added this to the OnClick event:
Got this error, of course:
[C++ Error] Unit1.cpp(23): E2268 Call to undefined function 'AmSystemProcess'
Added:
Compiled and linked fine. Unchecked "runtime packages" from the project options. Recompiled. Got the error:
[Linker Error] Unresolved external '__stdcall Madcodehook::AmSystemProcess()' referenced from C:\DESKTOP\BCB6TEST\UNIT1.OBJ
Added:
Compiled, linked and run fine. So I can't see anything wrong.
Here's the final full code:
Code: Select all
void __fastcall TForm1::Button1Click(TObject *Sender)
{
AmSystemProcess();
}
[C++ Error] Unit1.cpp(23): E2268 Call to undefined function 'AmSystemProcess'
Added:
Code: Select all
#include <madCodeHook.hpp>
[Linker Error] Unresolved external '__stdcall Madcodehook::AmSystemProcess()' referenced from C:\DESKTOP\BCB6TEST\UNIT1.OBJ
Added:
Code: Select all
#pragma link "madCodeHook"
Here's the final full code:
Code: Select all
//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
#include <madCodeHook.hpp>
#pragma link "madCodeHook"
void __fastcall TForm1::Button1Click(TObject *Sender)
{
AmSystemProcess();
}
//---------------------------------------------------------------------------