请教问题:error: linking files for incompatible targets ?
时间:10-02
整理:3721RD
点击:
我自己建了个工程,单个文件编译可以通过,但是链接后就出现:
[Linking...] \"d:\\ti\\c5500\\cgtools\\bin\\cl55\" -@\"Debug.lkf\"
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\csl5502x.lib\', member \'_csl_init.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\csl5502x.lib\', member \'csl.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\csl5502x.lib\', member \'csl_csldat.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\csl5502x.lib\', member \'i2c_read.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\csl5502x.lib\', member \'i2c_setup.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\csl5502x.lib\', member \'i2c_write.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\csl5502x.lib\', member \'irq_gdisab.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\csl5502x.lib\', member \'irq_grest.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\csl5502x.lib\', member \'pll_setfrq.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'divul.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'exit.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'printf.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'_lock.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'_printfi.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'atoi.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'cmpd.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'ctype.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'defs.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'divd.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'ecvt.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fcvt.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fixdi.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fixdli.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fltid.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fltlid.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fputc.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fputs.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'frcdivd.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'llmpy.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'lowlev.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'ltoa.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'memccpy.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'memcpy.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'memory.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'mpyd.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'negd.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'remli.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'subd.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'trgdrv.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'trgmsg.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'_io_perm.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'addd.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'divli.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fflush.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'frcmpyd.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fseek.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'setvbuf.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fopen.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'fclose.obj\')
>> error: linking files for inpatible targets (library
\'D:\\ti\\myprojects\\tuner1\\rts55x.lib\', member \'remove.obj\')
然后我就修改了build option 里的link order项。把所有的文件都添加到link order list里面。结果就只剩下两个错误(因为工程里有两个.c源文件,如果改成一个就只有一个错误):
[Linking...] \"d:\\ti\\c5500\\cgtools\\bin\\cl55\" -@\"Debug.lkf\"
>> error: linking files for inpatible targets (file
\'D:\\ti\\myprojects\\tuner1\\Debug\\TUNER.obj\')
>> error: linking files for inpatible targets (file
\'D:\\ti\\myprojects\\tuner1\\Debug\\tuner1.obj\')
这两个错误不知道该怎么解决,请指点,谢谢!
你编译器里面的存储器模式和你加入的库文件不一致。如果你加入的是一个大模式(如rts5509x)则你编译器选项下面ADVANCED栏就必须选择那个large memory mode选项。也就是要保证这两者一致
我把编译没问题的其他工程文件中的源文件换成我自己写的文件然后再编译连接没有错误。
然后我再把我自己建立的工程文件中的lib文件换成那个编译通过的文件中的lib文件然后再编译连接还是出现以上错误,不知道是什么原因?
你建立。lib文件的条件要与现在的工程一样,检查一下build option。
你好 我用的是28335 也是遇到这个问题error: linking files for incompatible targets 我的lib文件用的是rts2800_fpu32.lib 可是还是不对呀 很急的 还望指教