Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8600829
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:42:14+00:00 2026-06-12T01:42:14+00:00

Any reason cc -g -lm -DBLITZ_HOST_IS_LITTLE_ENDIAN would produce an error with code using math.h

  • 0

Any reason

cc -g -lm -DBLITZ_HOST_IS_LITTLE_ENDIAN

would produce an error with code using math.h? Is it possible there’s a difference between GCC version 4.0.3 (documented working version) and version 4.6.3 (my current version)?

makefile and asm.c @ https://gist.github.com/3801291

This is on ubuntu 12.04

My terminal output is a comment in the gist.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T01:42:15+00:00Added an answer on June 12, 2026 at 1:42 am

    Instead of

    cc -g -lm -DBLITZ_HOST_IS_LITTLE_ENDIAN foo.c
    

    Try:

    cc -g -DBLITZ_HOST_IS_LITTLE_ENDIAN foo.c -lm
    

    When the linker searches a library, it links in modules that contain definitions for previously-undefined symbols.

    If the linker searches -lm before foo.o, then pow() is not yet undefined. Conversely, if foo.o comes first, it undefines pow(), which -lm can then resolve.


    EDIT: To accomplish this advice in your makefile, make these changes:

    CFLAGS=-g -DBLITZ_HOST_IS_LITTLE_ENDIAN
    LDLIBS=-lm
    
    ...
    
    asm: asm.c
            $(CC) $(CFLAGS) asm.c $(LDLIBS) -o asm
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any reason why a Java string cannot be tested for equality using
Any reason why the following code would not fire on keypress but would on
Is there any reason, maybe a known bug or missing SDK that would cause
Is there any reason the following code has no effect on font size? <html>
Is there any reason why to favor using (possibly very long) CLASSPATH variable to
Is there any reason why an if then statement would fire regardless: Its inside
Is there any reason something like this would not work? This is the logic
Is there any reason PHP would only work in windows? I keep seeing 'windows
is there any reason to use the post-redirect-get (prg) for a request that you
Is there any reason why the below won't work, it seems to work on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.