使用 Snow Leopard 的 C 的 libtiff。 TIFF 的存储大小未知
我刚刚在运行 Snow Leopard 的 Mac 计算机上构建并安装了 tiff-4.0.0beta6。我按照 http://www.kyngchaos.com/macosx/build/libtiff。安装顺利,但 TIFF 数据类型存在问题。
例如,当我编译以下简单代码时:
#include "tiffio.h"
main()
{
TIFF* tif = TIFFOpen("foo.tif", "r");
TIFFClose(tif);
}
我收到错误消息:
hlrg-labs-imac:metrics Ben$ gcc main.c
Undefined symbols:
"_TIFFOpen", referenced from:
_main in cciewEwr.o
"_TIFFClose", referenced from:
_main in cciewEwr.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
当我编译代码时:
#include "tiffio.h"
main()
{
TIFF tif;
}
我收到编译错误:
hlrg-labs-imac:metrics Ben$ gcc main.c
main.c: In function ‘main’:
main.c:5: error: storage size of ‘tif’ isn’t known
对此的任何建议将不胜感激。
谢谢。
I have just built and installed tiff-4.0.0beta6 on my Mac computer running Snow Leopard. I followed the tutorial at http://www.kyngchaos.com/macosx/build/libtiff. The install went fine but there are issues with the TIFF data type.
For exmaple, when I compile the following simple code:
#include "tiffio.h"
main()
{
TIFF* tif = TIFFOpen("foo.tif", "r");
TIFFClose(tif);
}
I get the error message:
hlrg-labs-imac:metrics Ben$ gcc main.c
Undefined symbols:
"_TIFFOpen", referenced from:
_main in cciewEwr.o
"_TIFFClose", referenced from:
_main in cciewEwr.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
When I compile the code:
#include "tiffio.h"
main()
{
TIFF tif;
}
I get the compilation error:
hlrg-labs-imac:metrics Ben$ gcc main.c
main.c: In function ‘main’:
main.c:5: error: storage size of ‘tif’ isn’t known
Any suggestions on this would be greatly appreciated.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
编译时需要包含 -ltiff 开关。例如:
另外,在你的第二个例子中它应该是
When you compile you need to include the -ltiff switch. For example:
Also, in your second example it should be