Giter VIP home page Giter VIP logo

Comments (9)

schneems avatar schneems commented on July 28, 2024 1

Realized this is more of an issue with the difference between GCC/clang on a mac

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 7.0.0 (clang-700.1.76)
Target: x86_64-apple-darwin14.5.0
Thread model: posix

from 21st-century-examples.

 avatar commented on July 28, 2024

@b-k Have you had a chance to read this?
@schneems How did you fix this?

from 21st-century-examples.

schneems avatar schneems commented on July 28, 2024

@bucaran you don't need -Wall in this example.

from 21st-century-examples.

 avatar commented on July 28, 2024

Great. Thanks @schneems

from 21st-century-examples.

b-k avatar b-k commented on July 28, 2024

Hi, sorry I missed your message.

Some Macs ship with a version of GCC that has been recompiled to default to certain standards and use different flags from the usual gcc. On the Mac I tested on that had this gcc alias, I set up a one-line script name gcc consisting of
clang $*
and put that in my PATH. There are other ways to get around Apple's specialized gcc. For the examples, you can remove -Wall, as @schneems noted, but that's probably a bad habit for day-to-day code writing.

Also, I'm told that a lot of macs don't yet have the at_quick_exit function as specified in the C11 standard, so that will have to be commented out to compile on those macs.

I hope that helps.

from 21st-century-examples.

randyzwitch avatar randyzwitch commented on July 28, 2024

I'm not able to get this working, same error as @schneems. I've tried the clang $* trick in a file named gcc in my root directory, and chmod +x it and put ~/ on my PATH, but I'm still getting error 64.

Is there something else that I'm missing? The code runs fine on Ubuntu, but that's not as convenient as using OSX on my Mac.

from 21st-century-examples.

randyzwitch avatar randyzwitch commented on July 28, 2024

So I got it working...at least for me, the minimal makefile is just the following, no need for alternate files/PATH solutions:

OBJECTS=
CFLAGS= -g -Wall -O3
LDLIBS=
CC=clang

$(P): $(OBJECTS)

from 21st-century-examples.

 avatar commented on July 28, 2024

Great, thanks for posting this @randyzwitch

from 21st-century-examples.

schneems avatar schneems commented on July 28, 2024

Can confirm. That worked, thanks!

from 21st-century-examples.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.