Welcome! Log In Create A New Profile


compiling problems

Posted by morris 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
compiling problems
February 22, 2007 06:54PM
please help if you can.
after installing the compiler and ide for cos112 i have a problem compiling projects. the error given is 'unable to run program file' (does not compile at all). i have tried all the suggestions in the tut letter (102), with the correct directories, make program, etc. there are no problems if i use just a single source file to compile and run a program.

i apologise if this is the wrong place to do this
Re: compiling problems
March 02, 2007 08:47PM
Hey morris

This is definately not the wrong place to post your problems winking smiley

Umm... I have no idea why the first year forums are so quiet... weird.

"there are no problems if i use just a single source file to compile and run a program." - so it's only giving errors on projects?

Probably best to get hold of a lecturer if the troubleshooting notes don't help you
Re: compiling problems
March 07, 2007 06:25AM
hey SanozOr

thanks for replying.
Indeed I only have problems with projects and and not single files. I am highly suspisious that it is the result of something simple I have overlooked, yet try as I might, I cannot seem to resolve the problem.
Has no-one else experienced a similar thing and (hopefully) sorted it out?

I am off to try find a lecturer,
Thank you
avatar Re: compiling problems
March 07, 2007 01:38PM
I had excatly the same problem, but for the life of me cannot remember how I fixed it.

If I remember correctly it had something to do with the files attached to the project and I started using the default directory for saving projects and files.

Don't know if this will help, but I hope it does.

COS 112-V this year or not
March 07, 2007 08:59PM

This is my first year at UNISA and i'm registered for 11 mods. Only through practice did I notice this might be a bit much because nobody opon registration was clear when I asked If this is to much.
Anyway so I am registered for both cos111-u and cos112-v this year and more than once the tut letters recommend that if "you don't have any experience" bla bla "then it is strongly recomended to cancel this cource". Now what is experience, I did java at school <I understand it well> I'm making good progress in my cos114-x mod (delphi), I did a bit of visual basic for fun during my schooling period. So is this experience or not. I have no problem grasping what is going on, but with a different language you need to work through it to understand completely - even though it may be easy. So cos111 is really simple to me but i need to work through it so naturally when I tried to do some of the work in cos112 i did not have a full understanding. It says revise cos111 to refresh your memory. Now puting the amount of work aside, Is it wise to continue with this mod (cos112) this year or not really. Should I complete 111 first.

I would really appreciate your help.
p.s: Sorry for the long letter.

Thanks again
Re: compiling problems
March 09, 2007 03:29PM
I remember having a similar problem when I used devc++.

I'm not to sure if this is the cause of your problems but remember since the project file links all you source files, the source files need to be saved before the project file, and only once this is done, should the project be compiled. And also remember that when you load your project do so by loading the project file and not one of the source files.

Hope you come right.

"I don't give a damn for a man that can only spell a word one way."
Re: COS 112-V this year or not
March 09, 2007 03:48PM
Hi Tuomas, you should have started a new thread for your post since it is a different topic, but anyway.

When I was in first year I did 12 modules including cos111 and cos112, and I remember having the same thoughts as you (and you seem to have more experience than I did at the time). I'm not to sure if your assignment dates are similar to when I did my first year, but I remember that cos111's first assignment was quite a while before cos112's one. I just used the assignment dates as a guideline for my work, and I ended up managing cos112 fine. I did battle a bit with cos112 for the first assignment, but once you get into cos111 you can get through the work really quickly. So I guess what I'm saying is that I would recommend sticking it out. I'll try help you guys with problems that you have, I had a friendly honors student help me out when I was in 1st year, so I decided when I got there I would try help out other students.

Good Luck with all and to all

"I don't give a damn for a man that can only spell a word one way."
Re: compiling problems
March 11, 2007 06:42PM
Hi people

I hate to be the one just not getting it, but I don't seem to be coming right. From all the suggestions being put forward it seems to be something with the saving of the project/files. I now have an alarming amount of uncompiled hello worlds all over my computer, saved in all sorts of ways. If anyone can spot the error in the following it may help.
1. Open devC++, go to File|New|Project
2. Select console application, give it a name (i.e. Project5) and click on OK
3. Save File dialog box pops up, save in default (C:\unisa\devcpp) under same name (Project5)
4. Write necessary statements, File|Save and save in same directory as before.
(Here I have tried all sorts of saving and orders of doing things but I tend
use the way shown in the tut letter 102. I have also saved in different locations, including C:\unisa\cos112)
6. Click on compile, read bottom of screen, bang head on table repeatedly

I apologise for presenting nothing but problems and I am trying so work this out myself, not just sitting back hoping someone does it for me, but any help or suggestions will be much appreciated.
Re: compiling problems
March 11, 2007 09:51PM

Did you install your dev-C++ to the default directory with its installation? i.e "C:\unisa\devcpp".

A "2(some path)\2 unable to run program file" error will occur if Dev-c++, can't find one of the programs needed for compiling your project, usually it is make, gcc or g++.

Go to Tools - Compiler Options - Programs and check that each .exe that is linked is found in that folder (click on "..."winking smiley. If the specified file is not there, then select it from the mingw\bin folder.

If these where not set up correctly, chances are you haven't set up your Tools - Compiler Options - Directories - Binaries properly. Your "..\mingw\bin" dir should be the only directory for binaries.

Hope this helps, I know how frustrating it can be to not be able to get a compiler working, especially if you need to get working on your programming.

"Computer Science is no more about computers than astronomy is about telescopes"
Re: compiling problems
March 14, 2007 01:24PM
Hey Morris
Just wanted to check.. have you managed to come right?
Re: compiling problems
March 15, 2007 07:50AM
hello again

My internet access is a bit sketchy at times, so I apologise about delays in posts and replies.

I have had some results but not out of the woods yet. By changing the compiler in Projects|Project Options from default to MingW32, the program seemed to try to compile, but eventually gave the error about undefined reference to '_monstartup', (as well as the [Build Error]exe.***[First.exe]Error1). As per tut letter 102, I went to Project Options|Compiler changed the setting on code profiling to No (and did the same in Tools|Compiler Options, etc.). This resulted in the following messages when I attempted to compile:
[Linker error] undefined reference to 'mcount' (several times)
with the same undefined reference to '_monstartup' thrown in, and ending with the same [Build Error...] mentioned earlier.
The make program is set to ming32-make.exe in Compiler Options.

My question is are there any important settings in Project Options that may be responsible, i.e.
Should compiler be default or MingW32?
In Directories, should Library and Include be empty or same as in Compiler OPtions|Directories?
In Makefile should everything be blank (no custom or included files)?
In Compiler should everything be set to no (they currently are)?
Anything thing else?

Note: Everything is installed to default (C:\unisa....)

Thanks for all previous suggestions and help, every little bit helps. Sense will prevail (hopefully).
Re: compiling problems
March 15, 2007 09:25AM
If you have set up your directories correctly your compiler should be defualt.
I haven't used dev-c++ in a while so I just set it up and works fine, my directories settings are:

C Includes:
C++ Includes:

and no other directories have been included for anything.

For Tools - Compiler Options - Programs, the make program is set to gmake.exe, not ming32-make.

Under your project options you don't need to change anything, leave your compiler as defualt compiler, the dir and makefile settings empty, and everything set to "no" under compiler.

I can't imagine what could be wrong, but whatever it is I'm sure it is a small thing.
Re: compiling problems
March 16, 2007 08:08AM
Good morning people, and a bright morning it is indeed!

My problem is solved, and indeed it was an embarrassingly small and simple thing. The compiler was set to MingW32, not default and I never saw a problem with that. I did try changing it (I changed basically all the settings at one time or other) yet I obviously didn't pursue that avenue quite enough, as the directories for library and include were set to the directories I used last year for cos111 (ironically not installed in the default directories but with no problem).

Massive thanks to all who responded with help and suggestions (esp. gaf whose last post held the vital link), I really do appreciate it and apologise for bothering you helpful people for so long about this silly thing.

smile <-- Feel free to slap my gleefully smiling face.

Now, anyone know about delphi problems? Just kidding. Thanks a ton and so long for now.
Sorry, only registered users may post in this forum.

Click here to login