Mac OS X Support

General discussion for topics related to the FreeBASIC project or its community.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Mac OS X Support

Post by MrSwiss »

srvaldez wrote:I don't know what's going on, no binaries, maybe this will work
Maybe just your virus-scanner interfering ...
(try with it switched OFF, for the test)
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Post by srvaldez »

@MrSwiss and others
I think it's just lack of good sleep, I had the uncompressed folder on the desktop and it had the binaries, I also had a zip file with the same name as the folder, but obviously without the binaries.
I don't use the Mac anymore, so I had to drag it out from storage and hook it up and everything was running so slow that I rushed to get things done
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Post by srvaldez »

@sitrucz
when I was using High Sierra and decided to give Mojave a try, fbc on Mojave would give some error about dylib table something, everything worked after building fbc on mojave.
I think that the same problem exist for Catalina, I have Catalina on a VM on the mac but never really used it, today I compiled a simple program and it compiled with no complaints but when trying to run the program it would give the same dylib table something message
I tried building fbc but ran into missing header problems, so I gave up
sitrucz
Posts: 7
Joined: Jun 20, 2020 16:34

Re: Mac OS X Support

Post by sitrucz »

srvaldez wrote:@sitrucz
when I was using High Sierra and decided to give Mojave a try, fbc on Mojave would give some error about dylib table something, everything worked after building fbc on mojave.
I think that the same problem exist for Catalina, I have Catalina on a VM on the mac but never really used it, today I compiled a simple program and it compiled with no complaints but when trying to run the program it would give the same dylib table something message
I tried building fbc but ran into missing header problems, so I gave up
Thank you @srvaldez you have been very helpful and I learned a lot. I'll write some code and see how it goes. If it doesn't go well I'll install fbc on my Windows machine or linux machine where it's supported but my primary is Mac.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Post by srvaldez »

the fbc binaries I provided should be OK for building FB on ypur mac, once that's done you should be good to go
I recommend that you edit fbc.bas which is in the src/compiler folder and comment-out lines 846 and 847 (they could be different numbers)
anyway, I commented-out the lines here, near bottom of snippet

Code: Select all

	case FB_COMPTARGET_LINUX, FB_COMPTARGET_DARWIN, _
	     FB_COMPTARGET_FREEBSD, FB_COMPTARGET_OPENBSD, _
	     FB_COMPTARGET_NETBSD

		if( fbGetOption( FB_COMPOPT_OUTTYPE ) = FB_OUTTYPE_EXECUTABLE) then
			if( fbGetOption( FB_COMPOPT_PROFILE ) ) then
				select case as const fbGetOption( FB_COMPOPT_TARGET )
				case FB_COMPTARGET_OPENBSD, FB_COMPTARGET_NETBSD
					ldcline += hFindLib( "gcrt0.o" )
				case else
					ldcline += hFindLib( "gcrt1.o" )
				end select
			else
				select case as const fbGetOption( FB_COMPOPT_TARGET )
				case FB_COMPTARGET_OPENBSD, FB_COMPTARGET_NETBSD
					ldcline += hFindLib( "crt0.o" )
				''case else '<--
				''	ldcline += hFindLib( "crt1.o" ) '<--
				end select
			end if
		end if
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Post by srvaldez »

either of these should work in Catalina
fbc-mac-mojave.zip
fbc-mac-Catalina
sitrucz
Posts: 7
Joined: Jun 20, 2020 16:34

Re: Mac OS X Support

Post by sitrucz »

srvaldez wrote:either of these should work in Catalina
fbc-mac-mojave.zip
fbc-mac-Catalina
Thank you so much I compiled and ran a basic program. I found I need to have gcc as the current compiler. fbc seems to need it as opposed to Xcode's clang.
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Post by srvaldez »

you can make soflink to clang, something like: sudo ln -s full_path_to_clang /usr/local/bin/gcc
TeeEmCee
Posts: 375
Joined: Jul 22, 2006 0:54
Location: Auckland

Re: Mac OS X Support

Post by TeeEmCee »

srvaldez wrote:I recommend that you edit fbc.bas which is in the src/compiler folder and comment-out lines 846 and 847 (they could be different numbers)
What do you mean by "recommend"? What happens if you don't do it?

I haven't had any problem compiling and using FB on Catalina. As far as I remember.

This is a bit irrelevant since you already solved it, but there was a recent thread on these forums about using -gen gcc with clang instead of gcc. It works as long as you don't use fbc -e (runtime error checking) and invoke clang manually in the following way. Just symlinking gcc to clang (or using "export GCC=clang" which has the ssame effect on fbc) doesn't work... unless it only works on Mac?

Code: Select all

> fbc -gen gcc -asm att -r -m ztest ztest.bas
> clang ztest.c -c -o ztest.o -Wno-builtin-requires-header -Wno-incompatible-library-redeclaration
> fbc ztest.o
But I'm still using gcc from homebrew for now.
rickh57
Posts: 7
Joined: Jan 28, 2021 13:43

Re: Mac OS X Support

Post by rickh57 »

srvaldez wrote:either of these should work in Catalina
fbc-mac-mojave.zip
fbc-mac-Catalina
Your zip files are no longer accessible. Can you republish them?
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Post by srvaldez »

here's the Catalina version
fbc-mac-Catalina
rickh57
Posts: 7
Joined: Jan 28, 2021 13:43

Re: Mac OS X Support

Post by rickh57 »

srvaldez wrote:here's the Catalina version
fbc-mac-Catalina
Thanks!
srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Post by srvaldez »

@rickh57
please report whether you were successful or not in using FB on your Mac
kankouhin7937
Posts: 31
Joined: Aug 16, 2018 2:00

Re: Mac OS X Support

Post by kankouhin7937 »

srvaldez
Posts: 3379
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Post by srvaldez »

@kankouhin7937
don't you think that your post is off-topic?
this thread is about FreeBasic support on Mac OS, and I don't see the source-code for that compiler that you posted a link to, only binaries
Post Reply