PDA

View Full Version : Compiling


BOAC
14th Jan 2009, 15:44
Having drawn a 'zero reply' to both my earlier posts about Perl and Javscript (No 1 son sorted that out) I am wondering if there any REAL computer programmers on here?:p I am seeking help on compiling C++ with Dev-C++ if anyone knows what that is?

Tocsin
14th Jan 2009, 16:48
I've not seen much here in that detail, but there are quite a few techie types on the Flyer forums (Non-aviation) - Aviation Forums for pilots - from FLYER Magazine (http://forums.flyer.co.uk/viewforum.php?f=6&sid=aa9677f23fc0f2b562863243d0217c5e)

Keygrip
14th Jan 2009, 17:50
At least you got a reply this time. :ok:

BOAC
14th Jan 2009, 20:10
Thanks, Tocsin - will check that out. Bunch of Gui-faced mousers you lot, grump grump grump......:p

Keygrip
14th Jan 2009, 21:35
Bunch of Gui-faced mousers

Have to admit - I am a big Disney fan, yesh.

"Hi, my name's keygrip - and I'm a mouse-a-holic".

planecrazy.eu
14th Jan 2009, 21:49
I have asked C and C++ and maybe even VB questions on here before, and got a reply.

My C and C++ has come on a little since then, so maybe i can reply or help.

Perl is a lost code to me, as i use PHP, even though some coders i know say Perl is better for automation.

I use Dev C++ too, V5 think it is, best freebie compiler i have found, prefer it to C++ Express.

Keef
14th Jan 2009, 22:52
I'm too lazy to mess with Perl and all that C+/- stuff.

Which is another way of saying I'm not clever enough, either. I did write an enormous machine code program years ago to send and receive radio teleprinter using a BBC "B" (so you can tell how long ago that was). It worked, too. I had about ten contacts using it and decided I prefer to talk to people rather than type at them (reprise: how long ago...)

bnt
15th Jan 2009, 00:17
Caution: I'm not a "real programmer", and I never learned C/C++, but I have compiled code successfully. I've had a look at the Dev-C++ website (http://www.bloodshed.net/dev/devcpp.html), and have a fairly good handle on what it is.

First of all: you don't need Dev-C++ at all to simply compile code: it's a development package (code editor etc.), not a compiler. It calls a separate compiler (gcc), which you need to get from somewhere: the website says that a Mingw32 environment (which I don't know) is bundled in the package - and I presume that includes gcc - fine by me if it works.

The website also mentions Cygwin (http://www.cygwin.com/), which I have used before to compile code I've downloaded. Cygwin is a complete UNIX shell for Windows, where you can install the bits you need, including gcc and other compilation programs, pretty easily. (Also great for learning UNIX commands before you try e.g. Linux.)

Whether that's your solution or not depends depends on what you're working with: are you trying to compile a program you wrote, or is it a package of code that you downloaded from somewhere? The reason I ask is that the compilation process is usually controlled by a "Makefile", sometimes with a configuration step before that. If you don't have a Makefile supplied, it looks like Dev-C++ has some way of creating one or helping you do so. In a typical compilation session, you don't actually compile the whole program at once, but lots of code modules which are "linked" to create the final program, and the Makefile automates this process.

If it's a downloaded code package, it should come with instructions in an INSTALL file or README. It might give you a sequence of commands to run, such as the following example:
open a command window, change to code directory
./configure (configuration step - not always required)
make (compiles the code - may take some time)
make install (installs the compiled program)

Configure or Make might stop, complaining that it can't find some library or command, so you have to find and install that bit - the requirements are usually in the code documentation.
Or, if you do it inside Dev-C++, it probably has some configuration dialogs where it asks you where to find the required bits - but the effect is the same. For all that compilation to work, all the required bits need to be findable i.e. the "path" must be set up to point to the various locations: the compilation programs (make, gcc, etc.), standard libraries, and any libraries required by that specific program.

It might just be easier for you to compile the code from the Mingw32 or Cygwin command shell directly, not from inside Dev-C++ - especially if it's a package you downloaded, not created in Dev-C++. And if you're none-the-wiser after all that, well, it's a bit hard to tell just what you need from that question..!

BOAC
15th Jan 2009, 07:45
Thanks all for the responses. I take back all the oooi-gui nasty stuff I said.....

My problem was:

Trying to get 'into' C from scratch as a cross-platform language, needing to complie to check progress and unable to get Dev-C to compile a simple prog written with a C++Gui module (damn - I've admitted it...). 'Normal' C code compiling seems to be hacked at an elementary level for me.

I find all the 'traditional' command line stuff like 'makefile' etc a total black hole at the moment, so was looking for a Windows interface (shame on me:)) to get going. I'll take a breather for now, thanks, as I have just discovered a new 'beta' called QTCreator which appears to do the whole lot in a oner.

Gertrude the Wombat
15th Jan 2009, 10:12
I am wondering if there any REAL computer programmers on here?
Yes. Been using C and C++ professionally since each was invented.

But you wouldn't like my rates, I suspect.

bnt
15th Jan 2009, 10:25
OK, so you're talking about compiling a program that you've written yourself. You don't say what happens when you try to compile it, just that you can't compile it, so it's hard to know what to suggest. If we assume that Dev-C++ is configured correctly, and all the bits are in their places, then could it be the program itself?

(As a general rule, if you ask for tech support of any kind, always describe what is happening, not what isn't happening!)

bnt
15th Jan 2009, 11:14
I just fired up the old Windows box and did the following:
- installed Dev-C++ v4.992, the Full package with the gcc compiler etc. Default settings, including creating the header cache.
- Ran it, created a new Windows Application project (in its own directory). The project already contains the basic code you need to create a Windows application.
- compiled it (Ctrl-F9), saving main.cpp in the process, without touching the code at all. No errors.
- ran it (Ctrl-F10): a blank "Windows App" with nothing in the window, which was pretty much what I expected.

See what I did there? I tested the basic installation of Dev-C++, one thing at a time, and described what happened. It shows that, in my case, it's installed and configured correctly. So, since all that works for me, then I can be pretty sure that problems I have later are not Dev-C++, or the compilation process, but in the code I write. At that point, I start looking for a Real Programmer... :E

BOAC
15th Jan 2009, 11:48
bnt - the post was my putting my toe in the water, since there had been no response to the previous enqs. hence the lack of info. I'm fairly sure no-one would want the 502 errors posted here. :}

The issue is using QTGUI with Dev-c to produce a GUI programme. I am certain it is the Dev set up too - it is knowing what to change that is the problem. Anyway - I'm playing with 'Creator' and it looks easier!

beerdrinker
15th Jan 2009, 12:35
BOAC,

You are a (ex) pilot. Leave all this programming stuff to the experts!!!!!! and get them (or a clever son) to do all that tricky stuff.

Keep well and enjoy your second retirement.

BD

BOAC
15th Jan 2009, 16:23
Cheers, BD! or a clever son - aha - now there's a problem...:O

Still, got to keep the old cells active - don't want to get into golfing.....

Keygrip
15th Jan 2009, 18:52
Bunch of Gui-faced mousers

to produce a GUI programme

"Do as I say, not as...."

:}

BOAC
15th Jan 2009, 20:37
"Do as I say, not as...."to compile a simple prog written with a C++Gui module (damn - I've admitted it...). -'nuff sed?:8

cdtaylor_nats
15th Jan 2009, 22:08
There seems to be some uncertainty over the language is it C or C++? The compiler for one will not compile the other.

BOAC
15th Jan 2009, 22:21
C++, CD - just saving typing. Widgets are QT