用法:cc [选项] 文件。使用“cc -flags”欲了解详情

发布于 2025-01-08 08:49:08 字数 1955 浏览 0 评论 0原文

我有一个生成文件。当我在 Unix 上运行它时,出现此错误:

cc -I/opt/oracle/product/9.2.0/rdbms/demo -I/opt/oracle/product/9.2.0/rdbms/public \
   -I/opt/oracle/product/9.2.0/plsql/public \
   -I/opt/oracle/product/9.2.0/network/public -I../common -I../include -I. \
   -L/opt/oracle/product/9.2.0/lib -L/opt/oracle/product/9.2.0/rdbms/lib -L../../lib \
   -g -errwarn=%all -Xt  -lclntsh -ldl -Bstatic -lclient9 -lvsn9 -lcommon9 -lgeneric9 \
   -lmm -lcore9 -lnls9  -lwssmbx -ldes -lnsl -lsocket -lgen -lm -o bessToWss

usage: cc [ options] files.  Use 'cc -flags' for details  
*** Error code 1

usage: cc [ options] files.Use 'cc -flags' for details”是什么意思?

我不确定为什么会收到错误,因为我确实使用了 cc -flags:

$(TARGET_DIR)/bessToWss: $(INTFOBJS)  
    cc $(CFLAGS) $(INTFOBJS) $(OCISHAREDLIBS) -o $@

编辑:添加整个 makefile

ORACLE_HOME=/opt/oracle/product/9.2.0

COMMON_SRC=../common
BNS_INCLUDE=../include
LIBHOME=$(ORACLE_HOME)/lib/
RDBMSLIB=$(ORACLE_HOME)/rdbms/lib/

WSSLIBS     =-lwssmbx -ldes
LLIBRDBMS_CLT   =-lclient9 -lvsn9 -lcommon9 -lgeneric9 -lmm
LLIBCLNTSH      =-lclntsh -ldl
CORELIBS        =-lcore9 -lnls9 
LDLIBS          =-lnsl -lsocket -lgen -lm
EXSYSLIBS       =-R $(ORACLE_HOME)/lib

STATICTTLIBS    =$(LLIBRDBMS_CLT) $(CORELIBS) $(WSSLIBS) $(LDLIBS)
OCISHAREDLIBS   =$(LLIBCLNTSH) -Bstatic $(STATICTTLIBS)


LDFLAGS     =-L$(ORACLE_HOME)/lib -L$(ORACLE_HOME)/rdbms/lib -L../../lib

INCLUDE     =-I$(ORACLE_HOME)/rdbms/demo -I$(ORACLE_HOME)/rdbms/public -I$(ORACLE_HOME)/plsql/public -I$(ORACLE_HOME)/network/public -I$(COMMON_SRC) -I$(BNS_INCLUDE) -I. 

CFLAGS      =$(INCLUDE) $(LDFLAGS) -g -errwarn=%all -Xt

BESSOBJS=bessToWss.o


COMMONLIST=$(COMMON_SRC)/oracle.c \
    $(COMMON_SRC)/logger.c

INTFOBJS=$(BESSOBJS) $(COMMONLIST)


$(TARGET_DIR)/bessToWss: $(INTFOBJS)
    cc $(CFLAGS) $(INTFOBJS) $(OCISHAREDLIBS) -o $@
clean:
    $(RM) *.o

I have a makefile. When I run it on Unix I get this error:

cc -I/opt/oracle/product/9.2.0/rdbms/demo -I/opt/oracle/product/9.2.0/rdbms/public \
   -I/opt/oracle/product/9.2.0/plsql/public \
   -I/opt/oracle/product/9.2.0/network/public -I../common -I../include -I. \
   -L/opt/oracle/product/9.2.0/lib -L/opt/oracle/product/9.2.0/rdbms/lib -L../../lib \
   -g -errwarn=%all -Xt  -lclntsh -ldl -Bstatic -lclient9 -lvsn9 -lcommon9 -lgeneric9 \
   -lmm -lcore9 -lnls9  -lwssmbx -ldes -lnsl -lsocket -lgen -lm -o bessToWss

usage: cc [ options] files.  Use 'cc -flags' for details  
*** Error code 1

What does "usage: cc [ options] files. Use 'cc -flags' for details" mean?

I'm not sure why I get the error because I do use cc -flags:

$(TARGET_DIR)/bessToWss: $(INTFOBJS)  
    cc $(CFLAGS) $(INTFOBJS) $(OCISHAREDLIBS) -o $@

EDIT: Adding my entire makefile

ORACLE_HOME=/opt/oracle/product/9.2.0

COMMON_SRC=../common
BNS_INCLUDE=../include
LIBHOME=$(ORACLE_HOME)/lib/
RDBMSLIB=$(ORACLE_HOME)/rdbms/lib/

WSSLIBS     =-lwssmbx -ldes
LLIBRDBMS_CLT   =-lclient9 -lvsn9 -lcommon9 -lgeneric9 -lmm
LLIBCLNTSH      =-lclntsh -ldl
CORELIBS        =-lcore9 -lnls9 
LDLIBS          =-lnsl -lsocket -lgen -lm
EXSYSLIBS       =-R $(ORACLE_HOME)/lib

STATICTTLIBS    =$(LLIBRDBMS_CLT) $(CORELIBS) $(WSSLIBS) $(LDLIBS)
OCISHAREDLIBS   =$(LLIBCLNTSH) -Bstatic $(STATICTTLIBS)


LDFLAGS     =-L$(ORACLE_HOME)/lib -L$(ORACLE_HOME)/rdbms/lib -L../../lib

INCLUDE     =-I$(ORACLE_HOME)/rdbms/demo -I$(ORACLE_HOME)/rdbms/public -I$(ORACLE_HOME)/plsql/public -I$(ORACLE_HOME)/network/public -I$(COMMON_SRC) -I$(BNS_INCLUDE) -I. 

CFLAGS      =$(INCLUDE) $(LDFLAGS) -g -errwarn=%all -Xt

BESSOBJS=bessToWss.o


COMMONLIST=$(COMMON_SRC)/oracle.c \
    $(COMMON_SRC)/logger.c

INTFOBJS=$(BESSOBJS) $(COMMONLIST)


$(TARGET_DIR)/bessToWss: $(INTFOBJS)
    cc $(CFLAGS) $(INTFOBJS) $(OCISHAREDLIBS) -o $@
clean:
    $(RM) *.o

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

明月夜 2025-01-15 08:49:08

这意味着命令行上的编译器选项无效。您可能使用了“错误”的编译器(例如,可能是 GCC 而不是 Sun 的编译器)。我看到的可能的问题选项是:

  • -Xt
  • -errwarn=%all

和也许(但可能不是)

  • -Bstatic

其他不会导致像这样的使用错误。

(注意:这将有助于识别您正在使用的机器和编译器,以及 Oracle 希望您使用的编译器。)

It means you have an invalid compiler option on the command line. It might be that you are using the 'wrong' compiler (maybe GCC instead of Sun's compiler, for example). The probable problem options I see are:

  • -Xt
  • -errwarn=%all

and maybe (but probably not)

  • -Bstatic

The others would not lead to usage errors like that.

(NB: It would help to identify the machine and the compiler you are using, and the compiler Oracle expects you to use.)

马蹄踏│碎落叶 2025-01-15 08:49:08

看起来您没有任何目标文件可以实际链接在一起。 $(INTFOBJS) 变量可能为空。除了可能存在错误的标志之外,这也会导致它失败。

It looks like you don't have any object files to actually link together. The $(INTFOBJS) variable is likely empty. Along with potentially having the wrong flags, this would also cause it to fail.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文