Topics

Errors linking A18 on the Mac OSX #Assembler

Joe Blackburn
 

Okay, Herb and any who have experience compiling A18.

I managed to figure out that I could compile under XCODE or in the Terminal app (Mac's Command Line) using gcc.

So it's essentially a Linux (Darwin) compile.

It dies in the Linker, with the annoying but persistent:

ld: symbol(s) not found for architecture x86_64

 

clang: error: linker command failed with exit code 1 (use -v to see invocation)


I'm attaching a capture of the output.
 
Hopefully someone with more up to date gcc skills can tell me how to fix this. If memory serves, these are symbols being used but not defined. But they have been declared and the code compiles elsewhere.
 

David Schultz
 

On 7/20/19 9:34 AM, Joe Blackburn via Groups.Io wrote:


Try: sudo gcc -I. a18.c a18util.c a18eval.c -o a18

(You want to compile a18.c, not send the output to it.)



--
https://web.archive.org/web/20190214181851/http://home.earthlink.net/~david.schultz/
(Web pages available only at the Wayback Machine because Earthlink
terminated that service.)

Joe Blackburn
 

Turned out it was whining about the reference to malloc.h

There is no longer a malloc.h on the Mac. So we create one:

touch malloc.h

then the error was because of the angle brackets in the a18.c #includes. Changed it to #include "a18.h" with quotes instead of brackets.

That's it. After that it complies clean and executes!

Dave - I ended up using this:

 

gcc -o a18 a18.c a18eval.c a18util.c -Wall 2>wallerrors.txt

to capture errors/warnings.


So A18 now runs on the Mac OSX - I'm using High Sierra 10.13.6.

Neil Cherry
 

On 7/20/19 11:26 AM, David Schultz wrote:
On 7/20/19 9:34 AM, Joe Blackburn via Groups.Io wrote:
Try: sudo gcc -I. a18.c a18util.c a18eval.c -o a18
Yikes! sudo for a compile should never been needed.

--
Linux Home Automation Neil Cherry ncherry@...
http://www.linuxha.com/ Main site
http://linuxha.blogspot.com/ My HA Blog
Author of: Linux Smart Homes For Dummies

Mark Abene
 

1) You shouldn't be using sudo. Nothing here requires root access.
2) If you had added the -I. argument, you wouldn't need to change the angle brackets to quotes, but technically they should be quotes.

-Mark


On Sat, Jul 20, 2019, 8:57 AM Joe Blackburn via Groups.Io <josephjohnblackburn=yahoo.ca@groups.io> wrote:

Turned out it was whining about the reference to malloc.h

There is no longer a malloc.h on the Mac. So we create one:

touch malloc.h

then the error was because of the angle brackets in the a18.c #includes. Changed it to #include "a18.h" with quotes instead of brackets.

That's it. After that it complies clean and executes!

Dave - I ended up using this:

 

gcc -o a18 a18.c a18eval.c a18util.c -Wall 2>wallerrors.txt

to capture errors/warnings.


So A18 now runs on the Mac OSX - I'm using High Sierra 10.13.6.

Mark Abene
 

Also, rather than creating an empty malloc.h, which makes little sense, just remove the include from your source.


On Sat, Jul 20, 2019, 8:57 AM Joe Blackburn via Groups.Io <josephjohnblackburn=yahoo.ca@groups.io> wrote:

Turned out it was whining about the reference to malloc.h

There is no longer a malloc.h on the Mac. So we create one:

touch malloc.h

then the error was because of the angle brackets in the a18.c #includes. Changed it to #include "a18.h" with quotes instead of brackets.

That's it. After that it complies clean and executes!

Dave - I ended up using this:

 

gcc -o a18 a18.c a18eval.c a18util.c -Wall 2>wallerrors.txt

to capture errors/warnings.


So A18 now runs on the Mac OSX - I'm using High Sierra 10.13.6.

thinkpast
 

Joe (and others): Without explaining or fussing a lot about it: I only read newsgroups like this, sporadically, via the Web. I dont' read them as emails sent to me as a member of the list. So a post "to Herb" here, may not get to my attention anytime soon. Contact me privately if you want to reach me. All my Web pages on my Web site, give access to an email address to me.

Joe, thanks for sharing your results. I'll see about adding the compile information to my Web site for others to use. I"ve now tried to send you a private email, using groups.io "profile" which may permit private emails to be sent. In your case, it did. If you don't get an email from me, contact me (if you wish). Nothing earth shattering but I like to make private contacts on these kinds of things.

Thanks to everyone who commented on Joe's compilations. For those interested in the "warnings", they are simply about using assignment statements "=" in a test-for-equality "==". It's OK to do but could be unintended, hence the warning.

Apparently A18 code "worked" with no changes. Considering it goes back through MS-DOS to CP/M, it's unsurprisingly plainly coded.

Regards,
Herb Johnson

David Schultz
 

On 7/20/19 4:32 PM, thinkpast wrote:
Thanks to everyone who commented on Joe's compilations. For those interested in the "warnings", they are simply about using assignment statements "=" in a test-for-equality "==". It's OK to do but could be unintended, hence the warning.
It isn't hard to make those warnings go away. I checked an older version
of a18 I have sitting around and it generates no warnings so I must have
worked it over at some point. The time stamps make it at least 8 years
ago...


--
https://web.archive.org/web/20190214181851/http://home.earthlink.net/~david.schultz/
(Web pages available only at the Wayback Machine because Earthlink
terminated that service.)

Joe Blackburn
 

Yes, worked with essentially no changes. Tested on the sample programs, which also worked fine.