小编woa*_*guy的帖子

在Windows版Linux下与mingw32交叉编译时链接libcurl

我已经使用mingw32编译了libcurl,并且正在尝试使用mingw32在我的Linux机器上为Windows系统将其与程序链接。

我输出了文件libcurl-4.dll libcurl.a libcurl.la libcurl.lai。

我已经将它们包含在我的mingw32 libs文件夹中,位于:/ usr / x86_64-w64-mingw32 / lib

我能够找到其他一些与libstdc ++和libgcc链接的主题,以在执行时注意依赖项错误,但是当尝试添加libcurl.a时,它将无法编译。

我使用了以下内容:

$ x86_64-w64-mingw32-g++ main.cpp -o hello.exe -static-libgcc -static-libstdc++ -static "/usr/x86_64-w64-mingw32/lib/libcurl.a" -lpthread
Run Code Online (Sandbox Code Playgroud)

但是,我无法使用libcurl.a并继续收到这些错误。

/tmp/ccIceRus.o:main.cpp:(.text+0xde): undefined reference to `__imp_curl_easy_init'
/tmp/ccIceRus.o:main.cpp:(.text+0x106): undefined reference to `__imp_curl_easy_setopt'
/tmp/ccIceRus.o:main.cpp:(.text+0x122): undefined reference to `__imp_curl_easy_setopt'
/tmp/ccIceRus.o:main.cpp:(.text+0x13e): undefined reference to `__imp_curl_easy_setopt'
/tmp/ccIceRus.o:main.cpp:(.text+0x159): undefined reference to `__imp_curl_easy_setopt'
/tmp/ccIceRus.o:main.cpp:(.text+0x169): undefined reference to `__imp_curl_easy_perform'
/tmp/ccIceRus.o:main.cpp:(.text+0x180): undefined reference to `__imp_curl_easy_strerror'
/tmp/ccIceRus.o:main.cpp:(.text+0x197): undefined reference to `__imp_curl_easy_cleanup'
/usr/bin/x86_64-w64-mingw32-ld: /tmp/ccIceRus.o: bad reloc address 0x80 in section `.xdata'
collect2: error: ld returned 1 …
Run Code Online (Sandbox Code Playgroud)

c++ linux linker libcurl mingw-w64

5
推荐指数
1
解决办法
1941
查看次数

如何使用JSoup获得隐藏的输入值?

我有资料

<input name="authenticity_token" type="hidden" value="aiUlw1Yh4W47lPQearSEdTkU0rhKpziZOweq5PMTV0Q=" />
Run Code Online (Sandbox Code Playgroud)

我正在尝试通过Jsoup选择它。

 Element input = doc.select("input[name=authenticity_token]").first();

 String auth_token = input.attr("value");
Run Code Online (Sandbox Code Playgroud)

但这不起作用。

我在字符串auth_token =处收到空指针异常。

Crime.ic.Main.main上的java.lang.NullPointerException(Main.java:2)

我究竟做错了什么?

java jsoup

5
推荐指数
1
解决办法
1974
查看次数

标签 统计

c++ ×1

java ×1

jsoup ×1

libcurl ×1

linker ×1

linux ×1

mingw-w64 ×1