Dark Bit Factory & Gravity
PROGRAMMING => C / C++ /C# => Topic started by: combatking0 on January 30, 2012
-
Which is the best free or paid for C++ or C# compiler available?
Are there any big differences between them?
With the dawn of the Raspberry PI, and the continuing drop of support for Flash by various software giants, I'm looking into picking up C style coding again (I coded 30 lines of it in university about 10 years ago).
It's time I got my teeth into a compiled language. ;D
-
Most Windows users use VC++ as it's a pretty decent compiler and an okay IDE (which is really great with some addons) and it's free if you stick to the Express edition.
Linux users use GCC. The only IDE I can recommend is QtCreator (all others suck ass) which is probably a bit too much Qt-oriented if you're not planning to use it.
-
I'm in the same boat and thinking along the same lines!
Before I had any coding experience at all I foolishly attempted C++ but failed miserably... I believe I didn't even get past installing the IDE etc. I think I'm as ready as I'll ever be for another attempt! :)
-
Before I had any coding experience at all I foolishly attempted C++ but failed miserably... I believe I didn't even get past installing the IDE etc.
Hmm, maybe I could set up an example project to make the start a bit simpler...
What exactly are you heading for?
-
I'll try VC++ Express to begin, and upgrade to either the paid for version or the GCC compiler if I need more functionality.
I think I'll start with something simple, like creating a window and drawing some lines in it. It doesn't sound like much, but it's enough for a simple wireframe, and I'll be able to find my way round the basics of C++.
Thanks hellfire :D
-
That would be a great help, thanks for the offer Hellfire! My initial C++ fumblings are a long time ago though, so I should have a better understanding of things now. VC++ looks good.
I'm only interested in visual FX and playing around with sound generation etc. (though that seems like a tough subject judging from Raizors thread about soft synths). CK's line drawing sounds like a good 1st project!
[EDIT] Aha, forget lines, I'm going to try and port over my JS plasma to C++! :)
-
Aha, forget lines, I'm going to try and port over my JS plasma to C++! :)
So we're talking about filling a pixel-buffer?
-
I installed VC++ 2010 and the first look at the interface confused and scared me a bit. So now I guess any comprehencible little project that does something absurdly simple would be a really great starting point! I'm going to read up on some starting docs as well.
@CK
I feel like I need your blessing for rudely jumping in here and hitching a ride in your thread? I was about to make a thread like this any day now, but you beat me to it. :)
-
File->New Project->Visual C++->Win32.
Win32 Project.
"MyHotDemo"
Application Settings
Checkbox "Empty Project"
Right click "Source Files", Add->New Item. C++ File (.cpp)
"MyHotDemo.cpp"
#include <windows.h>
INT WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR lpCmdLine, INT nCmdShow)
{
//insert sensational Windows demo code here.
return 0;
}
Debug->Start Debugging
Easy! Er...
Jim
-
'myHotDemo.exe': Loaded 'C:\Users\Public\Documents\Programming\C++\myHotDemo\Debug\myHotDemo.exe', Symbols loaded.
'myHotDemo.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'myHotDemo.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'myHotDemo.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
'myHotDemo.exe': Loaded 'C:\Windows\SysWOW64\msvcr100d.dll', Symbols loaded.
The program '[2552] myHotDemo.exe: Native' has exited with code 0 (0x0).
It returned zero, great succes! That was easy, I think I'm ready for pixel buffers now! ;D
Thanks jim, should I be worried about the missing PDB file?
-
You should only worry if you want to debug kernel32.dll, in which case you can get them from Microsoft's symbol server. :P
Maybe here is where you want to go next http://www.dbfinteractive.com/forum/index.php?topic=1714.msg25852#msg25852 (http://www.dbfinteractive.com/forum/index.php?topic=1714.msg25852#msg25852)
I'm surprised I can't find any of our Windows framework code posts anywhere...
Jim
-
I'm surprised I can't find any of our Windows framework code posts anywhere...
Jim
I'm not sure if you're meaning anything like this for buffers in the gdi:
http://www.dbfinteractive.com/forum/index.php?topic=1200.0
but the original link you gave in the thread doesn't work and all that's left is what I butchered from it.
-
So now I guess any comprehencible little project that does something absurdly simple would be a really great starting point!
You can have a look at this (http://www.dbfinteractive.com/forum/index.php/topic,4102.0.html).
I'll try to put something more decent together as soon as I find some time.
-
Excellent! Very tidy and readable plasma code (looks great too!), thanks a bunch for that! :)
I've been exploring form elements and events today and starting from the ground. All is going surpringly well so far, I'll be patching Windows (to make it work) before you know it! ;D
Thanks for pulling me well over the biggest hurdle all, I should be able to find my way from here!
Any good book recommendations? Prefferably graphics related, quality books can be hard to find amidst the many.
-
Excellent! Very tidy and readable plasma code (looks great too!), thanks a bunch for that! :)
I've been exploring form elements and events today and starting from the ground. All is going surpringly well so far, I'll be patching Windows (to make it work) before you know it! ;D
Thanks for pulling me well over the biggest hurdle all, I should be able to find my way from here!
Yay! :)
-
@CK
I feel like I need your blessing for rudely jumping in here and hitching a ride in your thread? I was about to make a thread like this any day now, but you beat me to it. :)
No problem - this is a forum, and we can learn about new things together.
-
MssgBoard culture / etiquette can be difficult some times, thanks. ;)
-
After a 2 hour installation, I have found that the trial MS Visual C++ doesn't seem to produce .exe files. I click on Build in the menus, and the report comes back successful, but the exe is nowhere to be found.
I'll try a gnu version. I've heard the Intel version creates exes which run sub-optimally on non-Intel CPUs.
-
After a 2 hour installation, I have found that the trial MS Visual C++ doesn't seem to produce .exe files.
If with "trial" you're talking about visual c++ express (which is not a trial but just free of charge), the exe is in the sub-folder "debug" or "release" (depends on your project configuration) relative to your project file (.vcproj).
Can you start your application from the ide (it does nothing else than running the exe) ?
-
Both folders are empty :(
There may be a problem with the installation.
I have tried the Borland C++ compiler as well. It generates an exe, but that complains about missing dlls. This would make it inconvenient for distribution, but not a complete disaster. Unfortunately the exe, when in the same folder as the dlls returns an error message saying the program had to close.
The code I have tried is as follows:
#include <iostream>
int main(){
std::cout << "This is a test message.";
return 0;
}
I have also tried it with iostream.h but I get the same error.
-
Can you please try this sample project?
(VC2010 will tell you that it needs to be converted because I'm still working with 2005 but that's no problem).
-
The compiled exe in the package you made runs perfectly, but if I move it to a different folder and try to re-build it, nothing is created.
I have tried the same source in Borland, but it results in the same error as before.
I will try installing the compilers on a different computer.
-
Just remembered having a similar problem once when some overeager virus-protection immediately moved my just-created exe into quarantine.
Or is this Win7 and the application is not privileged to write to disc?
If VC++ really does not create the exe there must be some sort of error - can you post the "output" log?
-
I'll put the information up when I get home. I'll give it a try on my friend's Vista computer while I'm over here.
-
The output log is as follows:
========== Build: 0 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
But there is no output to be found.
I have tried Code::Blocks with the MinGW compiler installed, and it works perfectly - I will go with that for the time being. Thank you for your assistance so far. K++
-
I'm now up to the point where I'm porting my knowledge of JavaScript / ActionScript into C++ for mathematical & text based operations:
// Roll a 20-sided dice 30 times
#include <iostream>
#include <cstdlib>
#include <time.h>
using namespace std;
const int BASE = 1;
const int MAX = 20;
int main(){
int rolled = 0;
time_t seconds;
time(&seconds);
srand((unsigned int) seconds);
for(int i=0;i<30;i++){
rolled = rand()%(MAX-BASE+1)+BASE;
cout << rolled << endl;
}
return 0;
}
Am I correct in thinking that I need to investigate OpenGL for portable graphic functions. DirectX would be fine for Windows only, but can OpenGL work across multiple OS platforms, such as Windows, Mac, Linux/Unix, etc?
That said, I may need to import extra compilers for Mac & Linux, but according to the documentation, that's easy to do with Code::Blocks.
-
Am I correct in thinking that I need to investigate OpenGL for portable graphic functions. DirectX would be fine for Windows only, but can OpenGL work across multiple OS platforms, such as Windows, Mac, Linux/Unix, etc?
OpenGL is multi-platform, so a good choice for accelerated graphics if you want to port to other platforms. You could also use something like SDL (http://en.wikipedia.org/wiki/Simple_DirectMedia_Layer), but that's going to bump the size up quite a bit. I found OpenGL a bit tricky to get started with, but it starts making sense quite quickly :)