CMake in Windows

Programmers discuss here anything related to FreeOrion programming. Primarily for the developers to discuss.

Moderator: Committer

Post Reply
Message
Author
dlshcbmuipmam
Space Krill
Posts: 2
Joined: Wed Feb 20, 2019 10:52 am

CMake in Windows

#1 Post by dlshcbmuipmam »

The current CMakeList contains script about Windows, but it is not working with either VC++ or MINGW. Therefore, I am trying to get freeorion works with CMake and MINGW. After some investigations, I managed to get freeorion compiled in my MINGW64 shell. Here is the modification I have made, based on v0.4.8:

https://github.com/dlshcbmuipmam/freeor ... af2a8d5223

Now, I can open the Freeorion.exe GUI, but the error "Timed out while attempting to connect to server" pops up when I click "Single Player" and "OK". Also, I get "Segmentation fault" when I try to open FreeorionD.exe.

Does anyone have any idea on the reason of this error?

If it is too difficult to debug, I will switch to investigate CMake with MSVC. I really hope that I don't have to rely on the full Visual Studio to manage the dependencies in Windows.

User avatar
Geoff the Medio
Programming, Design, Admin
Posts: 13586
Joined: Wed Oct 08, 2003 1:33 am
Location: Munich

Re: CMake in Windows

#2 Post by Geoff the Medio »

Could you make a pull request from this branch? There has been some recent attention to CMake for Windows. It would also be more helpful to base your changes off the latest master, rather than v0.4.8.

When running freeoriond, is there a log file generated before the segfault? Can you run it in a debugger or otherwise narrow down the error? Just "it crashes immediately" probably doesn't help much.

Are you also building all the dependencies with the same compiler as you're using to build FreeOrion itself?

Regarding Visual Studio, there shouldn't be much trouble managing dependencies, as they are all provided in the SDK, and the project should should already be set up to find them.

dlshcbmuipmam
Space Krill
Posts: 2
Joined: Wed Feb 20, 2019 10:52 am

Re: CMake in Windows

#3 Post by dlshcbmuipmam »

Geoff the Medio wrote: Wed Feb 20, 2019 1:12 pm Could you make a pull request from this branch? There has been some recent attention to CMake for Windows. It would also be more helpful to base your changes off the latest master, rather than v0.4.8.

When running freeoriond, is there a log file generated before the segfault? Can you run it in a debugger or otherwise narrow down the error? Just "it crashes immediately" probably doesn't help much.

Are you also building all the dependencies with the same compiler as you're using to build FreeOrion itself?

Regarding Visual Studio, there shouldn't be much trouble managing dependencies, as they are all provided in the SDK, and the project should should already be set up to find them.
Done (https://github.com/freeorion/freeorion/pull/2388). Since it is painful to use MinGW gdb debug ( the debug build complains about the object size and -big-obj doesn't work), I have decided to use Visual Studio, and the FreeorionSDK. Now the Freeorion.exe can be compiled by first generating the FreeOrion.sln project, then use Visual Studio to compile the project. The segmentation fault disappear and at least FreeOrionD.exe doesn't crash.

I still can't start a game though due exactly the same reason above. I guess it is because of some communication misconfigurations between the server and the client. I am new to the freeorion project so I have no idea on how this can be fixed. I will try to investigate this, but it would be helpful if there is any suggestion from any more experienced developer.

Post Reply