所以我使用MinGW作为windows的C编译器,我做了一个简单的C程序
#include "ri.h"
RtPoint Square[4] = { { .5,.5,.5} ,{.5,-.5,.5} , {-.5,.5,.5} , {-.5, -.5 , .5}};
static RtColor Color = {.2,.4,.6};
int main(){
RiBegin (" square.rib" );
RiDisplay ( " square.tif" , "file" ,"rgb" ,RI_NULL);
RiWorldBegin();
RiSurface("constant" , RI_NULL);
RiColor(Color);
RiPatch (RI_BILINEAR,RI_P,(RtPointer)Square,RI_NULL);
//RiPatch (RI_BICUBIC,RI_P,(RtPointer)Square,RI_NULL);
RiWorldEnd();
RiEnd();
return 0;
} 所以我使用命令...
gcc -o test.o test.c -I"\..\Program Files (x86)\Pixie\include" -L"\..\Program Files (x86)\Pixie\lib" -lri
为了识别预编译器的包含文件的位置...以及链接器的库在哪里
我得到以下错误
:\Users\Edward\AppData\Local\Temp\ccEERD04.o:test.c:(.text+0x6e): undefined ref
erence to `_imp__RI_P'
C:\Users\Edward\AppData\Local\Temp\ccEERD04.o:test.c:(.text+0x75): undefined ref
erence to `_imp__RI_BILINEAR'
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: C:\Users\E
dward\AppData\Local\Temp\ccEERD04.o: bad reloc address 0x20 in section `.eh_fram
e'
c:/mingw/bin/../lib/gcc/mingw32/4.7.2/../../../../mingw32/bin/ld.exe: final link
failed: Invalid operation
collect2.exe: error: ld returned 1 exit status我尝试查看是否遗漏了用于链接的库,但是...none我发现遗漏的引用在.h文件中
有人有什么建议吗?
发布于 2013-06-10 01:54:43
我找到了解决这个问题的办法……我查看了ri.h的源文件,发现常量被初始化为什么。RI_P是"P“RI_BILINEAR是”双线性“
我变了
RiPatch (RI_BILINEAR,RI_P,(RtPointer)Square,RI_NULL);至
RiPatch ("bilinear","P",(RtPointer)Square,RI_NULL);这使我可以编译c文件并对映像进行RNDR。
https://stackoverflow.com/questions/16975567
复制相似问题