Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help me #1

Open
arminblack opened this issue Jan 30, 2018 · 5 comments
Open

help me #1

arminblack opened this issue Jan 30, 2018 · 5 comments

Comments

@arminblack
Copy link

C:\Users\arminblack\Desktop\Memory>g++ Program.cpp -static -o Program.exe
In file included from Program.cpp:3:0:
Memory.hpp:2:22: fatal error: stdafx.hpp: No such file or directory
#include "stdafx.hpp"
^
compilation terminated.

@T-vK
Copy link
Owner

T-vK commented Jan 30, 2018

I used Visual C++ with precompiled headers to build it. That's why I had to use #include "stdafx.hpp".
It might work for you if you simply remove that line, but I'm not sure.

@T-vK
Copy link
Owner

T-vK commented Jan 30, 2018

Oh man, it looks like I'll have to make a few changes to the code in order to make it compile with g++.
I'll create a new branch with what I got so far tomorrow. I'm currently having an issue linking against psapi.lib, which seems to be called libpsapi.a in Cygwin and is located in /lib/w32api .
The #pragma comment(lib, "psapi") seems to be a Visual C++ thing.
In theory it should work somewhat like this:
g++ Program.cpp Memory.cpp -static -o Program.exe -llibpsapi

I don't know, maybe you know more than me.

@T-vK
Copy link
Owner

T-vK commented Jan 31, 2018

Created a new branch gcc. You can clone it with git clone -b gcc git://github.com/T-vK/Memory-Hacking-Class.git.

I tried: g++ -llibpsapi -o Example.exe Memory.cpp Example.cpp -static

Which results in:

/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/../../../../x86_64-pc-cygwin/bin/ld: cannot find -llibpsapi
collect2: error: ld returned 1 exit status

I tried to add the path to the lib using -L/lib/w32api and also by setting environment variables:

export LIBRARY_PATH=/lib/w32api
export LD_LIBRARY_PATH=/lib/w32api

The result is always the same.

@T-vK
Copy link
Owner

T-vK commented Jan 31, 2018

I managed to get it to compile:

g++ -o Example.exe Memory.cpp Example.cpp -lpsapi -static

Tell me if it works for you.

@T-vK
Copy link
Owner

T-vK commented Jan 31, 2018

I fixed some more bugs. It would be nice if you could try to compile and test Example2.cpp as described in here:
https://github.com/T-vK/Memory-Hacking-Class/tree/gcc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants