-
Notifications
You must be signed in to change notification settings - Fork 442
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Linking with libpe-sieve.a fails (MinGW) #71
Comments
Uh, I think I got the solutionn wrong. If make sure that neither |
Thank you for reporting. I am currently very busy, but I will fix it as soon as I will get a bit free. |
I think the only missing piece is the script I used to fetch and build pe-sieve in the subdirectory #!/bin/sh
set -e
test -d _pe-sieve \
|| git clone --recurse-submodules https://github.com/hasherezade/pe-sieve _pe-sieve
cd _pe-sieve
cmake . \
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
-DCMAKE_SYSTEM_NAME=Windows-GNU \
-DPESIEVE_AS_STATIC_LIB=1
make -j4 |
With a freshly-checked-out pe-sieve (1fa2fd1) and libpeconv (8cbfef1d10e2d5cf05f81be101d050e9f0094693), I can confirm that However, it still cannot be linked against my little test porgram:
|
thanks for checking. it is weird because it managed to build Hollows Hunter using this script, and had no linking problems. can you share a script that you used for building your test app? I will keep trying... |
I'm running into the same issue. Here is a full script to reproduce the error: #!/bin/sh
set -e
set -x
git clone --depth=1 --recurse-submodules https://github.com/hasherezade/pe-sieve pe-sieve
cd pe-sieve
cmake . \
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
-DCMAKE_SYSTEM_NAME=Windows-GNU \
-DPESIEVE_AS_STATIC_LIB=1
# Second cmake call is necessary, otherwise make fails with
# make[2]: windres: No such file or directory
cmake .
make -j`nproc`
cat <<EOT > test.cpp
#include "pe_sieve_api.h"
int main() {
PEsieve_params pp = {0};
PESieve_scan(pp);
}
EOT
x86_64-w64-mingw32-g++ -I./include -L. -lpe-sieve test.cpp At the end, it fails with:
|
I figured it out, here is the full command line to link statically with MinGW for anyone else struggling: x86_64-w64-mingw32-g++ -DPESIEVE_STATIC_LIB=1 -I./include test.cpp -L. -L./libpeconv/libpeconv/ -lpe-sieve -llibpeconv -lpsapi -lntdll -lshlwapi -limagehlp |
Hi,
when trying to build this simple no-op program
t.c
……using this following Makefile…
…I get the following error:
Seems to me like
PESieve_scan
is not a visible symbol.Adding a
__declspec(dllexport)
toPESIEVE_API_FUNC
seems to fix the linker error, but I am not at all sure if this is the right way.(After that the linker complained about missing symbols from
-llibpeconv
and ultimately about missing symbols that could be resolved using-lpsapi -lntdll -lshlwapi
, but the main issue was the non-visiblePESieve_scan
symbol.)The text was updated successfully, but these errors were encountered: