What is "this"?
I've working on fixing the issues the Allegro folks pointed out (I didn't correctly apply the 4.2 patch to 4.4) and should be done later this evening.
What is "this"?
I've working on fixing the issues the Allegro folks pointed out (I didn't correctly apply the 4.2 patch to 4.4) and should be done later this evening.
ZoriaRPG wrote:[MENTION=42714]Gleeok[/MENTION]: Are you working on this? I've been waiting for an update from you.
Sorry, must of missed this (pun intended). :P
What DD said. Not sure. If you mean the AS scripting I am messing around different ideas of getting scripts to "inherit" from c++ code and whatnot - kind of off and on. If you mean the atomic fix then no.
Gleeok wrote:Sorry, must of missed this (pun intended). :PWhat DD said. Not sure. If you mean the AS scripting I am messing around different ideas of getting scripts to "inherit" from c++ code and whatnot - kind of off and on. If you mean the atomic fix then no.
[MENTION=42714]Gleeok[/MENTION] and [MENTION=1]DarkDragon[/MENTION]
I meant the atomic fix. Should I just go with std::atomic and roll with it? I want to try fixing the libs before I compile them again. One nice thing about 4.4.3, is that the main deps are included, so it seems that it is no longer mandatory to do all the extra build steps at this point. I just wish that I knew with certainty what was needed to fix this, as it seems that the two of you have very different ideas on what is needed, and how to proceed.
You both seemed ready to tackle it, so I was waiting to see the results. I am not going to hack ASM back in to the library for a variety of reasons. THe most important, being that it is likely going to cripple it in the future, and it would never be pulled into the main 4.4.3 repo.
My plate has been pretty full of late, with many work-related requirements placed on me shoulders. I want to fix the libs, and make the needed fixes to 2.53, and simply be done with it, so that I can get back to working on master, and interim stuff.
You both seemed ready to tackle it, so I was waiting to see the results.
Sure, I'll do it.
ZoriaRPG wrote:[MENTION=42714]Gleeok[/MENTION] and [MENTION=1]DarkDragon[/MENTION]I meant the atomic fix. Should I just go with std::atomic and roll with it? I want to try fixing the libs before I compile them again. One nice thing about 4.4.3, is that the main deps are included, so it seems that it is no longer mandatory to do all the extra build steps at this point. I just wish that I knew with certainty what was needed to fix this, as it seems that the two of you have very different ideas on what is needed, and how to proceed.
You both seemed ready to tackle it, so I was waiting to see the results. I am not going to hack ASM back in to the library for a variety of reasons. THe most important, being that it is likely going to cripple it in the future, and it would never be pulled into the main 4.4.3 repo.
My plate has been pretty full of late, with many work-related requirements placed on me shoulders. I want to fix the libs, and make the needed fixes to 2.53, and simply be done with it, so that I can get back to working on master, and interim stuff.
Only problem is std::atomic is c++.
Sure. Point me to the 4.4.3 files (I'm assuming you guys are wanting to upgrade to the elusive dot three now) in the ZC master repo that need fixing (unless it's just wwin.c) and I'll give it a shot.
[edit] I should of hit reply hours ago before I got distracted and made dinner, not after. ..hardly counts as being ninja'd... Oh well, whatever. :P
I just pushed a fix here: https://github.com/ArmageddonGames/allegro5/commit/f805b1ed4ac1aeab631763b699060943e157cfa3
DarkDragon wrote:I just pushed a fix here: https://github.com/ArmageddonGames/allegro5/commit/f805b1ed4ac1aeab631763b699060943e157cfa3
Great. Maybe now we'll get a rainbow without the death crash. :P
Completely hypothetical question for you: Do you think this is more likely to manifest on newer computers because of increased core counts and more complex (read: stupid ms windows) kernel scheduling? ...Like, for example, might something similar to this affect crash occurrence in theory if it didn't interrupt or block as much:
SetProcessAffinityMask(GetCurrentProcess(), 1);
SetThreadAffinityMask(GetCurrentThread(), 1);
?
Just a random thought.
Well, this is certainly fun. MSVC 2008 chokes and dies compiling this CMake build of ag 4.4.3. I might need some of your includes, whatever you used, as the headers for stdint.h and inttypes.h fail to compile on MSVC9, and there are some major issues with a few of the allegro source files, too.
Have a look:
Are the errors in color.c resulting from our changes, and thus, our fault?
Likewise, for config.c/h? I know that I've compiled this bastard before in MSYS, and I may need to go that route again.
I suspect that no-one even bothered to try compiling the build for Windows using MSVC9, as all of the allegro users are Linux blokes. THose who build it on Windows use MSYS/MinGW, which is the opposite of our conundrum for ZC.
Are the errors in color.c resulting from our changes, and thus, our fault?
Are you *sure* you're trying to compile the right thing? Branch "4.4-ZCfixes" of https://github.com/ArmageddonGames/allegro5? The line numbers in your pasted output do not make a lot of sense.
Gleeok wrote:Great. Maybe now we'll get a rainbow without the death crash. :PCompletely hypothetical question for you: Do you think this is more likely to manifest on newer computers because of increased core counts and more complex (read: stupid ms windows) kernel scheduling? ...Like, for example, might something similar to this affect crash occurrence in theory if it didn't interrupt or block as much:
SetProcessAffinityMask(GetCurrentProcess(), 1);
SetThreadAffinityMask(GetCurrentThread(), 1);?
Just a random thought.
Could be. But if the keyboard thread doesn't run as often, that can also cause problems (slow response to keyboard input, missed keys, etc).
Oh boy. GitHib , in the last few days, deprecated some older Firefox clients. Guess what no longer works? Branch selection.
Why the flidd would they disable that, for older browsers?
Here's a crazy thought: upgrade your browser? Probably your computer is riddled via trojans if you haven't been keeping up with security updates...
Also, you don't need to do any branch selection on the GitHub site to download the code. Just git clone https://github.com/ArmageddonGames/allegro5.git and then on your computer (*not* your browser) switch to the 4.4-ZCfixes branch.
DarkDragon wrote:Could be. But if the keyboard thread doesn't run as often, that can also cause problems (slow response to keyboard input, missed keys, etc).
Oh no no no. I wasn't suggesting that as a fix (that would be stupid!), just contemplating why it works on old hardware and as the computers get newer the problems would get worse. ...yeah, I'm not so great with hardware. CPUs are just crazy complicated nowadays.
P.S. [MENTION=42228]ZoriaRPG[/MENTION]: How's CMAKE working out for you so far? :gavel:
Gleeok wrote:Oh no no no. I wasn't suggesting that as a fix (that would be stupid!), just contemplating why it works on old hardware and as the computers get newer the problems would get worse. ...yeah, I'm not so great with hardware. CPUs are just crazy complicated nowadays.P.S. [MENTION=42228]ZoriaRPG[/MENTION]: How's CMAKE working out for you so far? :gavel:
Edit: I may have this sorted.
I managed to build 4.4.3, but it is spitting out[FONT=Courier New] loadpng.dll [/FONT]and [FONT=Courier New]jpgalleg.dll[/FONT] as separate files from [FONT=Courier New]alleg44.dl[/FONT]l. I'm not sure how to fix that. Any clues would be helpful.
Are there linker options in MSVC to build this in a monolithic mode, or CMake flags to use? Egdar wasn't very optimistic, despite 4.4.2 building as a monolith before, and I believe 4.4.3 did, too.
The actual alleg44.dll is working, and seems somewhat faster ( 20 to 40% ) , but of course, PNG and JPEG loading are broken. I do not know how to force link these three.
DarkDragon wrote:Here's a crazy thought: upgrade your browser? Probably your computer is riddled via trojans if you haven't been keeping up with security updates...Also, you don't need to do any branch selection on the GitHub site to download the code. Just git clone https://github.com/ArmageddonGames/allegro5.git and then on your computer (*not* your browser) switch to the 4.4-ZCfixes branch.
(1) Newer firefox builds run far slower, and less reliably. They are plain awful,a nd TBH, if I did not need some features that were not in 28.0, I would still be using that. I can count the number of websites that I visit on this machine on my fingers. The majority of the time, it is simple:
(2) On this system, those are AGN, Pure, DoctorWhoTV, Youtube, StackExchange, Pastebin, GutHub, SourceFoce, Twitch (streams only), and HitBox (broadcasting only); and now, allegro.cc. I rarely venture outside of this range, and I run NoAcript, with all scripts disabled by default. I only enable content that I can validate. I'm quite far from the typical Internet user. I also run ABP to prevent any unauthorised content that NS misses, and ABE to catch redirect exploits. These tools are vastly superior to anything that Firefox 4+ offers, and given that Firfox + tend to make this system unusably slow, there is no real reason to update, until some content that I need forces it
(3) I do not download binary files on this system, barring open source content that I can verify, or build; or libs from very trusted sources.
(4) In-browser security, is primarily in the form of exploit prevention. For the most part, the bloat added to newer browsers to make them prettier, or to tack on useless features, is pointless, and their exploits are generally avoided by careful control over the sites and the services that you use, and the content that you permit to run. As I permit nothing to run by default, it's unimportant.
(5) I use no 'social media' sites, I do not log into anything untrusted, and I generally keep my circle very small.
For other content, I VNC into a remote system, and use that.
I have most of the major cookie engines, data mining engines (such as Google's advert mining) and such set to loop back to 127.0.0.1; too.
When I must use a newer browser, I have a current install of Chrome, which runs terribly, uses 4x as much RAM, and has a terrible UI.
So the issue is that Allegro is compiling loadpng as a dynamic rather than static library? You can try recompiling loadpng with SHARED off. If that doesn't work the easiest solution may be to change how *we* compile ZC so that we use loadpng (and possibly the other sound/graphics libraries) as dynamic libraries. But first see you can get Allegro to compile them as static libraries, because the fewer .dlls we have to ship with ZC, the better.
You may be able to open the generated msvc projects' properties and change them to "static library" instead of mussing with CMAKE I guess? Don't know if you'd then need to tell aleg44 to link library dependencies or not also.
I used to use Firefox 3.5 or something until a few years ago. I switched from that to Firefox 25.1 and immediately wanted to strangle the Mozilla team with razor wire. Build 45 is the last version I've used and you can imagine how I feel about that. Don't even get me started on google "technology" either...
Notice how youtube changed all their shit the last few weeks? Well yesterday youtube hung and crashed my graphics card. [True Story] Of course then windows couldn't figure out how to reload the offending ati lib and then Blue-Screened, so I had to restart. Makes me miss the good old days where youtube just randomly stops working until you Ctrl-F5 the page.... Oh no, wait. They still do that.
Gleeok wrote:You may be able to open the generated msvc projects' properties and change them to "static library" instead of mussing with CMAKE I guess? Don't know if you'd then need to tell aleg44 to link library dependencies or not also.I used to use Firefox 3.5 or something until a few years ago. I switched from that to Firefox 25.1 and immediately wanted to strangle the Mozilla team with razor wire. Build 45 is the last version I've used and you can imagine how I feel about that. Don't even get me started on google "technology" either...
Notice how youtube changed all their shit the last few weeks? Well yesterday youtube hung and crashed my graphics card. [True Story] Of course then windows couldn't figure out how to reload the offending ati lib and then Blue-Screened, so I had to restart. Makes me miss the good old days where youtube just randomly stops working until you Ctrl-F5 the page.... Oh no, wait. They still do that.
I feel your pain. Now firefox is dropping extension support, entirely. All of the extensions and plug-ins that we use, will cease working with FF 53.
The Mozilla team simply does not care. I'm on the verge of exploring alternatives based on the older Mozilla code, or just compiling my own browsers.
I mucked about with the linker options, and I think that I have the libs linked. they seem to be working,
http://timelord.insomnia247.nl/zc/zc_dev/2.53_Win_Beta_3.zip
New libs, only.
ugh. PNG and JPEG loading do work, but only on the second and later attempts. Something is not linked right, or the libs are not loading when the first instance of loading a file is called.
[MENTION=42228]ZoriaRPG[/MENTION]
Pale Moon is where it's at. There's also a 64-bit version. And none of the horseshit going on in the boardroom.
ZoriaRPG wrote:I feel your pain. Now firefox is dropping extension support, entirely. All of the extensions and plug-ins that we use, will cease working with FF 53.The Mozilla team simply does not care. I'm on the verge of exploring alternatives based on the older Mozilla code, or just compiling my own browsers.
I mucked about with the linker options, and I think that I have the libs linked. they seem to be working,
http://timelord.insomnia247.nl/zc/zc_dev/2.53_Win_Beta_3.zip
New libs, only.ugh. PNG and JPEG loading do work, but only on the second and later attempts. Something is not linked right, or the libs are not loading when the first instance of loading a file is called.
Why is there a jpgalleg.dll in the zip? As I already tried to explain, you need to build jpgalleg as a static library. Static and dynamic libraries both have the same file extension (.lib) but they are very different things.
The steps for doing this (works for me on MSVC 2015) are:
1. Run Allegro's CMake with SHARED set to true (checked).
2. Compile Allegro (only). This will generate alleg44.lib and alleg44.dll.
3. Run Allegro's CMake with SHARED set to false (unchecked).
4. Compile loadpng and jpgalleg (only). This will generate jpgalleg.lib and loadpng.lib (no .dlls).
5. Copy all .libs into libs/win32 in your ZC folder
6. Rename jpgalleg.lib to libjpgal.lib (or alternatively, change the name in CMakeLists.txt).
7. Build ZC
8. Copy alleg44.dll into whichever folder you are running the ZC .exes from.
Alternatively, you can skip steps 3-8 and instead build jpgalleg and loadpng from the standalone source, like we used to do (sources are in other/ldpng15.zip and other/jpgalleg-2.5.tar). These don't have Visual Studio projects so you'll have to configure and build them yourself (way easier than CMake, amirite?)
DarkDragon wrote:Why is there a jpgalleg.dll in the zip? As I already tried to explain, you need to build jpgalleg as a static library. Static and dynamic libraries both have the same file extension (.lib) but they are very different things.
I forgot to delete them. The .lib files are there, too.
The steps for doing this (works for me on MSVC 2015) are:
1. Run Allegro's CMake with SHARED set to true (checked).
2. Compile Allegro (only). This will generate alleg44.lib and alleg44.dll.
3. Run Allegro's CMake with SHARED set to false (unchecked).
4. Compile loadpng and jpgalleg (only). This will generate jpgalleg.lib and loadpng.lib (no .dlls).
5. Copy all .libs into libs/win32 in your ZC folder
6. Rename jpgalleg.lib to libjpgal.lib (or alternatively, change the name in CMakeLists.txt).
7. Build ZC
8. Copy alleg44.dll into whichever folder you are running the ZC .exes from.Alternatively, you can skip steps 3-8 and instead build jpgalleg and loadpng from the standalone source, like we used to do (sources are in other/ldpng15.zip and other/jpgalleg-2.5.tar). These don't have Visual Studio projects so you'll have to configure and build them yourself (way easier than CMake, amirite?)
I see the issue. Hmph. I should have thought about this a bit more, but, ah, the stresses of life.
I will give this a try. One thing to note, is that when I left ZC running for a few hours, it was stealing enter key presses from other programmes.. By that, I mean that until I exited ZC, my enter key did nothing elsewhere but I did not rebuild ZC in the process--my fault. I will check again after I rebuild it all.
Now I know what I'll be doing tomorrow.
P.S. Did you backport the fixes that you made (in response to Lut's post) from master to 2.50.x, so will I be doing that?
That's something to ask the Allegro folks---none of our changes should have caused any difference in behavior of the keyboard driver itself.
[MENTION=1]DarkDragon[/MENTION]
FYI, the aleg44.dll that you put in the AGN repo is bad. It fails to load, because it requires VCRUNTIME140.dll. You should probably be setting the CMake flag CMAKE_BUILD_TYPE as Release for this.
I tried the process that you detailed, and I am encountering linker errors. I did each step precisely as you described. I will need to go in and try building the dependency libs manually, but I believe that our loadpng stuff is outdated. I'll look into it again after a sanity refill. Building ZC using the alleg44 file made with SHARED = true, and using the deps with SHARED = false, results in a long chain of critical linker errors.
Did you specify any special linker flags in the CMake config when you built ag44 or its deps?
What are these errors?
alleg44 is not "bad," but it was built using MSVC2015, it makes sense you can't use it if you're running an old version of the compiler.
DarkDragon wrote:What are these errors?alleg44 is not "bad," but it was built using MSVC2015, it makes sense you can't use it if you're running an old version of the compiler.
No, no. the alleg44.dll file in [FONT=Courier New]/bin/win32[/FONT] , when used by ZC/ZQuest (and ROMView) binaries, requires the MSVC2015 dll. If that file was meant specificallyu for MSVC debugging, that's fine, but flagging it -debug-msvc15.dll would be prudent. As that file output is meant for general ZC/ZQ testing, and MSVC2015 is not a mandatory component to doing that, there needs to be a release dll in that path.
i.e. The dll provided for us eby the binaries cannot be used by everyone.
I'm not sure if I am using the correct headers for the PNG library. The allegro CMake file wants to point to png.h, but tht is part of lpng1212, not loadpng15. When i compile lpng1212, the first attempt to load a PNG file does nothing, and all future attempts work. When I tried to point Allegro's CMake to loadpng15's header, it spewed a list of syntactical issues.
The Linker errors when using loadpng.lib and libjpegal.lib were along these lines:
5>alleg_compat.cpp
5>init.cpp
5>Generating Code...
5>Compiling...
5>zc_custom.cpp
5>subscr.cpp
5>sprite.cpp
5>save_gif.cpp
5>qst.cpp
5>particles.cpp
5>md5.cpp
5>midi.cpp
5>gamedata.cpp
5>EditboxView.cpp
5>EditboxModel.cpp
5>editbox.cpp
5>defdata.cpp
5>colors.cpp
5>Generating Code...
5>Compiling resources...
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _atof already defined in LIBCMT.lib(atof.obj)
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _getenv already defined in LIBCMT.lib(getenv.obj)
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _calloc already defined in LIBCMT.lib(calloc.obj)
5>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &😉" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
5>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info:😮perator=(class type_info const &😉" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
5>libpng.lib(pngerror.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _free already defined in LIBCMT.lib(free.obj)
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _malloc already defined in LIBCMT.lib(malloc.obj)
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _atof already defined in LIBCMT.lib(atof.obj)
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _getenv already defined in LIBCMT.lib(getenv.obj)
5>MSVCRT.lib(MSVCR90.dll) : error LNK2005: _calloc already defined in LIBCMT.lib(calloc.obj)
5>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall type_info::type_info(class type_info const &😉" (??0type_info@@AAE@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
5>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info & __thiscall type_info:😮perator=(class type_info const &😉" (??4type_info@@AAEAAV0@ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
5>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
5>C:\Users\DELL\Desktop\ZC_2.54\_ZC253\ZeldaClassic\Release\zquest.exe : fatal error LNK1169: one or more multiply defined symbols found
5>Build log was saved at "file://c:\Users\DELL\Desktop\ZC_2.54\_ZC253\ZeldaClassic\zquest.dir\Release\BuildLog.htm"
5>zquest - 15 error(s), 20 warning(s)
This occurred when compiling ZC with the newly compiled static libs.
Obviously, something is awry, but i do not know what is causing this; nor what default lib the Allegro config wants--which seems to be one of the major problems here. This is the issue when the CMake config is both clearly tailored for MiGW, and primarily tested on Linux. it has no appropriate defaults set up for any of these deps.
I may just go with MiNGW, as at least that is a tried and proven method of compiling ag 44, and there is effectively no support for anything else on allegro.cc, nor any interest in supporting other compilers. At that rate, thay may as well just have included a makefile and require a specific compiler. :/
You get these errors when you compile Allegro yourself? Or using the Allegro .lib in the repository?
1) Linker errors related to LIBCMT: these are due to compiling Allegro with /MD (the way they have configured their build) rather than /MT. I've pushed new versions of the libraries with the correct flags set.
2) Linker errors related to MSVC2015's standard library: may or may not be fixed. I compiled the library using MSVC2015 so there's no reason to expect it will be possible to link to it with older versions of the compiler, but you can always try...
3) Errors related to loadpng: yes, you need to either rename the .lib or change the name in CMakeLists, if you want to use the new implementation included in Allegro 4.4. The issue you're reporting where loading an image only works the second time sounds very strange and I wouldn't expect it to be related to .libs at all, but you'll have to provide more details.
EDIT: I've also pushed changes to Allegro's configuration that sets the proper flags for ZC.
When you compile a lib the two options you want are input (or dependencies), and output; e.g. output you can specify a dll (allegro defaults to this) and link dependencies to that. MSVCRT and LIBCMT are just a few; libpng and zlib are essentially the same as well. If you want a static lib that links to dlls you can do that, and in the same way you can make a shared lib that links to static libraries.
If you get errors that you are missing a dll like libpng, for example, it means you compiled and linked libpng as a dll. ...But don't get me started up on build systems again. 😛
Gleeok wrote:When you compile a lib the two options you want are input (or dependencies), and output; e.g. output you can specify a dll (allegro defaults to this) and link dependencies to that. MSVCRT and LIBCMT are just a few; libpng and zlib are essentially the same as well. If you want a static lib that links to dlls you can do that, and in the same way you can make a shared lib that links to static libraries.If you get errors that you are missing a dll like libpng, for example, it means you compiled and linked libpng as a dll. ...But don't get me started up on build systems again. 😛
I figured out the issue. I thought that I was not linking properly, but this turned out to be yet another case of the packfile_password needing to be set null.