lwthiker / curl-impersonate

curl-impersonate: A special build of curl that can impersonate Chrome & Firefox
MIT License
3.45k stars 229 forks source link

Using precompiled libraries on arch linux #133

Open ghost opened 1 year ago

ghost commented 1 year ago

How do you setup your makefile and vscode project so you can successfully compile a program using the impersonate libraries. When compiling I get many compilation errors which are probably related to using boringssl with the library and openssl headers: makefile:

CXX=g++
CXXFLAGS= -I./ -L../ -Wno-multichar
LIBS=-lm -Wl,--no-as-needed -ldl -lpthread -l:libcurl-impersonate-chrome.a 

OUTDIR=./build
OBJDIR=$(OUTDIR)/obj

$(shell mkdir -p $(OBJDIR))

%.o: %.cpp
    $(CXX) -c -o $(OBJDIR)/$@ $< $(CXXFLAGS)

compiled: main.o
    $(CXX) -o $(OUTDIR)/$@ $(OBJDIR)/main.o $(CXXFLAGS) $(LIBS)

.PHONY: all
all: compiled

.DEFAULT_GOAL := all
clean:
    rm -rf $(OUTDIR)
here is my output: https://pastebin.com/3B2iF0vu (too big for github) my project file structure is as follows: L_ libcurl release files (linux x86_64)

L_ src folder with all code I have installed both libcurl-impersonate-bin and curl-impersonate-bin aurs

Any help is appreciated

(arch btw)

ghost commented 1 year ago

I'm assuming I didn't configure my makefile correctly to include all these headers

ghost commented 1 year ago

all help is appreciated, I've been trying to do this for a while so if you have just a suggestion please post it

lwthiker commented 1 year ago

It seems that the .a files are indeed not working properly - they are missing the dependencies (nghttp, boringssl, etc.). A workaround for now would be to use the .so files which do work, for example:

-L/path/to/libcurl-impersonate -lcurl-impersonate-chrome