orionsnow 发表于 2009-9-15 09:45

于c 语言里头联合编译gsl 和 R_ext 函数库的问题

本帖最后由 orionsnow 于 2009-9-15 10:47 编辑

我用的gcc

命令 gcc -static example.o -lgsl -lgslcblas -lm

单独编译这两个库的小程序都通过了,联合编译我同事写的大程序的时候就出问题了

我记的好像linux 下边写的程序拿到window 下边来编译会有些问题

不过两年前的事情,现在不确定了。 有没有高手指点下

或者谁知道比较好的这方面的bbs?

> gcc -static Zufallszahlen.o -lgsl -lgslcblas -lm
> Zufallszahlen.o:Zufallszahlen.c:(.text+0xd): undefined reference to
> `_ltolower'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x20): undefined reference to
> `_ltoupper'
>
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x3b): undefined reference to
> `_ltowlower
> '
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x59): undefined reference to
> `_ltowupper
> '
> Zufallszahlen.o:Zufallszahlen.c:(.text+0xbc): undefined reference to
> `Rprintf'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x2c1): undefined reference
> to `Rprintf'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x3d8): undefined reference
> to `Rf_allocM
> atrix'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x3e6): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x3fa): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x408): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x413): undefined reference
> to `INTEGER'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x427): undefined reference
> to `INTEGER'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x436): undefined reference
> to `_imp__R_D
> imSymbol'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x44e): undefined reference
> to `Rf_setAtt
> rib'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x462): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x470): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x485): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x493): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x4a8): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x4b6): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x4ca): undefined reference to `REAL'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x507): undefined reference
> to `Rf_unprot
> ect'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x536): undefined reference
> to `Rf_allocM
> atrix'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x544): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x558): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x566): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x571): undefined reference
> to `INTEGER'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x585): undefined reference
> to `INTEGER'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x594): undefined reference
> to `_imp__R_D
> imSymbol'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x5ac): undefined reference
> to `Rf_setAtt
> rib'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x5c0): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x5ce): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x5e3): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x5f1): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x606): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x614): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x628): undefined reference to `REAL'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x665): undefined reference
> to `Rf_unprot
> ect'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x694): undefined reference
> to `Rf_allocM
> atrix'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x6a2): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x6b6): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x6c4): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x6cf): undefined reference
> to `INTEGER'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x6e3): undefined reference
> to `INTEGER'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x6f2): undefined reference
> to `_imp__R_D
> imSymbol'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x70a): undefined reference
> to `Rf_setAtt
> rib'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x71e): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x72c): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x741): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x74f): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x764): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x772): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x786): undefined reference to `REAL'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x7c3): undefined reference
> to `Rf_unprot
> ect'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x7f2): undefined reference
> to `Rf_allocM
> atrix'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x800): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x814): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x822): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x82d): undefined reference
> to `INTEGER'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x841): undefined reference
> to `INTEGER'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x850): undefined reference
> to `_imp__R_D
> imSymbol'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x868): undefined reference
> to `Rf_setAtt
> rib'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x87c): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x88a): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x89f): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x8ad): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x8c2): undefined reference
> to `Rf_allocV
> ector'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x8d0): undefined reference
> to `Rf_protec
> t'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x8e4): undefined reference to `REAL'
> Zufallszahlen.o:Zufallszahlen.c:(.text+0x921): undefined reference
> to `Rf_unprot
> ect'
> k:/programme/r/rtools/mingw/bin/../lib/gcc/mingw32/4.2.1-sjlj/../../..\libmingw3
> 2.a(main.o):main.c:(.text+0x104): undefined reference to `WinMain@16'
> collect2: ld returned 1 exit status
页: [1]
查看完整版本: 于c 语言里头联合编译gsl 和 R_ext 函数库的问题