microsoft / Detours

Detours is a software package for monitoring and instrumenting API calls on Windows. It is distributed in source code form.
MIT License
5.28k stars 1.02k forks source link

contains invalid OMF record, type 0x21 (possibly COFF) #312

Open annenle100lesh opened 8 months ago

annenle100lesh commented 8 months ago

Describe the bug [ilink32 Error] Error: 'C:\USERS\USER\DESKTOP\MAIN\LIB\DETOURS.LIB' contains invalid OMF record, type 0x21 (possibly COFF) I using rad studio 12 version write code from C++ but i cannot using detours library i try coff2omf recorder but its not too work. if i using converting library haat1

i have error like this

Command-line test case



#include <iostream>
#include <windows.h>
#include "detours.h"
#include "pch.h"
#pragma comment(lib, "detours.lib")

int main2 (){

DetourTransactionBegin();
DetourUpdateThread(GetCurrentThread());
DetourAttach((PVOID*)&original_sub, hooked_sub);
DetourTransactionCommit();
}

**Detours version**
All versions i need your helps for rad studio using detours 
annenle100lesh commented 8 months ago

hata2

sylveon commented 8 months ago

https://stackoverflow.com/questions/17694860/linker-error-contains-invalid-omf-record

QianNangong commented 5 months ago

C++ Builder use OMF for legacy bcc compiler and ELF for legacy clang-based bccx compiler, they are not compatible with COFF used by MSVC and MinGW toolchains by default. You may switch to RAD Studio 12.1 and enable new clang compiler which does support COFF or recompile Detours using legacy bcc.