log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- Archive Edition 27:2 reviewed (News:)
- RISC OS 5.30 arrives (News:12)
- Rougol Talk May 2024 - Andy Vawer (News:)
- Rougol May 2024 meeting on monday with Andy Vawer (News:1)
- WROCC May 2024 meeting - Gerph talks games (News:)
- Drag'n'Drop 13i3 edition reviewed (News:1)
- Wakefield Show 2024 in Pictures (News:5)
- April 2024 News Summary (News:2)
- Upgrading your RISC OS system to 5.30 (News:2)
- WROCC May 2024 meeting on wednesday - Gerph talks games (News:)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
Site Search
 
Article archives
The Icon Bar: Programming: OSLIb, GCC and Sourcery
 
  OSLIb, GCC and Sourcery
  sorvad (08:39 6/4/2007)
  sorvad (14:17 6/4/2007)
    Phlamethrower (15:24 6/4/2007)
      sorvad (20:11 6/4/2007)
      sorvad (14:47 7/4/2007)
        sorvad (10:37 8/4/2007)
          Phlamethrower (11:57 8/4/2007)
            sorvad (21:42 8/4/2007)
              Phlamethrower (22:17 8/4/2007)
                sorvad (07:27 9/4/2007)
                tlsa (10:50 10/4/2007)
                  VincceH (13:10 10/4/2007)
              adamr (17:39 9/4/2007)
  adamr (18:06 9/4/2007)
    sorvad (09:03 10/4/2007)
      Phlamethrower (10:57 10/4/2007)
      adamr (11:43 10/4/2007)
        sorvad (11:21 11/4/2007)
          sorvad (11:58 11/4/2007)
            monkeyson2 (12:08 11/4/2007)
              sorvad (12:14 11/4/2007)
                monkeyson2 (12:33 11/4/2007)
                  sorvad (12:39 11/4/2007)
 
sorvad Message #101135, posted by sorvad at 08:39, 6/4/2007
Member
Posts: 68
I'm just starting to experiment with C after about 12 years.

I've installed GCC and sourcery and OSLib.

I've written some very simple code that has OSLib as a library but it won't compile. I don't even include any of the OSLib headers. All I've done is create a simple hello world program, then clicked the include icon in the project window, selected templates and dragged OSLib into the library.

I compile I get the following errors;

cc1: /C:: Input/output error
cc1: /OSLib:: Input/output error
cc1: /OSLibInclude:: Input/output error
cc1: /OSLibSupport:: Input/output error

If I remove the OSLib entry from the Sorcery include paths all is well.

Do I need to put OSLib libraries somewhere specific for sourcery to know where there are or am I missing something ?

Any help appreciated as I'm very rusty on both C and RiscOS.
  ^[ Log in to reply ]
 
sorvad Message #101137, posted by sorvad at 14:17, 6/4/2007, in reply to message #101135
Member
Posts: 68
Weird, I've just noticed that the example given in the docs for GCC using unixlib is now giving the same error for this library. Yet this was working and I've made no changes to the example project. I've tried restarting but the error persists.

I'm probably making a fundamental mistake somewhere in the set up or changed something that I'm unaware of.
  ^[ Log in to reply ]
 
Jeffrey Lee Message #101140, posted by Phlamethrower at 15:24, 6/4/2007, in reply to message #101137
PhlamethrowerHot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff

Posts: 15100
I've never used Sourcery, and have hardly used OSLib, but the first thing that comes to mind is that you haven't set up the OSLib paths. There should be a 'setvars' obeyfile in OSLib somewhere. If not, double-check the readme file.
  ^[ Log in to reply ]
 
sorvad Message #101144, posted by sorvad at 20:11, 6/4/2007, in reply to message #101140
Member
Posts: 68
Thanks for your reply, thing with Sourcery is it supposed to handle all paths for you. You just tell it what you want to use and it sorts all the library paths for you. Although I've only just started using it and I'm having some issues I'm extremely impressed with it, it seems an excellent piece of software. I'll try contacting the author see if he can help me, even though I'm probably just being thick somewhere.
  ^[ Log in to reply ]
 
sorvad Message #101152, posted by sorvad at 14:47, 7/4/2007, in reply to message #101140
Member
Posts: 68
Yes, after some investigation the paths weren't set up. I just ran the SetVars file within this folder. Thanks for that pointer.

However I still have a problem with it giving the following error :

"Cannot find file 'UnixLib:o.unixlib'"

However I cannot find a SetVars file for the UnixLib var. Nor does there seem to be an object 'o' folder within the UnixLib directory anyway.

I'm quite puzzled at the moment.

[Edited by sorvad at 14:47, 7/4/2007]

[Edited by sorvad at 14:48, 7/4/2007]
  ^[ Log in to reply ]
 
sorvad Message #101162, posted by sorvad at 10:37, 8/4/2007, in reply to message #101152
Member
Posts: 68
OK, not sure why I didn't find the o folder before but I've located it now. It's in GCC folder and buried quite deep by default. I've set up SetVars file in the directory that the o folder for unixlib is within and entered the line

Set UnixLib$Dir <Obey$Dir>

And run it.

But I still get the error

"Cannot find file 'UnixLib:o.unixlib'"

Even though the file unixlib is present within the o directory.

How do I check UnixLib is set correctly. Apologies as I know this will be easy but I am very rusty as previously mentioned.

[Edited by sorvad at 10:38, 8/4/2007]
  ^[ Log in to reply ]
 
Jeffrey Lee Message #101164, posted by Phlamethrower at 11:57, 8/4/2007, in reply to message #101162
PhlamethrowerHot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff

Posts: 15100
Try 'Set UnixLib$Path <Obey$Dir>.' instead. Note the $Path, and the . on the end.

Declaring a system variable as $Path will allow you to use it similar to if it were a disc name. So instead of:

ADFS::4.$.foo.blah

You could do:

Set Wibble$Path ADFS::4.$.foo.

And then refer to the file 'blah' as Wibble:blah. It's customary to include the . on the end of the definition of the path variable, but isn't required.

Regular <Obey$Dir>-style system variables require you to substitute the entire variable name, i.e.

Set Wibble$Dir ADFS::4.$.foo

<Wibble$Dir>.blah

Hope that helps smile

In the past, standalone copies of UnixLib were available, which I suspect would have set up the UnixLib$Path variable for you. But because GCC now uses internal copies, it doesn't bother setting the paths, hence the problems with Sourcery.
  ^[ Log in to reply ]
 
sorvad Message #101171, posted by sorvad at 21:42, 8/4/2007, in reply to message #101164
Member
Posts: 68
Thanks for all your replies. I still can't seem to persuade Sourcery to work with my GCC installation so for now I'm going to cut my losses with it and just learn to use GCC manually.

Any other tools that you may recommend though to use with GCC ? or would you just go with what is supplied.
  ^[ Log in to reply ]
 
Jeffrey Lee Message #101174, posted by Phlamethrower at 22:17, 8/4/2007, in reply to message #101171
PhlamethrowerHot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff

Posts: 15100
Any other tools that you may recommend though to use with GCC ? or would you just go with what is supplied.
I just work with GCC. Once you've learnt how to use makefiles it's quite easy to manage small or large projects. I haven't really tried tools like Sourcery, though - so it may be possible that they are easier than doing it manually (once you've got them working right).

My only recommendation to you is to make sure you use a decent text editor smile

http://stronged.iconbar.com/

I find that the StrongHelp manuals are also an invaluable resource (although they are occasionally inaccurate or don't go into enough detail)

http://sudden.recoil.org/stronghelp/
  ^[ Log in to reply ]
 
sorvad Message #101176, posted by sorvad at 07:27, 9/4/2007, in reply to message #101174
Member
Posts: 68
Thanks for all your help and advice.

Yes, back when I used to use the Acorn C Compiler I used to use StrongEd and was one of the first things I downloaded this time round.

I really need to dig out all my manuals although some will be out of date in some areas. I've got the programmers reference manuals for RiscOS 2 and 3 safely stored away and RO-PR3 should be ready to see the light of day again soon, and I'm guessing a lot of what's in 3 will still be valid.

I've no reference to RiscOS beyond these though, are there any major prints I should considering buying ?
  ^[ Log in to reply ]
 
Adam Message #101185, posted by adamr at 17:39, 9/4/2007, in reply to message #101171
Member
Posts: 112
Hi,
I use Sourcery with GCC (though with DeskLib, not OSLib) without any problems. I'd be happy to send you a working example project for you to investigate if you'd like - or you could send me your project and I'll see if I can get it to work here. I'm not sure you need to be messing round setting up stuff for unixlib as it's all built in to GCC nowadays. (On the subject of setting system variables... the OSLib "setvars" file is not a standard one so there's no reason unixlib would have one. Also, you can use choices>start actions to set things up when you run Sourcery if you like.)
Adam

[Edited by adamr at 17:57, 9/4/2007]

[Edited by adamr at 17:58, 9/4/2007]

[Edited by adamr at 11:55, 11/4/2007]
  ^[ Log in to reply ]
 
Adam Message #101186, posted by adamr at 18:06, 9/4/2007, in reply to message #101135
Member
Posts: 112

cc1: /C:: Input/output error
Huh, I've just gone back to my original Sourcery tutorial and got exactly this error. Removing UnixLib from the include paths fixed it. I think the manual is out of date.

Adam

P.S.
RiscOS.
It's actually RISC OS - some people get worked up about such things wink
  ^[ Log in to reply ]
 
sorvad Message #101209, posted by sorvad at 09:03, 10/4/2007, in reply to message #101186
Member
Posts: 68
Thanks for that Adam. It was just the tutorial I was having issues with as I'd not progressed any further due to the issues.

I've actually got further now using an old fashioned makefile, but I still like the look of sourcery so will have another look at it, perhaps today.

The OSLib issues I had licked. I've actually messed with it quite a lot so I think I'll clean install it again before having another go. Would just deleting the program folder be sufficient or are there any settings stored anywhere else that you know of ?

I shall endeavour to use RISC OS from now on smile
  ^[ Log in to reply ]
 
Michael Drake Message #101210, posted by tlsa at 10:50, 10/4/2007, in reply to message #101174

Posts: 1097
My only recommendation to you is to make sure you use a decent text editor smile

http://stronged.iconbar.com/
http://zap.tartarus.org/

[Edited by tlsa at 10:54, 10/4/2007]
  ^[ Log in to reply ]
 
Jeffrey Lee Message #101211, posted by Phlamethrower at 10:57, 10/4/2007, in reply to message #101209
PhlamethrowerHot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot Hot stuff

Posts: 15100
The OSLib issues I had licked. I've actually messed with it quite a lot so I think I'll clean install it again before having another go. Would just deleting the program folder be sufficient or are there any settings stored anywhere else that you know of ?
Just deleting the folder should be enough.

My only recommendation to you is to make sure you use a decent text editor smile

http://stronged.iconbar.com/
http://zap.tartarus.org/

[Edited by tlsa at 10:54, 10/4/2007]
frown
  ^[ Log in to reply ]
 
Adam Message #101213, posted by adamr at 11:43, 10/4/2007, in reply to message #101209
Member
Posts: 112
Would just deleting the program folder be sufficient[?]
Should be. Applications on RISC OS are generally self contained. The only information which is retained across sessions is generally stored in "Choices" and is only accessed once you re-run the app in question. To see where this is, open a task window (press Ctrl-F12) and type Show choices* (The * is a wildcard.)

The "system variables" (as per Show) are wiped every time you restart.

Adam
  ^[ Log in to reply ]
 
VinceH Message #101214, posted by VincceH at 13:10, 10/4/2007, in reply to message #101210
VincceH
Lowering the tone since the dawn of time

Posts: 1600
My only recommendation to you is to make sure you use a decent text editor smile

http://stronged.iconbar.com/
'stet'
  ^[ Log in to reply ]
 
sorvad Message #101242, posted by sorvad at 11:21, 11/4/2007, in reply to message #101213
Member
Posts: 68
I've finally got sourcery going again.

I'd tried just deleting the app twice before but the problem persisted. I've since discovered that there is a choices folder for sourcery set within the choices folder of !Boot. In here it stores all manner of items.

Deleting this along with the app (I suspect I could have got away with just deleting the choices folder and the app would have reset them) enabled me to knock up an "Hello World" program. Before it wouldn't even compile that.

So where did things go wrong. Well, not sure. It initially worked, when I moved on to example two and including UnixLib it may have gone wrong there but I was so rusty any problems I deemed to be caused by myself and I fumbled around for some time before I even noticed that example 1 was now failing.

So some of my messing may have been the fault or trying to explicitly use UnixLib.

I'll keep all these suggestions in mind in case this happens again and if it does I'll try and pin it down more accurately in case anyone else has the same issue. But I think that Adam may have hit the nail on the head with his suggestion of removing UnixLib from the path).

Again, thanks for all your quick responses.
  ^[ Log in to reply ]
 
sorvad Message #101244, posted by sorvad at 11:58, 11/4/2007, in reply to message #101242
Member
Posts: 68
I've just tried including OSLib and got

cc1: /C:: Input/output error

But I've not got UnixLib included at all. However I checked the definition for OSLib by going into choices on the sourcery icon menu and this showed the following definition;



For some reason it has C: defined. I don't know exactly what this is for but my OSLib SetVars doesn't define a C: nor do I know what does. Simply removing that entry allowed the code to compile. However I'm not sure if something else will be broke because of it. I think previously as I was so inexperienced my messing about with all the settings probably caused more harm than good.
  ^[ Log in to reply ]
 
Phil Mellor Message #101245, posted by monkeyson2 at 12:08, 11/4/2007, in reply to message #101244
monkeyson2Please don't let them make me be a monkey butler

Posts: 12380
C: is the standard C library provided with the Acorn/Castle tools.
  ^[ Log in to reply ]
 
sorvad Message #101246, posted by sorvad at 12:14, 11/4/2007, in reply to message #101245
Member
Posts: 68
Mmmm... that begs a question, although it compiles and links, do I need that library to use OSLib with GCC ? At present I'm not calling any functions, just linking in the libraries as a test.
  ^[ Log in to reply ]
 
Phil Mellor Message #101247, posted by monkeyson2 at 12:33, 11/4/2007, in reply to message #101246
monkeyson2Please don't let them make me be a monkey butler

Posts: 12380
You should be fine:

http://ro-oslib.sourceforge.net/faq.html#command%20line
  ^[ Log in to reply ]
 
sorvad Message #101248, posted by sorvad at 12:39, 11/4/2007, in reply to message #101247
Member
Posts: 68
Thanks.
  ^[ Log in to reply ]
 

The Icon Bar: Programming: OSLIb, GCC and Sourcery