Guild icon
Teeworlds
discord.gg/teeworlds / development
For discussions around the development of the official Teeworlds
Between 2020-09-11 00:00:00Z and 2020-09-12 00:00:00Z
Avatar
I think a rewrite like this is the only sane way to approach this, the textrendering is mostly beyond salvaging
Avatar
Hey all, just curious, what version of C++ are you using for development?
Avatar
C++03
Avatar
Hmmm ok, I can't seem to select that in my IDE lul. Would higher versions of C++ still work?
Avatar
Yeah, it's only been 17 years... Syntax-wise it should still be fine. Just be sure to stick to C++03 features if you want to contribute to vanilla
Avatar
Makes sense! Thank you!
17:32
Also, does anyone have experience compiling teeworlds on Windows with MinGW & CMake?
Avatar
That's usually not a good idea
18:11
It's a mess
Avatar
@NPK what have you tried?
18:31
got aerror messages?
Avatar
Lol, @Dune what would you recommend for Windows? I really hate Visual Studio, but I'll give it a shot if it's the only viable way.
Avatar
maybe you're mixing it up with the IDE? you don't have to install the whole thing
Avatar
with msys2 it can probably done like on linux (https://www.msys2.org/)
Avatar
Yea, I'm using a different IDE for looking at the code, but I saw that you could also build it with VisualStudio and CMake.
18:53
Oh ok.
Avatar
which IDE do you use?
Avatar
I don't use Visual Studio most of the time, and when I do I don't use it to build. They're separate things
Avatar
Oh nevermind it just built with CMake and MinGW
Avatar
nice 😉
Avatar
I use Jetbrains CLion
Avatar
ah yea, that one also has cmake integration
Avatar
oh, the guide has Visual Studio & CMake and MSVC build tools & bam, so it's not obvious that you can build with CMake & MSVC build tools 🙂
Avatar
mingw doesn't build 64bit afaik
Avatar
ddnet does all releases with mingw, including 64bit windows
Avatar
oh? nvm then
Avatar
I'm able to configure the build with CMake, but I'm a huge C++ noob, so I don't know where the executables are. I setup CMake to put the artifacts in teeworlds/build
18:58
Thanks for listening to me rant btw.
Avatar
afaik the executables are always in build or a subfolder thereof
Avatar
Right, do you happen know what the executables are called though?
Avatar
teeworlds, teeworlds_srv
Avatar
I don't see anything that stands out as an executable
19:01
Oh ok
Avatar
.exe on win
19:03
Hmmm, yea all I see is a.exe, I feel like I'm butchering this haha.
Avatar
it sounds like something went wrong
Avatar
did you do the build yet?
19:05
can you share some output?
Avatar
r u using mingw32?
Avatar
Download MinGW-w64 - for 32 and 64 bit Windows for free. A complete runtime environment for gcc. The mingw-w64 project is a complete runtime environment for gcc to support binaries native to Windows 64-bit and 32-bit operating systems.
19:06
mingw32 makes problems
Avatar
I can share my screen, might be easier.
19:06
Oh ok
Avatar
if i remember correctly mingw64 has some kind of packet manager, so you might need to install libs that teeworlds requires
Avatar
Yea, I did that as specified in the README for the mingw32 setup.
19:10
Installing MinGW-w64
Avatar
it can also compile 64bit which might be in your favour anyway 😄
Avatar
Yea, it would haha
19:11
19:12
Avatar
have u run the mingw-make in the build dir btw?
Avatar
Let me try that.
19:19
I'm guessing I have to do this in command prompt? Or can I do this in Cygwin?
Avatar
if it has a shell or smth.. msys64 has a shell which you can run in the folder
19:23
Yea, I don't see *.shell, *.smth or msys64 in my project. Trying to install mingw packages with Cygwin.
19:23
Avatar
its probably already there
19:24
can you press windows key and search for msys?
19:24
or shell
19:24
else it might also work with your CMD, you just need the make path
19:25
Can't find msys with the windows search bar, or shell apart from Command Prompt.
Avatar
ok dunno what cygwin installs then
Avatar
Hopefully mingw-make lul (edited)
Avatar
i mean you can just look in the cygwin installation path cant u?
Avatar
or mingw64-make
19:28
Yea, the way you install packages with Cygwin is through the setup-x86_64 (installer)
19:29
Avatar
mh i only used msys2, that was pretty ez there, so dunno
19:31
https://www.msys2.org/ is has mingw64 support aswell
19:31
Sure, I'll check it out.
Avatar
XD
19:32
wait i'll check it out, bcs smone else had a problem with it too
19:40
So would I just run it like this in msys2? jonmg_000@NPHard MSYS /d/Documents/teeworlds/build $ /mingw64.exe .
Avatar
yes should work
Avatar
Hmm, would that build teeworlds.exe and teeworlds_srv.exe?
Avatar
probs both
Avatar
Ok, because I don't see either.
Avatar
so you have a msys shell open in the dir?
19:42
./mingw64-make.exe -j10
Avatar
jonmg_000@NPHard MSYS /d/Documents/teeworlds/build $ /mingw64-make.exe -j10 bash: /mingw64-make.exe: No such file or directory
Avatar
ok i dunno how the make file is called wait
19:46
jonmg_000@NPHard MSYS /d/Documents/teeworlds/build $ ls /mingw64 bin etc include lib share jonmg_000@NPHard MSYS /d/Documents/teeworlds/build $ ls /mingw64/bin jonmg_000@NPHard MSYS /d/Documents/teeworlds/build $ ls /mingw64/lib jonmg_000@NPHard MSYS /d/Documents/teeworlds/build $ ls /mingw64/etc config.site
Avatar
pacman -S make
19:49
i remember having it running as a gui, dunno if they removed it or if i am blind xD
19:49
might also need to install gcc then
Avatar
Oh haha, well I think it's working!
19:50
Well it did something anyway
19:53
Avatar
now the shell should be able to accept make
19:54
just cd to the project
Avatar
Yea, I'm in the build folder. What should I run? /make ?
Avatar
just make -j20
Avatar
jonmg_000@NPHard MSYS /d/Documents/teeworlds/build $ make -j20 Microsoft Windows [Version 10.0.18362.1082] (c) 2019 Microsoft Corporation. All rights reserved. D:\Documents\teeworlds\build>
19:56
Brought me to a new shell lul (edited)
Avatar
oh thats strange
Avatar
haha 😛 (edited)
Avatar
you know what, you can also just install cmake and run it in terminal
20:01
Avatar
the question is just, if that still uses the old mingw32
20:02
i dunno how your PATH looks like now
20:04
Avatar
mingw/bin is prettyy high
Avatar
yea, let me check that out
Avatar
but normally after u used the cmake gui it should start, even if the make is from somewhere else
20:08
bcs the compiler etc. is set
Avatar
Yea, I just don't know how to setup the options for CMake in the terminal or via vim for that matter.
20:10
Just figured the CMake UI would generate the teeworld.exe and/or the teeworld_srv.exe, regardless if it were 32 or 64 bit.
Avatar
@NPK the cmake UI does not start the build process
20:11
the cmake UI only creates the files necessary for starting it
20:11
e.g. a MSVS project, or mingw makefiles
20:12
Hmmm, so I'll run the UI and then run mingw again?
Avatar
Alright, I have to step away, but hopefully I can figure this out. Thanks for all the help!
Avatar
seems like mingw64 is broken rn, get an internal compiler error on linux and with the mingw setup
20:40
pacman -S mingw-w64-x86_64-gcc pacman -S mingw-w64-x86_64-SDL2 pacman -S mingw-w64-x86_64-freetype pacman -S mingw-w64-x86_64-cmake pacman -S mingw-w64-x86_64-make cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=1 make -j20
20:40
worked
20:40
except the compilation error, on linux 32 bit works rn
20:42
so probs on windows too, hope that help @NPK for 32 bit testing you have to replace x86_64 with i686 in the package names also you have to start as mingw path C:\msys64\mingw32{64}.exe
Avatar
@Deleted User , with cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=1, what do you have set for CMAKE_MAKE_PROGRAM?
Avatar
the mingw path has a make program so i didnt set it
Avatar
progress using cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=1 -DCMAKE_MAKE_PROGRAM:PATH=/cygdrive/c/msys64/mingw64.exe
21:05
seems like it's missing dependencies.
21:06
How would I resolve those? (edited)
Avatar
how did you download teeworlds?
21:06
via git?
Avatar
git submodule update --init
Avatar
cmake should be able to configure without languages and maps i think?
Avatar
jonmg_000@NPHard MINGW64 /d/Documents/teeworlds (master) $ git submodule update --init Submodule 'datasrc/languages' (git://github.com/teeworlds/teeworlds-translation.git) registered for path 'datasrc/languages' Submodule 'datasrc/maps' (git://github.com/teeworlds/teeworlds-maps.git) registered for path 'datasrc/maps' Cloning into 'D:/Documents/teeworlds/datasrc/languages'... Cloning into 'D:/Documents/teeworlds/datasrc/maps'... Submodule path 'datasrc/languages': checked out '4ed69dd7497ca6e04bab0b042f137bf97f3c5d0a' Submodule path 'datasrc/maps': checked out '1d3401a37a3334e311faf18a22aeff0e0ac9ee65' jonmg_000@NPHard MINGW64 /d/Documents/teeworlds (master) $ git submodule update --init
Avatar
sounds like he's missing teeworlds-libs
21:09
do you have python installed
21:10
python 3 more specifically
Avatar
I have installed on my desktop generally, but I'm thinking that I may need to update Cygwin with that.
21:10
Cygwin doesn't have git setup correctly either.
Avatar
well the thing i posted worked with msys2
21:11
i tested it
Avatar
try to make python available in your Cygwin's path i guess
Avatar
Yea, for some reason msys2 doesn't recognize cmake as a command.
Avatar
there's a python script that downloads dependency which can fail when running cmake if you don't have python.
Avatar
you have to open C:\msys64\mingw32{64}.exe
Avatar
but i'm not sure if cygwin needs the libs?
Avatar
there are more paths in the setup
21:16
Weird, C:\msys64\mingw64.exe doesn't recognize cmake either
Avatar
have u installed the packages above?
Avatar
ah, you mean all those pacman commands? No not in msys2, let me do that.
Avatar
you can also execute them in msys
21:18
ah yeah
21:19
i know its a bit complicated, i dunno what changed, it was really easy in the past
Avatar
Haha, yea it's ok. I want to document this in the README though for sure.
Avatar
Hmm I'm still missing some of those dependencies that should have been setup with pacman. $ cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=1 -- Selecting Windows SDK version to target Windows 10.0.18362. -- Could NOT find Crypto (missing: CRYPTO_LIBRARY CRYPTO_INCLUDEDIR) -- Could NOT find GTest (missing: GTEST_LIBRARY GTEST_INCLUDE_DIR GTEST_MAIN_LIBRARY) -- ******** Teeworlds ******** -- Target OS: windows 32bit -- Compiler: C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe -- Build type: Release -- Dependencies: -- * Freetype not found (using bundled version) -- * OpenSSL Crypto not found -- * Pnglite not found (using bundled version) -- * PythonInterp found -- * SDL2 not found (using bundled version) -- * Wavpack not found (using bundled version) -- * Zlib not found (using bundled version) -- Automatically downloading GTest to be able to run tests CMake Error: Error: generator : Visual Studio 14 2015 Does not match the generator used previously: MinGW Makefiles Either remove the CMakeCache.txt file and CMakeFiles directory or choose a different binary directory. CMake Warning at CMakeLists.txt:437 (message): CMake step for googletest failed: 1 -- Configuring done -- Generating done -- Build files have been written to: D:/Documents/teeworlds/build
Avatar
u need to cleanup your build dir
21:29
just remove it and create it new
21:29
or remove everything containing cmake
Avatar
ah wait it also sets msvc as compiler?
21:30
you can control the generator with -G in cmake
Avatar
so clean build dir cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=1 -G"MinGW Makefiles" smth like that (edited)
21:35
Lul
21:35
$ make -j20 Microsoft Windows [Version 10.0.18362.1082] (c) 2019 Microsoft Corporation. All rights reserved. D:\Documents\teeworlds\build>
Avatar
mhh is there some make addon for vs?
21:37
maybe its somehow called before the mingw's make
21:38
what does ls -l /
Avatar
maybe you can try /mingw64/bin/make
21:42
or whereis make
Avatar
jonmg_000@NPHard MINGW64 /d/Documents/teeworlds/build $ /mingw64/bin/make -j20 -bash: /mingw64/bin/make: No such file or directory jonmg_000@NPHard MINGW64 /d/Documents/teeworlds/build $ whereis make make: /usr/bin/make.exe /usr/share/man/man1/make.1.gz /usr/share/info/make.info-1.gz /usr/share/info/make.info-2.gz /usr/share/info/make.info.gz
Avatar
ok that looks like the right path, then for some reason vs is overwriting the gcc compiler
21:45
if you have vs, why dont u just do it with vs? 😄
21:46
ok.. do ls -l mingw64/bin
21:46
cant be that hard to force gcc
Avatar
oh my that's a big list
Avatar
is there a x86_64-w64-mingw-gcc?
21:49
something with gcc in the end
Avatar
... -rwxr-xr-x 1 jonmg_000 jonmg_000 36022 Jan 17 2018 x86_64-w64-mingw32-agrep.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 2208014 Jul 24 00:41 x86_64-w64-mingw32-c++.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 489984 Feb 17 2020 x86_64-w64-mingw32-captoinfo.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 348160 Feb 17 2020 x86_64-w64-mingw32-clear.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 64176 Jun 26 02:21 x86_64-w64-mingw32-deflatehd.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 2208014 Jul 24 00:41 x86_64-w64-mingw32-g++.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 2205454 Jul 24 00:41 x86_64-w64-mingw32-gcc.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 2205454 Jul 24 00:41 x86_64-w64-mingw32-gcc-10.2.0.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 67861 Jul 24 00:41 x86_64-w64-mingw32-gcc-ar.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 67861 Jul 24 00:41 x86_64-w64-mingw32-gcc-nm.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 67861 Jul 24 00:41 x86_64-w64-mingw32-gcc-ranlib.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 59734 Jun 26 02:21 x86_64-w64-mingw32-inflatehd.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 462848 Feb 17 2020 x86_64-w64-mingw32-infocmp.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 489984 Feb 17 2020 x86_64-w64-mingw32-infotocap.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 669355 Mar 21 2017 x86_64-w64-mingw32-pkg-config.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 356352 Feb 17 2020 x86_64-w64-mingw32-reset.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 348160 Feb 17 2020 x86_64-w64-mingw32-tabs.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 489984 Feb 17 2020 x86_64-w64-mingw32-tic.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 409600 Feb 17 2020 x86_64-w64-mingw32-toe.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 355328 Feb 17 2020 x86_64-w64-mingw32-tput.exe -rwxr-xr-x 1 jonmg_000 jonmg_000 356352 Feb 17 2020 x86_64-w64-mingw32-tset.exe ...
Avatar
ok
21:50
then try clean your build dir again then CC="x86_64-w64-mingw32-gcc.exe" CXX="x86_64-w64-mingw32-g++.exe" cmake .. -DCMAKE_LEGACY_CYGWIN_WIN32=1
21:50
cmake should then say Compiler: .../mingw-gcc.exe
Avatar
and if that doesnt work i dunno xD
21:52
maybe we need to include the /mingw64/bin after CC=" and CXX="?
Avatar
normally pressing mingw64.exe will set the path to that directory
21:53
for me it did
Avatar
yeah sry, i honestly dunno what is broken in your setup i can just say: after installing msys i downloaded that packages closed the msys shell again opened the mingw64.exe tried the cmake command got an internal compiler error switched to linux got it there too with crosscompiling tried 32bit on linux, worked
21:58
Well thanks for helping, I've learned a lot 🙂
Avatar
it probably finds the cmake you installed yourself or some cmake from vs
Exported 206 message(s)