2015-02-23 14:39:08

Hi.
I have a cpp project I want to build into a DLL file. The project files are ready, and a batch file for cl is also available.
Where can I get a minimum set of archives to run cl.exe properly?
I tried installing Visual Studio 12.0 comunity edition, and set the required environment valiables, but CMD says the compiler cannot read include files even if the path is registered.
Can anyone tutorial how to get started with cl?
I don't need the huge workstation, all I want to do is compiling.

I don't speak as good as I write, and I don't listen as good as I speak.

2015-02-23 15:39:56 (edited by camlorn 2015-02-23 15:48:30)

The way you're supposed to do this is to launch the developer command prompt.  In VS2013, this is in all programs->Visual Studio 2013->Visual Studio Tools.  Then cd to the directory your stuff is in and run the batch file.  They move this for every Visual Studio version.  I have no idea where it is for 12.  If headers are still missing, then it is possible you're missing dependencies.  If this is the case, good luck: setting up dependencies on windows can be a bit tricky at the best of times.  If windows.h is missing, then VS is not set up properly.  If anything else is missing, then you should say what it is so we can determine if VS is not set up properly.
You're not supposed to manually set any environment variables.  If you did this via control panel and not via writing a batch file, they are permanent.  In that case, you must undo them now.  If you don't, it will just screw everything up.
And the prompt you want is the regular one.  Ignore all the options for cross compilation, and you probably aren't going to want anything 64-bit, either.
if problems persist and it is not missing dependencies, then something may be wrong with the batch files.  Did you write these yourself?
And what are you trying to build and what are you trying to call it from?  This might be one of the notoriously hard ones as it is.

My Blog
Twitter: @ajhicks1992

2015-02-23 15:55:05

I would recommend 64-bit because your game can use all the memory in the machine (if it has to). Plus, 32-bit is being obsoleted by 64-bit systems.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-02-23 16:14:21

Okay. No.  Go look at all the new 32-bit tablets.  And the fact that everything under the sun runs 32-bit code.  32-bit is not going anywhere, and it is not a magical ram fix.  It's not a magical anything fix.  Your players will literally not notice.  It's also not something you can do if the thing with which you wish to use the DLL is 32-bit because you're not allowed to mix them in the same process.
most machines in this community don't go above 4 gb.  If you have a machine that goes above 4 gb and your game somehow manages to be super ram hungry, it might matter.  It is also worth remembering that the size of a pointer when using 64-bit code is doubled, which is why we have seen a bit of a comeback for tablets: when you have only 1 or 2 GB for everything, doubling the size of literally every pointer on the system is not a happy thing.  I should also point out that the VS defaults when using the IDE are still 32-bit.  64-bit matters for mathematical code and technically it gives the compiler more registers, but the actual performance and ram gains in this case are not important.  You're not going to see a real speed-up unless you're using C/C++ directly and for everything, and if your Audiogame needs 4 GB then we need to talk about algorithm efficiency because few here have 4 GB free on their system to throw at your program.
64-bit is a nice thing, potentially.  As in, in another 5 years when literally every non-tablet computer has enough ram for it to actually matter.  But even then you're still going to have the tablets and the servers, and neither of those likes or needs 64-bit code.  People have been saying that 64-bit is going to replace everything since it first came out, but I'll let you know when that actually starts happening.  For most programs, doubling the native sizes of a pointer and an int is not worth being able to access >4 gb of ram because they don't need that much, and now they've just doubled their ram footprint.

My Blog
Twitter: @ajhicks1992

2015-02-24 06:04:39 (edited by nyanchan 2015-02-24 06:06:37)

Do you mean the batch should be launched in the developer prompt and it is impossible to run the compilation by just hitting enter on explorer?
I reset all environment valiables to the values they were before I manually set them.

I don't speak as good as I write, and I don't listen as good as I speak.

2015-02-24 17:17:05

yes. You must launch the compilation from the developer prompt.  You cannot ever do c++ programming things by pressing enter in explorer, at least not without some fun and very hacky setups.

My Blog
Twitter: @ajhicks1992

2015-02-25 03:17:26

@Camlorn, Why do you act like a know-it-all sometimes? I'm seriously starting to hate you for that. I make a comment; you just reject it without thinking about it. (If you do, please correct me.) You act like you know everything. Can you please let others read my posts and decide what they want to decide before you just but in and make this statement about so and so and think that whatever you post is final?

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-02-25 08:33:18

Running it from the developer prompt did what I wanted.
Compiling and debugging in the console is a little troublesome though, anyway thank you for the information.

I don't speak as good as I write, and I don't listen as good as I speak.

2015-02-25 09:52:59 (edited by defender 2015-02-25 09:58:04)

He does know everything, at least, almost everything, he's pretty much the resident genius on audiogames.net if you didn't notice, and having known a few highly intelligent people my self, I'd have to say that he's pretty damned polite, considering how smart he is compared to most of us. LOL  Putting up with the stupid questions alone is grounds for a reward, based on how he talks when he's helping coders with advanced problems, or discussing audio at an extremely high level, but he actually actively tries to help people out, often.


His advice is probably much better than yours, just by default, you get used to it after a while.  I found it annoying at first too, but not any more, since I can tell that he tries to be nice about it, and I never acted like a moron about that, so I suggest you don't either, lest you make him consider not helping as much in the future.


Plus, if you really thought your advice was better you wouldn't be worrying about the original poster taking his over yours anyway, nor what Camlern thought of your statement.

2015-02-25 11:39:22

I'm gonna agree with defender and camlorn here. Camlorn has actually helpt out with quite a lot with dmnb, and if it wern't for his handy link for getting a restart script for the server, we wouldn't be having the server up as offen as we do now. By the way camlorn thanks a lot for that. On this argument of 64 bit. I myself have a 32 bit computer, and do not have the current funds to replace it.

Check out the new reality software site. http://realitysoftware.noip.us

2015-02-25 15:49:26

I understand. The thing I don't like is the way he just writes his posts as if his word is god's word when its not. He says everything under sthe sun is 32-bit? Then, Camlorn, tell me why most, if not all, computer stores give you 64-bit PCs and MACs? Tablets was completely off-topic here; I did not say Tablets; I said PCs and MACs.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-02-25 16:05:21

Oh, and one last thing: Camlorn does not know everything. He is not a god. He is not god. If he really did know everything, I might trust him much more. But just because you might know everything there is to know about a language does not give you to right to go and brag about how its so cool and such, or intentionally make everyone else feal like their put down because you think you know everything.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-02-25 17:32:50

OK yeah look. Defender and danny: yes Camlorn helps out a lot, and I've greatly appreciated his help on the projects which I'm working on. But he's in college studying computer science or something, that's why he knows so much; there are still things he doesn't know. He's got teachers... I'd assume anyway. I'm sure that if he knew "everything" he'd be working for Microsoft or Apple, or perhaps creating such a company of his own. He's the helpful sort, and the expressive sort, but he doesn't know everything. big_smile
Ukio what exactly is it that you're working on? What will it do

If you have issues with Scramble, please contact support at the link below. I check here at least once a day, so this is the best avenue for submitting your issues and bug reports.
https://stevend.net/scramble/support

2015-02-25 18:12:54

I did not say that everything under the sun is 32-bit, just that 32-bit code is not obsolete yet, nor will it be soon.  If your computer is going to have more than 4 GB of RAM, then it will need a 64-bit processor and a 64-bit OS to take advantage of it.  Even 32-bit programs get benefit from this as the operating system can give them more memory.  Back on the older 32-bit only systems, you'd have to keep back half the ram for windows.  I cannot go into specifics on how this works because honestly I've never cared enough to learn X86 assembly far enough to write my own virtual memory management, but there are many books on Windows if you're interested in specifically how Windows manages memory.  The last time I had to go there, I used Windows Internals.  That's not a bad book and it's on Bookshare with decent quality as I recall.  The key point here is that letting your OS access more than 4 GB of ram is a super good thing even if your app can't.
If I'm down in C++ land and I'm doing mathematical code, 64-bit code may help.  but as soon as we're talking about something like BGT or Python, the only benefit is the Ram.  Since you can't reasonably write apps that use more than 4 GB of ram (I'd say that even more than 2 is pushing it), you don't get anything.  I only have 8, and my system is a bit above average.  If we count the OS and the things I have running in the background, we're down to about 5.  If I open your game that uses more than 4 GB and then open Firefox, we're probably looking at near continuous swapping of pages from the hard drive to RAM.  This is way beyond bad for system performance.
A quick bit of math.  On a 32-bit platform, a linked list of ints is 12 bytes per item: the previous pointer, the next pointer, and the value itself.  On a 64-bit platform, pointers double in size.  This raises us to 20 bytes per item.  If you push the 4 GB limit and are using any pointer-heavy data structures, something which is quite common, switching to 64-bit code will give you more ram.  But it'll also push up your ram requirement, possibly quite respectably.  I did have a factual error in my post: C/C++ ints do not change size.  Longs can, but this appears to only be true on OS X.  But pointers are still pretty damning.  I also can't speak for other languages, i.e. Purebasic which is free to do whatever it pleases; pointers pretty much have to be 8  bytes, and that's the only constant across all 64-bit supporting languages.
As for speed, it won't help for most apps.  Our processors have grown in performance exponentially, but ram hasn't.  Nowadays, your app is going to spend a lot of time waiting on ram.  Once you're in a language without the JIT, you lose most gains from having a processor with more registers.  I have done tuning in Libaudioverse along these lines, and it's difficult and counterintuitive.  If you're at a level above where you can do this tuning, then it's not worth worrying about it at all.  It may be possible to do it in something like java, but your solution is going to be fragile and depend on how kind the JIT is feeling today.  I'm not sure if there are any instruction set extensions that only work on a 64-bit processor, but I don't think so.  And even if there are, they're not usually a super big deal unless you're going out of your way to use intrinsics or write assembly for the simple reason that your compiler can't prove necessary conditions to automatically use them to itself.
But the biggest problem is the practical one.  If you have a DLL compiled as a 64 bit assembly, you can only use it in 64 bit processes.  If even one of your dlls is 32 bit only, you have to switch all of them.  Moving a body of C/C++ code from 32 bit to 64 bit can be very difficult depending on what specifically it does.  And then not everyone can run it: 32 bit systems are certainly cheaper, and we have the aforementioned comeback on the windows tablets that only have 1 or 2 GB of ram.  So now you have to compile your app and everything in it twice and put out two versions.  Since you're not likely to actually see any real benefit in most things and it's going to significantly up your ram footprint anyway, you might as well compile as 32 bit and be done with it.  People who truly need 64 bit like to have math and science in their job descriptions, and this isn't us.  Maybe there's something in audiogame programming that can only be done in or would benefit greatly from 64-bit processors.  But I have never, ever, ever seen even a hint of such.
But really I made the original comment because the OP is almost certainly using the DLL with something that is 32-bit, there's like 4 or 5 options for developer command prompt, and using the wrong one is going to give you a DLL for the wrong architecture.  This leads to fun error messages down the road.
And for the record, I don't assume I know everything.  I don't comment on threads for which I don't know the answer.  I say I think when I am unsure.  I'm not sure what you want me to do, Ethin,  pretend I don't have answers?  I've been working with C++ for almost 10 years. I've been working with C++ at the level of a career C++ programmer for the last year and a half.  I have gone through an entire computer science curriculum which I will be finishing in May including 4 classes that talk about this low level stuff.  One of them involved writing programs for a Texas Instruments microcontroller.  Another involved a 12-page research paper and presentation on how Windows works.  If you told me right now that I needed to start teaching a C++ class on Monday or I'd die, that wouldn't really be a problem.  In fact, I'd be thrilled; my ideal job is teaching.  I think that if anyone is qualified to talk about it, up to and including saying that it's probably the wrong tool for the job, it's me.  I submit as evidence Libaudioverse, which you can feel free to download from Github and which I would show to any employer as an example of high-quality, well organized C++.  I'd even expect them to hire me.

My Blog
Twitter: @ajhicks1992

2015-02-25 21:39:19

I'll have to check out code and compare it to my own.
Your math in that post completely confused me. I'm not that skilled in mathematical skilles yet.
You did not answer mmy last question: How come every computer store these days gives new computer consumers 64-bit systems? That's why I mean by "64-bit is being obsolete'd"; only tablets use 32-bit systems.
For pointer size, its hardly noticeable. In fact, my home computer is 64-bit and I don't notice a speed difference with C/C++ pointers. 20 bytes isn't a lot, you know!

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-02-25 21:51:18

camlorn wrote:

Okay. No.  Go look at all the new 32-bit tablets.  And the fact that everything under the sun runs 32-bit code.  32-bit is not going anywhere, and it is not a magical ram fix.  It's not a magical anything fix.  Your players will literally not notice.  It's also not something you can do if the thing with which you wish to use the DLL is 32-bit because you're not allowed to mix them in the same process.
most machines in this community don't go above 4 gb.  If you have a machine that goes above 4 gb and your game somehow manages to be super ram hungry, it might matter.  It is also worth remembering that the size of a pointer when using 64-bit code is doubled, which is why we have seen a bit of a comeback for tablets: when you have only 1 or 2 GB for everything, doubling the size of literally every pointer on the system is not a happy thing.  I should also point out that the VS defaults when using the IDE are still 32-bit.  64-bit matters for mathematical code and technically it gives the compiler more registers, but the actual performance and ram gains in this case are not important.  You're not going to see a real speed-up unless you're using C/C++ directly and for everything, and if your Audiogame needs 4 GB then we need to talk about algorithm efficiency because few here have 4 GB free on their system to throw at your program.
64-bit is a nice thing, potentially.  As in, in another 5 years when literally every non-tablet computer has enough ram for it to actually matter.  But even then you're still going to have the tablets and the servers, and neither of those likes or needs 64-bit code.  People have been saying that 64-bit is going to replace everything since it first came out, but I'll let you know when that actually starts happening.  For most programs, doubling the native sizes of a pointer and an int is not worth being able to access >4 gb of ram because they don't need that much, and now they've just doubled their ram footprint.

read this sentence carefully:
And the fact that everything under the sun runs 32-bit code. 

And I reasert:
And the fact that everything under the sun runs 32-bit code. 

You did say that, Camlorn. You also stated that 32 bit was not obsolete, but don't say you didn't say something you infact did.
Ethin:
Because 64-bit is, as has been clearly stated, doubled. And it's newer than 32 bit, so that's probably why. I don't really know what this whole 32 64 bit junk is all about (I'm just becoming a game programmer, barely that), so can't join the debate. But so far as what's been said here I don't see why, if Ukio is creating this for computers, he shouldn't use 64 bit

If you have issues with Scramble, please contact support at the link below. I check here at least once a day, so this is the best avenue for submitting your issues and bug reports.
https://stevend.net/scramble/support

2015-02-25 23:21:32

32 bit is not obsolete.  Unfortunately we are confronted by a pronoun issue.  If I say that a platform is 64 bit, I am saying that it has a CPU which is capable of running 64 bit code.  If I say that an application is 32 bit, I mean that it is compiled for a 32 bit CPU.  64 bit Intel and AMD CPUs run 32 bit code fine.  They also run 16 bit code fine, but that's not important.  I did not say that everything under the sun is a 32-bit platform in my original post.  I also did not say that all apps were, either.
Okay, one more time.  Hopefully this wording is simpler and more clear.
If you write a 64-bit audiogame that must run on 64-bit hardware, then at most 10% of this community will have the Ram to play it.  You gain no performance unless you are at the level of C++ directly or otherwise are using a language with a *good* 64-bit knowledgeable compiler.  if either of those holds true, you may gain performance, but no one but you with your timer is going to notice as a player of your game.  May.
If you compile as 64-bit, every pointer in your app doubles in size.  Linked lists, binary search trees, and other common data structures have more pointers than data.  If you are using a doubly linked list of a million items, your app will take an additional 8 MB of ram.  If you are using more complex data structures that involve more pointers, the required ram is even more.  Things like Python and BGT love to use pointers internally.  Pointers make the world of interpreted languages go round.
On a 32bit CPU and/or OS, the OS has 4 GB of ram at most, whether that be fake or real (yes, there's such a thing as fake ram, but that's not what it's called).  The end.  This ram is shared among all apps, and you don't get more even if you go shove more ram into the machine.  if you are on a 64-bit CPU and OS, every app gets what is essentially its own 4 GB.  This means that you can access all 16 GB of your shiny new workstation, but each 32 bit app can only see 4 of it.  The difference is that the app has its own 4 and is not sharing in any way with OS resources, at least if you have enough ram for your 64-bit CPU to make a difference.  This is why having a 64-bit copy of Windows makes a difference, even if all the apps you run are 32-bit apps.
On tablets with less than 4 GB of ram, the cost of doubling the size of every pointer is not worth it because you're not able to access more than 4 gb anyway.  To that end, tablets and phones like 32-bit CPUs, though we are finally starting to see trends towards 64-bit architectures there.
on Windows 8 and 8.1, compiling for the PC is sufficient to run on some tablets.  This distinction is therefore very blurry.
You can load all data for Swamp's client including all sounds in under 2 GB of ram.
Doubling the number has nothing to do with the advantages or disadvantages of 64-bit versus 32-bit.
So.  Why?  What do you gain?  Other than complexity, I mean?  64-bit is not the default on most tools, and many things aren't even available without building them yourself.  You're telling me you want to go out of your way to throw out some ram for no gain while also locking some people out because they've got older machines and/or inexpensive windows tablets that it would otherwise run fine on and making your job more complex (if only slightly) at the same time.  I'm among one of those people; I have very seriously considered picking up a $300 Windows tablet capable of running NVDA and BGT stuff that your game wouldn't run on.
In another few years when everyone has a bunch of ram, 32-bit code will probably begin to show its technical obsolescence in a way which is actually practical and all the things that you run will take the ram hit.  But it has not done so yet.

My Blog
Twitter: @ajhicks1992

2015-02-25 23:59:54

Nice speech, Camlorn. I don't code for iwndows phone, so your observations hold no weight. Speaking of weight, where did you learn that pointers are doubled? Did you take apart a processor and look at its internals? (Windows internals only applies to windows. What about Mac or Linux? That book does not apply in that situation.)
Oh, and stop lying to us. Severestormsteve1 said it himself: In post 4 (re-read it if you have to), you explicitly said, "And the fact that everything under the sun runs 32-bit code." Start remembering, Camlorn. Don't lie to us, because your a horrible lyre. Not everything under the sun runs 32-bit code.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-02-26 00:32:32

Please go actually check some facts, because you're now saying very wrong things and about a minute of googling will prove it to you.
Everything under the sun that uses the X86 processor is capable of running 32-bit code.  This is completely different than saying that everything under the sun must therefore have a 32-bit processor.  Having a 64-bit processor is a sufficient condition to run 32-bit code because that's a thing 64-bit processors can do with a little help from your OS, and Windows is an OS that provides that little bit of help.
As for pointers, that's spelled out on a million different pages and books and processor manuals, but here's an MSDN page.  And I quote:

An int and a long are 32-bit values on 64-bit Windows operating systems. For programs that you plan to compile for 64-bit platforms, you should be careful not to assign pointers to 32-bit variables. Pointers are 64-bit on 64-bit platforms, and you will truncate the pointer value if you assign it to a 32-bit variable.

And Here's the OS X page that indicates that, for that platform, longs change size.
You could also write a program that uses sizeof to print variable sizes and compile it it on both.  Alternatively, you could realize that 4 GB is 2^32 unique bytes and that if you want to address more, you therefore need a bigger pointer data type.
As for tablets, you can plug keyboards in.  If you are not using one of the WinRT tablets, desktop apps can run.  If I really need to find a source for this I can, but a quick Google is not turning up anything isolated; everything is part of another article and how-tos are not reputable if we're going to go into the land of providing verification.  All the non-Arm Windows 8 tablets are laptops about as powerful as netbooks but with the keyboard removed, run X86 code just like their desktop counterparts, and have the same APis.

My Blog
Twitter: @ajhicks1992

2015-02-26 01:14:48 (edited by defender 2015-02-26 01:17:50)

God damn!  Ethin, you need to fix that infiriority complex of yours, it's really showing...


I don't even know what to say, it's just so damned obvious that Camlern knows what he's talking about and that your arguing just for the sake of it even though you don't know shit that their isn't any point in explaining it.


Stop wasting everyone's time trying to one up someone who has more years of experience than the time you've been alive, especially considering the relatively short time that you've been dicking around with code in.

2015-02-26 04:41:50

I'm not even going to reply to this any more unless I have to. I only recommended 64-bit because its newer and better, and what happeneds? A literal war breaks out because Camlorn says 32-bit is better. I'm tired of this. Why is it that whenever I post anything on a topic, anywhere, it breaks out into a fight? I just recommend something and someone else tries to prove there knowledge by posting book long posts. I'm tired of it.

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-02-26 06:38:02

Ethin, you started it and you have just been keeping it going. So camlorn was right and you were wrong that's no reason to start a war. I can guarantee you, you will be wrong a lot in your life it happens you have to learn to deal with it. Look at your posts you've completely lost control. Your the same way on dmnb sometimes.
For some reason camlorn seems to always be right lol. He has been helping me learn python and you should see all the stupid questions I have asked him. He doesn't act like a know it all but if you know things like computer science it's pretty easy to correct somebody when there wrong like you were.

Guitarman.
What has been created in the laws of nature holds true in the laws of magic as well. Where there is light, there is darkness,  and where there is life, there is also death.
Aerodyne: first of the wizard order

2015-02-28 00:28:59

Again, as I said, I recommend something and Camlorn has to contradict me. I'm no help if I'm always contradicted at every turn, am I?

"On two occasions I have been asked [by members of Parliament!]: 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out ?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question."    — Charles Babbage.
My Github

2015-02-28 00:58:17

No comment

2015-02-28 03:48:44

@defender if you had no comment, why'd you post post 24? There's no need to say "no comment;" if you have no comment than you wouldn't post.

It's true, in certain cases, that Camlorn does that Ethin. But you've got to realise: while it's very annoying, people will likely try out both of your ideas. Unless, we look at it from a different standpoint: everyone seems to think that Camlorn is the god of knoledge here on the forums, so I can see why they'd ignore you, some one who doesn't have as high as a reputation as Camlorn. So yeah. I can mostly side with you here.

If you have issues with Scramble, please contact support at the link below. I check here at least once a day, so this is the best avenue for submitting your issues and bug reports.
https://stevend.net/scramble/support