Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

freerdp build fails #5718

Closed
pfeatherstone opened this issue Aug 14, 2019 · 36 comments
Closed

freerdp build fails #5718

pfeatherstone opened this issue Aug 14, 2019 · 36 comments

Comments

@pfeatherstone
Copy link

pfeatherstone commented Aug 14, 2019

I ran: " MINGW_INSTALLS=mingw64 makepkg-mingw -sLf" inside the mingw-64-freerdp folder and got a whole host of errors relating to redeclarations. In my case the errors popped up in ntlm.c. I'm sure there are others.

Example:

C:/msys64/home/pf-windows-dev/MINGW-packages/mingw-w64-freerdp/src/FreeRDP-2.0.0-rc4/winpr/libwinpr/sspi/NTLM/ntlm.h:86:2: error: redeclaration of enumerator 'MsvAvDnsDomainName'
   86 |  MsvAvDnsDomainName,
      |  ^~~~~~~~~~~~~~~~~~
In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/sspi.h:10,
                 from C:/msys64/home/pf-windows-dev/MINGW-packages/mingw-w64-freerdp/src/FreeRDP-2.0.0-rc4/winpr/include/winpr/sspi.h:34,
                 from C:/msys64/home/pf-windows-dev/MINGW-packages/mingw-w64-freerdp/src/FreeRDP-2.0.0-rc4/winpr/libwinpr/sspi/NTLM/ntlm.c:25:
C:/msys64/mingw64/x86_64-w64-mingw32/include/ntsecapi.h:787:73: note: previous definition of 'MsvAvDnsDomainName' was here
  787 |     MsvAvEOL,MsvAvNbComputerName,MsvAvNbDomainName,MsvAvDnsComputerName,MsvAvDnsDomainName,MsvAvDnsTreeName,MsvAvFlags
      |                                                                         ^~~~~~~~~~~~~~~~~~
In file included from C:/msys64/home/pf-windows-dev/MINGW-packages/mingw-w64-freerdp/src/FreeRDP-2.0.0-rc4/winpr/libwinpr/sspi/NTLM/ntlm.c:33:
@sfhacker
Copy link

@pfeatherstone I have no idea about this command 'mingw64 makepkg-mingw -sLf' but freerdp builds fine here (MSYS/MinGW // GCC 8.3.0 x86_64) using (freerdp) master branch.

We used cmake to build freerdp from source (master branch).

You should try again using cmake command.

@pfeatherstone
Copy link
Author

@sfhacker The documentation for this github repository explains how to build mingw packages. https://github.com/msys2/MINGW-packages#documentation

@pfeatherstone
Copy link
Author

@sfhacker I should have added that this documentation details to use the command: "mingw64 makepkg-mingw -sLf" inside the folder MINGW-packages/mingw-w64-freerdp

@sfhacker
Copy link

@pfeatherstone It is working fine here. Perhaps your environment is broken or 'polluted' somehow.

Have you tried using cmake command?

image

...
...
image

Have you been able to fix the compilation errors? We don't see those errors in our MSYS/MINGW environment.

@Alexpux
Copy link
Member

Alexpux commented Aug 15, 2019

The problem maybe because we switch to Win7 target by default

@sfhacker
Copy link

@pfeatherstone You sound confused! Can you post the output of cmake command here?

@pfeatherstone
Copy link
Author

@sfhacker I think the confusion is that you're using MSYS version 1 with MINGW32. I'm using MSYS version 2 with MINGW64. The latter provides two environments: the MSYS2 environment and the MINGW64 environment. You get different behaviour when building in each one.

@sfhacker
Copy link

Our environment works fine. We build large projects on a daily basis (e.g. OpenLDAP, Heimdal Kerberos, FreeRADIUS, etc). But your environment seems broken. You should sort that out first.

@sfhacker
Copy link

I repeat myself: our env. works fine.
We have run out of ideas here! Perhaps you could try reinstalling your broken MSYS/MinGW envs or seek advice from someone with experience building apps on Windows.

image

@stahta01
Copy link
Contributor

stahta01 commented Aug 15, 2019

sfhacker: I think the confusion is that you're using MSYS version 1 with MINGW32. I'm using MSYS version 2 with MINGW64. The latter provides two environments: the MSYS2 environment and the MINGW64 environment. You get different behaviour when building in each one.

And, you are using the correct MSYS2 environment, right?

Tim S.

@stahta01
Copy link
Contributor

stahta01 commented Aug 15, 2019

@pfeatherstone I just duplicated the 64 bit build error; I will spend a hour or so trying to fix it.

Edit2: Trying to build 32 bit to see if that works.
Edit3: 32bit has build error

Tim S.

@pfeatherstone
Copy link
Author

The suspense is intense

@sfhacker
Copy link

At last someone knows what has to be done! We are mere beginners here!

@stahta01
Copy link
Contributor

stahta01 commented Aug 15, 2019

Going to build next without patch mingw-w64-redefinitions.patch.
Edit: Build failed even sooner without patch

I have decided the quickest solution is to edit mingw-w64-redefinitions.patch.

Tim S.

@stahta01
Copy link
Contributor

I am not making much progress; but, still trying for a short time in hope of making some progress.
Tim S.

@stahta01
Copy link
Contributor

stahta01 commented Aug 15, 2019

The problem is beyond me at this time.

Link to my work; no idea if the work is any good.
freerdp

Tim S.

@sfhacker
Copy link

We were able to build it from source without any patching to the MinGW runtime but to freerdp codebase. There are freerdp outstanding issues (compilation and linking) from last year. No one has cared to fix and merge them to master branch.

Anyway, thanks for your time on this issue.

@stahta01
Copy link
Contributor

@sfhacker where can the patches you used be found?

Tim S.

@Alexpux
Copy link
Member

Alexpux commented Aug 16, 2019

@stahta01 I think properly need to check __MINGW64_VERSION_MAJOR to not break old MINGW32 build

@pfeatherstone
Copy link
Author

So the MINGW32 build doesn't work for me either (when using MSYS2). Are there any major differences between MSYS and MSYS2? I thought it was just the pacman package manager introduced in MSYS2, which incidentally is what i'm using to install dependencies.

@Alexpux
Copy link
Member

Alexpux commented Aug 16, 2019

@pfeatherstone there are two different MINGW runtimes.
One from https://mingw.org and another from https://mingw-w64.org
Read https://sourceforge.net/p/mingw-w64/wiki2/History/

MINGW from mingw.org is outdated and not actively developed.

MSYS2 project use mingw-w64 runtime for 32 and 64 bit.

@pfeatherstone
Copy link
Author

I'm using mingw-w64 since that's what's shipped with MSYS2. Since neither the MINGW32 or the MINGW64 builds work and I have a working CYGWIN build (though much slower) and I'm running out of time, I will have to leave it at that.

I might look into a freerdp proxy server than runs on linux so I can apply my mods there and connect with rdesktop on windows.

@sfhacker
Copy link

There seems to be a lot of confusion and ignorance about certain projects. The same applies to CYGWIN, which does not produce native Windows binaries.
There are dozens of MSYS/MinGW binary distributions out there we could give them a try. The one we have been using for a long time works like a charm. We build large projects from source on a daily basis.
Regarding freerdp patches, there are outstanding compilation and linking issues reported last year. I believe patches should be merged into the main branch. Have a look at these issues: FreeRDP/FreeRDP#5026 FreeRDP/FreeRDP#5000

We can make the freerdp native Windows binaries (master branch) available to anyone. Just let us know.

@stahta01
Copy link
Contributor

stahta01 commented Aug 16, 2019

@sfhacker so was you lying when you said you patched freerdp in order to build it?
Or are you just never going to share the patches?
Or are you building the git master or some other branch?

Tim S.

@stahta01
Copy link
Contributor

Looks like sfhacker was likely building git master with patches.

Tim S.

@stahta01
Copy link
Contributor

stahta01 commented Aug 16, 2019

FreeRDP.zip

Added patches I used to compile FreeRDP using Mingw32 and Mingw64 prompts.
These patches were applied to git master.
I have not double checked these patches; like I normally do.

Used these commands to build
`cmake -G"MSYS Makefiles" -DCMAKE_C_COMPILER=$MINGW_PREFIX/bin/gcc.exe -DCMAKE_CXX_COMPILER=$MINGW_PREFIX/bin/g++.exe -DWITH_CLIENT=ON ..

make VERBOSE=1 -j1
`
Tim S.

@sfhacker
Copy link

I will test this right now!
Note that we produce MinGW Makefiles and native Windows binaries! I won't use the cmake command line proposed by you (@stahta01 )

@stahta01
Copy link
Contributor

stahta01 commented Aug 16, 2019

Note: I have no desire to use freerdp and I got it to build using changes copied from astrand mingw-part2 branch.

No idea if the patches make sense; I have no knowledge of FreeRDP code.

Tim S.

@pfeatherstone
Copy link
Author

@stahta01 Thank you! I will test on Monday

@stahta01
Copy link
Contributor

Found a possible code bug in freerdp; but, I have no idea which is wrong.

In file include/freerdp/server/rdpdr.h CreationTime and 5 others are of type UINT64 that maybe should be LARGE_INTEGER. MinGW64 has LARGE_INTEGER and Microsoft aggrees

I see no way to proceed on building the server code because I do not believe the freerdp is correct.

Tim S.

@stahta01
Copy link
Contributor

Decided the server code can not be built using MSys2 Mingw64 GCC.

Tim S.

@pfeatherstone
Copy link
Author

Above you mentioned you managed to build using mingw32 and mingw64. Do you mean you can’t hold using MSYS2 environment ?

@pfeatherstone
Copy link
Author

Build*

@stahta01
Copy link
Contributor

stahta01 commented Aug 19, 2019

Above you mentioned you managed to build using mingw32 and mingw64. Do you mean you can’t hold using MSYS2 environment ?

Using git master I can build using my git package under MSys2.
freerdp-git

Edit2: When you have a build issue on a package that is not msys2 package related.
It is easier and faster to build using mingw32 and mingw64; and, after that works you can be safe in trying msys2 package build. And, most if not all the remaining errors will be msys2 package related.

Tim S.

@stahta01
Copy link
Contributor

I am likely done working on this package; feel free to commit my work. I have no plans to do a pull-request.

@Biswa96
Copy link
Member

Biswa96 commented Aug 31, 2023

freerdp is available in mingw packages repository. See this page for more information https://packages.msys2.org/base/mingw-w64-freerdp

Though it requires some patches to workaround the build issues.

@Biswa96 Biswa96 closed this as completed Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants