General DLL programming questions

Since the issue with the Python exposure comes up again and again I will change the code and put far less into the precompiled header so the Python interface CPPs see far less of the other complex code which should put us considerably further away from the compiler limits.
The price is that the full compilation will take longer.
 
@TB: I pushed the changed structure now to the SVN so you might want to test if that fixes the issue with more info replacements.
 
someone should really go through all the includes in the files that are in turn included by most files and remove all those that are not needed
I'd wondered if it was wise to automatically expose all things to python. In this, are you suggesting then that it is definitely NOT a good habit and much better to report only as necessary?

It is a compiler switch.
Might it be surprising to hear that I've no idea what a compiler switch is? lol I really struggled during the setup of the compiler and I can hardly recall how I managed to get started and in the process I pretty much just did step by step what the tutorial instructed to do. Beyond that I wouldn't have much of a clue how to really work the thing. So I can't say I'm familiar with what a 'switch' is in this context.


Your description of ways we can approach this went over my head pretty quickly BUT it was reassuring to hear we have options if we need to implement them. I really appreciate your help on this matter and I'm really happy to update and jump back into the project to see if what you've changed has helped!

The price is that the full compilation will take longer.
So it wouldn't impact the loading of the mod or of a game, just the compiler? That doesn't take all that long for me. The new computer is like night and day with the old one as it is and I'd gotten used to having to step away whereas now I can generally just sit there for a few minutes, check the site for more posts and before you know it its done (on a clean re-build). So really, a somewhat slower compiling as the cost for being able to enable these replacement mechanisms is definitely worth it! Thanks again!
 
Might it be surprising to hear that I've no idea what a compiler switch is? lol I really struggled during the setup of the compiler and I can hardly recall how I managed to get started and in the process I pretty much just did step by step what the tutorial instructed to do. Beyond that I wouldn't have much of a clue how to really work the thing. So I can't say I'm familiar with what a 'switch' is in this context.

Sounds like someone who has only used a GUI point'n'click user interface...

Programs often have options to change how they behave. You can see this in Civ4 in the shortcut to run C2C: it specifies 'mod="Caveman2Cosmos"' after the name of the program. That is a switch that tells it what mod to load. For a programming related metaphor: they are a lot like optional parameters in a function call, especially in a language like Python that can use named parameters instead of positional parameters.

Changing the behavior of a program much in this here GUI era is unusual. People just run them as they are and, occasionally, change settings after it is running (or sometimes edit configuration files). But that requires that the program hang around and wait for user input instead of just getting on with whatever it is supposed to be doing and the compiler does no such thing, it just compiles the file it was told to compile (good thing too - you really don't want it to be popping up some window waiting for user input for each file it is compiling). If you look in the makefile for C2C you can see that is specifies several switches for the compiler to get the specific desired behavior and there is a different set of switches for debug and release.

In ye olde CLI (command line interpreter) days it was very common to specify switches to make the programs do what you wanted without having to mess around with anything after it was launched, often because there was no interface after it was launched as the program just did what it did and sent its output back to you (to the terminal or whatever you were using to run it) or wrote it to a file or whatever. Like the good old "dir" command to get a directory listing in Windows (and some other operating systems; Unix and related OSes usually use "ls" which is apparently Martian, or something like that, for "list" although they sometimes have "dir" set as an alias for "ls"). If you run cmd.exe in Windows (either via entering cmd in the search box, or "Command Prompt" on the Accessories sub-menu) and enter "dir/?" (without the quotation marks) it will provide you with basic help that tells you what it does and what the other available switches are.
 
I'd wondered if it was wise to automatically expose all things to python. In this, are you suggesting then that it is definitely NOT a good habit and much better to report only as necessary?
No, that is a misunderstanding. I am talking about code visibility, not if you expose something to Python or not.
You will note that most Python interface cpps only include CySomething files, not CvSomething. The CySomething classes serve both as tombstones and as way to hide most of the actual data implementations from the Python interface files.
In most cases the CySomething headers don't include anything.

So it wouldn't impact the loading of the mod or of a game, just the compiler? That doesn't take all that long for me. The new computer is like night and day with the old one as it is and I'd gotten used to having to step away whereas now I can generally just sit there for a few minutes, check the site for more posts and before you know it its done (on a clean re-build). So really, a somewhat slower compiling as the cost for being able to enable these replacement mechanisms is definitely worth it! Thanks again!
Only the compilation time is changed, nothing at runtime.
 
Sounds like someone who has only used a GUI point'n'click user interface...
<snip>

Some of us are young enough that we have never lived without those. ;)

At any rate, an MSDN article on the matter says that the default value when /Zm is not specified is 100, which translates to 50 MB internal heap. Doubling that to 200 (so 100 MB of heap) in the Makefile does not impact the build for me on a clean SVN, so if no one objects I can add that to the SVN.
 
Some of us are young enough that we have never lived without those. ;)

At any rate, an MSDN article on the matter says that the default value when /Zm is not specified is 100, which translates to 50 MB internal heap. Doubling that to 200 (so 100 MB of heap) in the Makefile does not impact the build for me on a clean SVN, so if no one objects I can add that to the SVN.

While I'm still hoping (I haven't had a chance to find out yet) that AIAndy's adjusted methods have been completely successful, I don't really object as that may give us a little more room, but I'd defer to his judgement on whether its a good thing to do or not.
 
While I'm still hoping (I haven't had a chance to find out yet) that AIAndy's adjusted methods have been completely successful, I don't really object as that may give us a little more room, but I'd defer to his judgement on whether its a good thing to do or not.

I agree we should defer to his judgement but I see no issue with increasing the heap size and none of us should notice that extra 50MBs at all during compile.
 
I agree we should defer to his judgement but I see no issue with increasing the heap size and none of us should notice that extra 50MBs at all during compile.
Last I tried that with this issue it just ran into another error afterwards (structure overflow or something) but it should indeed not hurt.
 
Last I tried that with this issue it just ran into another error afterwards (structure overflow or something) but it should indeed not hurt.

I've just committed the modified Makefile to the SVN, so try compiling and make sure it works for you.
 
Back
Top Bottom