MSVC build broken

Come here to discuss FileZilla and FTP in general

Moderator: Project members

Post Reply
Message
Author
gvanem
500 Command not understood
Posts: 3
Joined: 2020-07-02 11:40
First name: Gisle
Last name: Vanem

MSVC build broken

#1 Post by gvanem » 2020-07-02 12:40

Hello forum.

I'm trying to build FileZilla using MSVC-2019 (with .DLLs) and see that many class-functions
and data-members have __declspec(dllimport) in the wrong place.
E.g. in lib/libfilezilla/string.hpp after pre-processing:

Code: Select all

native_string __declspec(dllimport) to_native(std::string_view const& in);
This is not the same as:

Code: Select all

__declspec(dllimport) native_string to_native(std::string_view const& in);
MinGW and clang-cl seems to accept both. But it causes several link-failures with MSVC.

User avatar
botg
Site Admin
Posts: 33171
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: MSVC build broken

#2 Post by botg » 2020-07-02 13:16

What is the exact error message you are getting?

gvanem
500 Command not understood
Posts: 3
Joined: 2020-07-02 11:40
First name: Gisle
Last name: Vanem

Re: MSVC build broken

#3 Post by gvanem » 2020-07-03 10:33

botg wrote:
2020-07-02 13:16
What is the exact error message you are getting?
When linking FileZilla.exe with the import-library of libfilezilla-7.dll, I get several
errors like these:

Code: Select all

 error LNK2005: "public: __thiscall fz::buffer::buffer(void)" (??0buffer@fz@@QAE@XZ) already defined in FZengine.lib(controlsocket.obj)
 

gvanem
500 Command not understood
Posts: 3
Joined: 2020-07-02 11:40
First name: Gisle
Last name: Vanem

Re: MSVC build broken

#4 Post by gvanem » 2020-07-05 09:28

Anyway, I gave up on trying to build using -DFZ_USING_DLL.
I managed to get a working FileZilla with MSVC-x86. But clang-cl (my favourite compiler at the moment)
have many issues with event-macros like EVT_LIST_COL_CLICK().

A single file needed patching to work for x86. Namely libfilezilla/lib/util.cpp.
The diff for it is here: https://gist.github.com/gvanem/f96c20a1 ... 42c0d337b9

User avatar
botg
Site Admin
Posts: 33171
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse
Contact:

Re: MSVC build broken

#5 Post by botg » 2020-07-07 08:01

"FZengine.lib" That's not a file built by the provided workspace files.

Post Reply