# libPVRTexLib.a on MacOS

**URL:** <https://forums.imgtec.com/t/libpvrtexlib-a-on-macos/794>\
**Category:** PowerVR Insider\
**Created:** [August 12, 2010, 12:24pm UTC](https://forums.imgtec.com/t/libpvrtexlib-a-on-macos/794 "2010-08-12T12:24:30Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![windwalkr](https://avatars.discourse-cdn.com/v4/letter/w/f9ae1b/32.png) [@windwalkr](https://forums.imgtec.com/u/windwalkr)\
**Post date:** [August 12, 2010, 12:24pm UTC](https://forums.imgtec.com/t/libpvrtexlib-a-on-macos/794/1 "2010-08-12T12:24:30Z")

</div>

Hi guys,  
  
  
  
  
  
I would like to use libPVRTexLib to perform texture compression in an in-house tool, however when I try to link it, I’m seeing a number of errors such as:

Code:

"std::basic\_istream\<char, std::char\_traits\<char\> \>& std::basic\_istream\<char, std::char\_traits\<char\> \>::\_M\_extract\<unsigned int\>(unsigned int&)", referenced from:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in libtrainzresource.a(pvrtcMW.o)  
  
"\_fopen$UNIX2003", referenced from:  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;pvrtexlib::CPVRTexture::writeToFile(char const\*, unsigned int) constin libtrainzresource.a(CPVRTexture.o)

  
  
  
These appear to indicate a mismatch of the standard libraries between your prebuilt library and my project, but unfortunately your documentation does not indicate what compilers/settings might be necessary here.  
  
  
  
Could you provide any clues towards fixing this?  
  
  
  
thanks,  
  
  
  
chris

---

<div class="post-metadata">

**Author:** ![GordonMaclachlan](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@GordonMaclachlan](https://forums.imgtec.com/u/GordonMaclachlan)\
**Post date:** [August 12, 2010, 12:33pm UTC](https://forums.imgtec.com/t/libpvrtexlib-a-on-macos/794/2 "2010-08-12T12:33:04Z")

</div>

This is something that should probably be added to the documentation, along with an example.  
  
In my test makefile for this library I have the following lines:

Code:

LIBS =   
  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -L/usr/lib   
  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -lpthread   
  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -lstdc++ -m32   
  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; $(DEVRELDIR)/UtilitiesSrc/PVRTexLib/PVRTexLibPublic/MacOS/libPVRTexLib.a   
  
&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5   
  
  
  
  
  
CFLAGS += -c -m32 -DHAVE\_GL\_H -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5

  
  
I use the -mmacosx-version-min flag to give compatiblity with Leopard - I suspect that might have something to do with the issue - are you running 10.6?&nbsp; Also, the -m32 ensures 32bit mode (64bit support is not available yet).  
  
Please post again if this doesn't help you.

---

<div class="post-metadata">

**Author:** ![windwalkr](https://avatars.discourse-cdn.com/v4/letter/w/f9ae1b/32.png) [@windwalkr](https://forums.imgtec.com/u/windwalkr)\
**Post date:** [August 12, 2010, 1:50pm UTC](https://forums.imgtec.com/t/libpvrtexlib-a-on-macos/794/3 "2010-08-12T13:50:56Z")

</div>

Thanks for the quick reply.  
  
  
  
  
  
I am running Xcode 3.2.3 on 10.6.4.  
  
  
  
  
  
My project settings include:

Code:

SDKROOT = macosx10.5  
VALID\_ARCHS = i386  
GCC\_VERSION = 4.2  
MACOSX\_DEPLOYMENT\_TARGET = 10.5

  
  
  
The resultant buildline in xcode looks like this (filepaths abbreviated substantially to protect the guilty and to make it readable):  
  
  
  

Code:

setenv MACOSX\_DEPLOYMENT\_TARGET 10.5  
/Developer/usr/bin/g++-4.2 -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk -L/XXXX -F/XXXX -filelist /XXXX.LinkFileList -mmacosx-version-min=10.5 -lssl -lz -lcrypto /XXXX.a /XXXX.a -o /XXXX

  
  
  
Any further thoughts?  
  
  
  
cheers,  
  
  
  
chris

---

<div class="post-metadata">

**Author:** ![esenthel-2](https://avatars.discourse-cdn.com/v4/letter/e/c68b51/32.png) [@esenthel-2](https://forums.imgtec.com/u/esenthel-2)\
**Post date:** [September 1, 2010, 3:21pm UTC](https://forums.imgtec.com/t/libpvrtexlib-a-on-macos/794/4 "2010-09-01T15:21:41Z")

</div>

Hello,  
  
I have the same problem, I want to use the library in my engine - http://www.esenthel.com/  
And was successfull with 32-bit under Windows, but on Mac I have the same linker errors as in first post.  
I use xcode 3.2.3 on mac os x 10.6  
  
I use mac os 10.5 sdk for building the project, with 32-bit (i386) architecture.  
  
The linker errors are:  
  

Code:

"std::basic\_istream\<char, std::char\_traits\<char\> \>& std::basic\_istream\<char, std::char\_traits\<char\> \>::\_M\_extract\<unsigned int\>(unsigned int&)", referenced from:  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp; "\_fopen$UNIX2003", referenced from:  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::CPVRTexture::writeToFile(char const\*, unsigned int) constin EsenthelEngine.a(CPVRTexture.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::SaveKTX(pvrtexlib::CPVRTextureHeader const&, pvrtexlib::CPVRTextureData const&, CPVRTString const&)in EsenthelEngine.a(ktx\_io.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; readFile(CPVRTString const&, SafeArray\<unsigned char\>&)in EsenthelEngine.a(Utilities.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::ConsoleLog::setStraightToFile(bool)&nbsp; in EsenthelEngine.a(ConsoleLog.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::ConsoleLog::setOutputFile(CPVRTString)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in EsenthelEngine.a(ConsoleLog.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::ConsoleLog::writeToFile()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in EsenthelEngine.a(ConsoleLog.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::ConsoleLog::appendToFile()&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; in EsenthelEngine.a(ConsoleLog.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::writeToIncludeFile(pvrtexlib::CPVRTextureHeader const&, pvrtexlib::CPVRTextureData const&, char const\*, char const\*)in EsenthelEngine.a(pvr\_io.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::SavePVR(pvrtexlib::CPVRTextureHeader const&, pvrtexlib::CPVRTextureData const&, CPVRTString const&)in EsenthelEngine.a(pvr\_io.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::SaveDDS(pvrtexlib::CPVRTextureHeader const&, pvrtexlib::CPVRTextureData const&, char const\*)in EsenthelEngine.a(dds\_io.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::SaveNGT(pvrtexlib::CPVRTextureHeader const&, pvrtexlib::CPVRTextureData const&, CPVRTString const&)in EsenthelEngine.a(ngt\_io.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::fileExist(char\*) in EsenthelEngine.a(etc\_conversion.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_bitmap\_write\_window in EsenthelEngine.a(bitmap.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \_bitmap\_read in EsenthelEngine.a(bitmap.o)  
  
  
&nbsp; "std::basic\_ostream\<char, std::char\_traits\<char\> \>& std::\_\_ostream\_insert\<char, std::char\_traits\<char\> \>(std::basic\_ostream\<char, std::char\_traits\<char\> \>&, char const\*, int)", referenced from:  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::writePPM(char const\*, pvrtexlib::Pixel\<unsigned char\> const\*, unsigned int, unsigned int, bool)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::writePPM(char const\*, pvrtexlib::Pixel\<unsigned char\> const\*, unsigned int, unsigned int, bool)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::writePPM(char const\*, pvrtexlib::Pixel\<unsigned char\> const\*, unsigned int, unsigned int, bool)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp; "std::basic\_ostream\<char, std::char\_traits\<char\> \>& std::basic\_ostream\<char, std::char\_traits\<char\> \>::\_M\_insert\<unsigned long\>(unsigned long)", referenced from:  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::readPPM(char const\*, pvrtexlib::Pixel\<unsigned char\>\*\*, unsigned int&, unsigned int&)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::writePPM(char const\*, pvrtexlib::Pixel\<unsigned char\> const\*, unsigned int, unsigned int, bool)in EsenthelEngine.a(pvrtcMW.o)  
  
  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pvrtexlib::writePPM(char const\*, pvrtexlib::Pixel\<unsigned char\> const\*, unsigned int, unsigned int, bool)in EsenthelEngine.a(pvrtcMW.o)

  
  
OTHER\_LFFLAGS= -L/usr/lib -lpthread -lstdc++ -m32 -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5 -framework Carbon -framework Cocoa -framework OpenGL -framework OpenAL -framework Cg -lz  
  
OTHER\_CFLAGS = -fshort-wchar -ffriend-injection -c -m32 -DHAVE\_GL\_H -isysroot /Developer/SDKs/MacOSX10.5.sdk -mmacosx-version-min=10.5  
  
Also I have a big request for 64-bit support, for both Windows and Mac.  
  
And it would be nice to have the library on Windows as .lib only and not .dll  
  
Thanks  
  
Grzegorz  
  
Esenthel2010-09-01 17:39:42

---

<div class="post-metadata">

**Author:** ![GordonMaclachlan](https://avatars.discourse-cdn.com/v4/letter/g/c68b51/32.png) [@GordonMaclachlan](https://forums.imgtec.com/u/GordonMaclachlan)\
**Post date:** [September 22, 2010, 3:33pm UTC](https://forums.imgtec.com/t/libpvrtexlib-a-on-macos/794/5 "2010-09-22T15:33:09Z")

</div>

Thanks for reporting this issue. It’s being looked into (along with 64bit builds) and a fix should be available in an update in the future.
