CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.62k stars 4.17k forks source link

Linking dynamically using windows mingw. #6778

Closed Wishbringer closed 10 years ago

Wishbringer commented 10 years ago

I'm currently running MinGW-w64(GW2) (windows tiles) build linked dynamically using link switches "-static-libgcc -static-libstdc++" without problems, all dll files are the latest, even zlib. Including dll files or using "-static" isn't necessary. This also solves the mysterious crash problem (since SDL2). Use DWARF not SJLJ, it's so much faster. Note: This has nothing to do with 64bit. http://mingw-w64.sourceforge.net/download.php#mingw-builds

narc0tiq commented 10 years ago

Is this still a valid issue? #6850 landed quite a while ago.

Wishbringer commented 10 years ago

And you won't need to use any of these "-lfreetype -lpng -lz -ljpeg -lbz2" when using SDL2. See #7238 Just to be clear, this isn't really a big issue. I'm just saying that we shouldn't use -static unless necessary. SDL2 binaries use these libraries, not Cataclysm, so it makes more sense to let SDL2 handle it. And just let SDL2 use whatever dll files it wants to use, natively.

Wishbringer commented 10 years ago

It should look like this: https://onedrive.live.com/?cid=3ec4268a92f26059&id=3EC4268A92F26059!108&sff=1

narc0tiq commented 10 years ago

I'm slightly concerned by this statement of "proper linking", as if static-linking were somehow wrong. Sure, it makes for a bigger binary (though after unused symbols are stripped, it shouldn't be much bigger) and takes a little longer, but it does also mean our install process is a simple "unzip and execute".

But we're having the same discussion in two places now, so I won't belabor the point much further -- especially since, as you said, it's not really a big issue.

Wishbringer commented 10 years ago

I'm struggling with the proper language. You can use my slightly modified Makefile here: https://github.com/Wishbringer/Cataclysm-DDA/blob/FrankenMod/Makefile This Makefile does linking without any references to those libraries.

narc0tiq commented 10 years ago

Forgive me for splitting the discussion -- for readers' reference, there's more discussion at #6850, but I'll try to limit replies here in future.

As an option in the Makefile, it would make perfect sense -- saving time on debug builds is always a worthy cause, since it reduces the duration of edit-compile-run cycles.

Wishbringer commented 10 years ago

Now we're talking! :) That is why I wanted this included, really. I rebuild all the time, so every second is precious. Just a few tweaks in the Makefile would do it. I like to use -j 3 when building, I have 4 cores. So I can compile in the background while watching a movie or something. Just wanted to make it clear, to everyone, that dynamic linking does work now. Maybe posting as an issue isn't the proper way, but that's a social issue for me. The Makefile shows what options I use.

narc0tiq commented 10 years ago

Honestly, if you're willing to do the work, I'd entertain a pull request to add a dynamic-linked option to the Makefile. Up for it? If you do, feel free to let it also happen on Linux builds -- lib*.so should work even better than the DLLs do.

Wishbringer commented 10 years ago

I can't really test the non-windows parts though, my Linux box died a long time ago. Probably best to start afresh from the master Makefile, without all my 64bit crap in it. :) So, a make option then perhaps, like "make DYNAMIC=1" or something.

narc0tiq commented 10 years ago

That's okay, almost every other maintainer can test those. You should hang out in IRC; this seems like a better conversation for there.

Wishbringer commented 10 years ago

Yea, haven't used that in like 15 years or so, I'm almost forty, believe it or not. :) I miss my old KDE Linux and XChat, have been completely burned out these last fifteen years.

narc0tiq commented 10 years ago

Well, it's still kicking. We're on #CataclysmDDA and #CDDA-dev on freenode, if you're interested.

Wishbringer commented 10 years ago

Ahh. freenode it is. I'm a bit scared even thinking about socializing indirectly, these days. Complete shut-in, prefer cats to humans. I'll make an appearance and we'll see what happens. :) Is it still prefered to use mIRC on windows, these days?

narc0tiq commented 10 years ago

Har. I'm almost thirty myself; can't believe time went by so quickly. Also can sympathize with the socializing difficulty. I have periods of activity followed by longish periods of... lack thereof.

I think for Windows I've seen hexchat recommended and used a fair bit, but honestly I couldn't say. I just run weechat on my linode.

Wishbringer commented 10 years ago

Ok, thanks, I'll try hexchat, its supposedly based on xchat, so that should feel familiar. Yeah, I don't know if the time-warp thing is because of age or that I got burned out during the IT crash, probably both + the sameness factor. I'm in #CDDA-dev now, don't mind if I just hang around for a bit. :)

KA101 commented 10 years ago

Got a few months left until 30 here too. ChatZilla works OK.

Wishbringer commented 10 years ago

I like HexChat (first impressions), so I'll keep using it. 64bit version uses only 12.6mb memory, quite impressive. My Firefox takes up too much memory (memory hog), as is. My birthday is soon, 23 April, don't even know how many years I'm supposed to become. Update: Did the math, must be 39. .) Might as well close this, since it is up to me to fix it.