mmcgaw
Posts: 2
Joined: Thu Dec 04, 2014 3:13 pm

GCC installation difficulties

Thu Dec 04, 2014 3:25 pm

Hello:

I am a relative newbie on RISC OS, but have managed to get the hang of this system.

I am working to establish an ability to compile C/C++ code, and have successfully gotten GCC 4.1.2 installed via PackMan. I have been able to get the compiler to start and to begin processing helloworld.c, which has been no mean accomplishment. After sizing up Next to >6MB, setting the path to the folder containing helloworld.c and then ensuring that DDEUtils was loaded to be able to handle long command lines (compilation would error out unless this was done), the compiler runs, but eventually generates the error: collect2: 'ld' not found.

I installed the utility Locate and did a search for ld, and find that this is present in the GCC installation.

What gives? What else must be done to get this compilation and link process to complete? Anyone know?

-M

User avatar
joan
Posts: 14274
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: GCC installation difficulties

Thu Dec 04, 2014 4:18 pm

Linux has the concept of paths to search for programs to execute. If the program isn't found on one of the paths you get an error like that. On Linux the paths would be set to something like /bin, /usr/bin, /local/bin etc.

Perhaps RISCOS has the equivalent and you need to make sure that ld is in the path.

SEDev
Posts: 34
Joined: Thu Aug 02, 2012 10:55 pm

Re: GCC installation difficulties

Fri Dec 05, 2014 2:45 pm

If 'ld' can't be found then that suggests that the system variable GCCbin$Path hasn't been set. This is normally done when you run GCC. To check if the sysvar is set open a TaskWindow using Ctrl-F12 and enter Show GCC*. If the sysvar isn't listed then you'll need to run GCC before compilation.

If you plan to use GCC regularly then you can add it to the list of apps started at boot-up to avoid having to run it manually all the time. Double-click !Boot, then click Boot, then click Run and drag GCC to the window's scrolllist. Click Set when done and next time the system boots up it will automatically run GCC.

HTH

mmcgaw
Posts: 2
Joined: Thu Dec 04, 2014 3:13 pm

Re: GCC installation difficulties

Wed Dec 10, 2014 9:58 pm

Running Locate finds ld in: !GCC.bin. (this is off the SD card root via Apps.Development and so on).

This is ALSO what Show GCC* reveals: that the GCCbin$Path includes the very same string that describes the path found by Locate, above.

So, it appears all is as it ought, and yet, I still get the collect2 error with ld not being found.

As a work around, I bought DDE25 and installed this, but it is a bit of a different dialect and does not seem to process my source files in the same way gcc does. I can get the usual hello world to compile and link with DDE25, but sources that run through cleanly on gcc throw errors in DDE25.

So, I am back to gcc, and trying to get this operational.

Any other clues you can suggest?

-M

Return to “RISCOS”