Lv 165 points

康小和

最佳解答0%
解答1
  • Makefile增加include path與指定Lib

    openssl的.h安裝在/usr/local/ssl/include/openssl下

    Lib的 libcrypto.a在/usr/local/ssl/lib下

    不知道 Makefile該怎麼去增加這2個的PATH去找!!

    g.o這個物件檔需要用到openssl這2個東西!!

    謝謝大大們的解答

    Makefile如下:

    CROSS = arm-linux-

    CC = $(CROSS)gcc

    CXX = $(CROSS)g

    OBJDUMP = $(CROSS)objdump

    INCLUDE = ../include

    INCLUDESYS =/usr/local/arm/hybus-arm-linux-R1.1/arm-linux/include

    CFLAGS = -g -O2 -DCONFIG_ISCSI_DEBUG

    CFLAGS = -Wall -Wstrict-prototypes -fno-strict-aliasing -fno-common -Wno-trigraphs -I$(INCLUDE) -D_GNU_SOURCE

    CFLAGS = -static

    OBJS = a.o b.o c.o d.o e.o f.o

    abcd: g.o $(OBJS)

    $(CC) $(CFLAGS) g.o $(OBJS) -lpthread -o abcd

    d.o: d.c $(INCLUDE)/d.h

    e.o: e.c $(INCLUDE)/e.h $(INCLUDE)/d.h md5.c

    osd.o: osd.c $(INCLUDE)/osd.h $(INCLUDE)/device.h $(INCLUDE)/d.h $(INCLUDE)/c.h

    c.o: c.c $(INCLUDE)/c.h $(INCLUDE)/d.h

    a.o:a.c $(INCLUDE)/c.h $(INCLUDE)/d.h $(INCLUDE)/b.h $(INCLUDE)/device.h

    b.o: target.c $(INCLUDE)/c.h $(INCLUDE)/d.h $(INCLUDE)/b.h $(INCLUDE)/e.h

    f.o: f.c $(INCLUDE)/f.h

    clean:

    rm -f *.o abcd

    3 個解答程式設計1 0 年前
  • 關於GCC編譯問題

    請教各位大大~~

    我編譯一個RSA的file....出現以下錯誤!!

    rsa_test.c: In function `main':

    rsa_test.c:67: warning: assignment makes pointer from integer without a cast

    /tmp/ccWWHC4W.o(.text+0x2e): In function `RSAEncrpty':

    : undefined reference to `BN_num_bits'

    /tmp/ccWWHC4W.o(.text+0x58): In function `RSAEncrpty':

    : undefined reference to `BN_num_bits'

    /tmp/ccWWHC4W.o(.text+0x10a): In function `RSAEncrpty':

    : undefined reference to `RSA_public_encrypt'

    /tmp/ccWWHC4W.o(.text+0x145): In function `RSAEncrpty':

    : undefined reference to `RSA_public_encrypt'

    /tmp/ccWWHC4W.o(.text+0x1b5): In function `RSADecrypt':

    : undefined reference to `BN_num_bits'

    /tmp/ccWWHC4W.o(.text+0x262): In function `RSADecrypt':

    : undefined reference to `RSA_private_decrypt'

    /tmp/ccWWHC4W.o(.text+0x30f): In function `main':

    : undefined reference to `BN_num_bits'

    /tmp/ccWWHC4W.o(.text+0x58): In function `RSAEncrpty':

    : undefined reference to `BN_num_bits'

    /tmp/ccWWHC4W.o(.text+0x10a): In function `RSAEncrpty':

    : undefined reference to `RSA_public_encrypt'

    /tmp/ccWWHC4W.o(.text+0x145): In function `RSAEncrpty':

    : undefined reference to `RSA_public_encrypt'

    /tmp/ccWWHC4W.o(.text+0x1b5): In function `RSADecrypt':

    : undefined reference to `BN_num_bits'

    /tmp/ccWWHC4W.o(.text+0x262): In function `RSADecrypt':

    : undefined reference to `RSA_private_decrypt'

    /tmp/ccWWHC4W.o(.text+0x30f): In function `main':

    : undefined reference to `RSA_generate_key'

    /tmp/ccWWHC4W.o(.text+0x367): In function `main':

    : undefined reference to `RSAEncrypt'

    collect2: ld returned 1 exit status

    請問這是瞎密問題>??

    我make打gcc -I /usr/local/ssl/include rsa_test.c

    1 個解答程式設計1 0 年前