87255

not found in mac os X mavericks

Question:

I tried (apparently successfully) to install libpng on mac os x mavericks.

I downloaded the latest 1-6-8 version .tar.xz and followed the instructions.

./configure runs fine

make check passes everything but png-error that gets skipped

sudo make install apparently works fine since my library libpng. appears.

Now, when i try to compile the C file that i need to compile, using the string

clang -w -lz -lpng16 libpng_test.c

i get the error

fatal error: 'png.h' file not found

#include <png.h>

and obviously it does not compile.

I tried installing both with homebrew and macports and it always seems to run fine, but i always get the same error

Answer1:

First you have to find where the png.h file is located

sudo find / -name png.h

Here in my environment it is located at <strong>/usr/local/include</strong>

Then look for libpng.a

sudo find / -name libpng.a

Here in my environment it is located at <strong>/usr/local/lib</strong>

Now add those directories to the clang command line:

clang -I/usr/local/include -L/usr/local/lib -w -lz -lpng16 libpng_test.c

Recommend

  • Reload UITableView from another tab
  • Find tangent points on a curve from a user-given point outside the curve
  • Ruby: Why does this way of using map throw an error?
  • In loopback documentation what does variable 'cb' stands for?
  • Floated image with variable width and heading with background image
  • ViewController With Transparent Background Entering Current ViewController With Push Transition
  • Groovy: Unexpected token “:”
  • Passing 1 of 3 values to a Sub
  • How to have background script and something similar to a default popup?
  • How to test if a URL from an Eclipse bundle is a directory?
  • ActiveRecord query for a count of new users by day
  • Set the selected item in dropdownlist in MVC3
  • Python urlparse: small issue
  • How to create a file in java without a extension
  • Recording logins for password protected directories
  • Spring Data JPA custom method causing PropertyReferenceException
  • Splitting given String into two variables - php
  • C# - Is there a limit to the size of an httpWebRequest stream?
  • Is my CUDA kernel really runs on device or is being mistekenly executed by host in emulation?
  • Read text file and split every line in MSBuild
  • What is Eclipse's Declaration View used for?
  • Counter field in MS Access, how to generate?
  • Possible to stop flickering java tooltip in heavyweight mode?
  • Check if a string to interpolate provides expected placeholders
  • Perl system calls when running as another user using sudo
  • sending/ receiving email in Java
  • How to set my toolbar fixed while scrolling android
  • GridView Sorting works once only
  • AT Commands to Send SMS not working in Windows 8.1
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • Load html files in TinyMce
  • How can I get HTML syntax highlighting in my editor for CakePHP?
  • Hits per day in Google Big Query
  • coudnt use logback because of log4j
  • FormattedException instead of throw new Exception(string.Format(…)) in .NET
  • Qt: Run a script BEFORE make
  • Linking SubReports Without LinkChild/LinkMaster
  • apache spark aggregate function using min value
  • XCode 8, some methods disappeared ? ex: layoutAttributesClass() -> AnyClass
  • Sorting a 2D array using the second column C++