Hello I am trying to compile my project using an additional library first I generate the compiled code of my program:
gcc -o programa.exe Dynamic.cpp
Then I add the library to my program:
g++ -o programa.exe Dynamic.o hook.o
But it shows me the following errors:
hook.o:hook.c:(.text+0xa2c): undefined reference to 'InitializeBuffer'
hook.o:hook.c:(.text+0xa7d): undefined reference to 'UninitializeBuffer'
hook.o:hook.c:(.text+0xb14): undefined reference to 'IsExecutableAddress'
hook.o:hook.c:(.text+0xb27): undefined reference to 'IsExecutableAddress'
hook.o:hook.c:(.text+0xb52): undefined reference to 'AllocateBuffer'
hook.o:hook.c:(.text+0xb7c): undefined reference to 'CreateTrampolineFunction'
hook.o:hook.c:(.text+0xca0): undefined reference to 'FreeBuffer'
hook.o:hook.c:(.text+0xd82): undefined reference to 'FreeBuffer'
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw
32/bin/ld.exe: hook.o: bad reloc address 0x13c in section '.rdata'
C:/Program Files/CodeBlocks/MinGW/bin/../lib/gcc/mingw32/4.9.2/../../../../mingw
32/bin/ld.exe: final link failed: Invalid operation
collect2.exe: error: ld returned 1 exit status
To solve it I need to link to the buffer library as I show in the capture attempt to do following the steps indicated but it did not work:
I recommend using msys or cmake since the codeblocks version is a bit old or updating it to a new version.