Mac OS X Support

For other topics related to the FreeBASIC project or its community.
MrSwiss
Posts: 3501
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: Mac OS X Support

Postby MrSwiss » Jun 28, 2020 18:25

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: 2419
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Postby srvaldez » Jun 28, 2020 18:41

@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: 2419
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Postby srvaldez » Jun 28, 2020 18:55

@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

Postby sitrucz » Jun 28, 2020 18:58

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: 2419
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Postby srvaldez » Jun 28, 2020 19:35

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: 2419
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Postby srvaldez » Jun 28, 2020 23:11

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

Postby sitrucz » Jun 28, 2020 23:31

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: 2419
Joined: Sep 25, 2005 21:54

Re: Mac OS X Support

Postby srvaldez » Jun 29, 2020 0:17

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

Re: Mac OS X Support

Postby TeeEmCee » Jun 29, 2020 9:52

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.

Return to “Community Discussion”

Who is online

Users browsing this forum: Provoni and 5 guests