0

I downloaded the required files from GNUWin32 LibTiff page. I didn't install it but used the lib and include to run my code. I want to make my code portable.


Here is my basic C++ program taken from LibTiff documentation.

File: abcd.cpp

#include <tiffio.h>

int main()
{
    TIFF* tif = TIFFOpen("foo.tif","r");
    TIFFClose(tif);
    return 0;
}

I want to create an executable abcd.exe.

My folder structure:

MyProject
|
|tifflib
    |
    |include
    |bin
    |lib
    |manifest
|abcd.cpp

These are the commands I ran:

g++ -c -Itifflib\include -o abcd.o abcd.cpp

g++ -Ltifflib\lib -o abcd.exe abcd.o -ltiff

I get the following error:

skipping incompatible tifflib\lib\libtiff.a when searching for -ltiff
skipping incompatible tifflib\lib\libtiff.dll.a when searching for -ltiff
cannot find -ltiff
Tarun Maganti
  • 3,076
  • 2
  • 35
  • 64

0 Answers0