Так лезет ошибка c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lpython39
collect2.exe: error: ld returned 1 exit status
Если же изменить -L C:\Python39\Lib -l python39 на -L C:\Python39\libs -l python39, лезет такая же ошибка, как и в исходном вопросе
Но появилась новая проблема, при компиляции вылетает такая ошибка:
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\user\AppData\Local\Temp\ccZPEkMr.o:first_test.c:(.text+0xf): undefined reference to `_imp__Py_Initialize'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\user\AppData\Local\Temp\ccZPEkMr.o:first_test.c:(.text+0x25): undefined reference to `_imp__PyRun_SimpleStringFlags'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: C:\Users\user\AppData\Local\Temp\ccZPEkMr.o:first_test.c:(.text+0x2c): undefined reference to `_imp__Py_Finalize'
collect2.exe: error: ld returned 1 exit status
А, я понял, в headers стоит csrf-token и ajax-token, которые видимо на то и нацелены, чтобы ботов не допускать, видимо на этом сайте будет работать только при заходе на него, либо селеном, что мне не подходит из-за медленной скорости, либо чем-нибудь вроде phantomjs
In file included from c:\python39\include\pystate.h:143,
from c:\python39\include\genobject.h:11,
from c:\python39\include\python.h:123,
from first_test.c:3:
c:\python39\include\cpython/pystate.h:9:10: fatal error: cpython/initconfig.h: No such file or directory
9 | #include "cpython/initconfig.h"
| ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Сам файл Python.h он находит
include я пытался делать просто обозначением файла, пишет не найден файл в директории
Да, я из-под windows, использую компилятор mingw, команда g++ file.c -o file.exe
Весь трейсбек скину утром
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=c:/mingw/bin/../libexec/gcc/mingw32/9.2.0/lto-wrapper.exe
Target: mingw32
Configured with: ../src/gcc-9.2.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-static --enable-shared --enable-threads --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --enable-libgomp --disable-libvtv --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --disable-build-format-warnings --prefix=/mingw --with-gmp=/mingw --with-mpfr=/mingw --with-mpc=/mingw --with-isl=/mingw --enable-nls --with-pkgversion='MinGW.org GCC Build-2'
Thread model: win32
gcc version 9.2.0 (MinGW.org GCC Build-2)
COLLECT_GCC_OPTIONS='-I' 'C:\Python39\include' '-LC:\Python39\Lib' '-o' 'app.exe' '-Wextra' '-v' '-shared-libgcc' '-mtune=generic' '-march=i586'
c:/mingw/bin/../libexec/gcc/mingw32/9.2.0/cc1plus.exe -quiet -v -I C:\Python39\include -iprefix c:\mingw\bin\../lib/gcc/mingw32/9.2.0/ app.c -quiet -dumpbase app.c -mtune=generic -march=i586 -auxbase app-Wextra -version -o C:\Users\user\AppData\Local\Temp\ccP51HWy.s
GNU C++14 (MinGW.org GCC Build-2) version 9.2.0 (mingw32)
compiled by GNU C version 9.2.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.21-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "c:\mingw\bin\../lib/gcc/mingw32/9.2.0/../../../../mingw32/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/9.2.0/include/c++"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/9.2.0/include/c++/mingw32"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/9.2.0/include/c++/backward"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/9.2.0/include"
ignoring duplicate directory "/mingw/lib/gcc/mingw32/9.2.0/../../../../include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/9.2.0/include-fixed"
ignoring nonexistent directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/9.2.0/../../../../mingw32/include"
ignoring duplicate directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
C:\Python39\include
c:\mingw\bin\../lib/gcc/mingw32/9.2.0/include/c++
c:\mingw\bin\../lib/gcc/mingw32/9.2.0/include/c++/mingw32
c:\mingw\bin\../lib/gcc/mingw32/9.2.0/include/c++/backward
c:\mingw\bin\../lib/gcc/mingw32/9.2.0/include
c:\mingw\bin\../lib/gcc/mingw32/9.2.0/../../../../include
c:\mingw\bin\../lib/gcc/mingw32/9.2.0/include-fixed
End of search list.
GNU C++14 (MinGW.org GCC Build-2) version 9.2.0 (mingw32)
compiled by GNU C version 9.2.0, GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version isl-0.21-GMP
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: cb31672760a9c1b42d1ddb86616116cd
COLLECT_GCC_OPTIONS='-I' 'C:\Python39\include' '-LC:\Python39\Lib' '-o' 'app.exe' '-Wextra' '-v' '-shared-libgcc' '-mtune=generic' '-march=i586'
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/as.exe -v -I C:\Python39\include -o C:\Users\user\AppData\Local\Temp\ccFlcsRR.o C:\Users\user\AppData\Local\Temp\ccP51HWy.s
GNU assembler version 2.32 (mingw32) using BFD version (GNU Binutils) 2.32
COMPILER_PATH=c:/mingw/bin/../libexec/gcc/mingw32/9.2.0/;c:/mingw/bin/../libexec/gcc/;c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/
LIBRARY_PATH=c:/mingw/bin/../lib/gcc/mingw32/9.2.0/;c:/mingw/bin/../lib/gcc/;c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/lib/;c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../
COLLECT_GCC_OPTIONS='-I' 'C:\Python39\include' '-LC:\Python39\Lib' '-o' 'app.exe' '-Wextra' '-v' '-shared-libgcc' '-mtune=generic' '-march=i586'
c:/mingw/bin/../libexec/gcc/mingw32/9.2.0/collect2.exe -plugin c:/mingw/bin/../libexec/gcc/mingw32/9.2.0/liblto_plugin-0.dll -plugin-opt=c:/mingw/bin/../libexec/gcc/mingw32/9.2.0/lto-wrapper.exe -plugin-opt=-fresolution=C:\Users\user\AppData\Local\Temp\cc9duPsO.res -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32 -plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmoldname -plugin-opt=-pass-through=-lmsvcrt -Bdynamic -u ___register_frame_info -u ___deregister_frame_info -o app.exe c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../crt2.o c:/mingw/bin/../lib/gcc/mingw32/9.2.0/crtbegin.o -LC:\Python39\Lib -Lc:/mingw/bin/../lib/gcc/mingw32/9.2.0 -Lc:/mingw/bin/../lib/gcc -Lc:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/lib -Lc:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../.. -lpython39 C:\Users\user\AppData\Local\Temp\ccFlcsRR.o -lstdc++ -lmingw32 -lmingwex -lmingw32 -lmingwex -lgcc_s -lgcc -lmoldname -lmsvcrt -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lmingwex -lmingw32 -lmingwex -lgcc_s -lgcc -lmoldname -lmsvcrt c:/mingw/bin/../lib/gcc/mingw32/9.2.0/crtend.o
c:/mingw/bin/../lib/gcc/mingw32/9.2.0/../../../../mingw32/bin/ld.exe: cannot find -lpython39
collect2.exe: error: ld returned 1 exit status