pnacl-ld cannot find library

79 views
Skip to first unread message

heiheshang

unread,
Apr 12, 2017, 12:39:46 PM4/12/17
to Native-Client-Discuss
VALID_TOOLCHAINS := pnacl glibc clang-newlib win

NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../..)

TARGET = smart_box


include $(NACL_SDK_ROOT)/tools/common.mk


LIBS = ppapi_cpp ppapi pthread box_api

CFLAGS = -Wall
SOURCES = smart_box.cc

PNACL_LDFLAGS += -L$(NACL_SDK_ROOT)/lib/box_api
# Build rules generated by macros from common.mk:

$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))

# The PNaCl workflow uses both an unstripped and finalized/stripped binary.
# On NaCl, only produce a stripped binary for Release configs (not Debug).
ifneq (,$(or $(findstring pnacl,$(TOOLCHAIN)),$(findstring Release,$(CONFIG))))
$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
else
$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
endif

$(eval $(call NMF_RULE,$(TARGET),))

All the time I get an error the library is not found, how to correctly specify the address of the library ?

C:\nacl_sdk\pepper_49\getting_started\SmartBox>make
 CXX  pnacl/Release/smart_box.o
 LINK pnacl/Release/smart_box_unstripped.bc
pnacl-ld: Cannot find '-lbox_api'
Makefile:31: recipe for target 'pnacl/Release/smart_box_unstripped.bc' failed
make: *** [pnacl/Release/smart_box_unstripped.bc] Error -1


Sam Clegg

unread,
Apr 12, 2017, 7:31:08 PM4/12/17
to native-cli...@googlegroups.com
Do see the commands that make is running can you add VERBOSE=1 to your
make invocation?

Also, what is the contents of the $(NACL_SDK_ROOT)/lib/box_api
directory? For your approach to work it should contain the
libbox_api.a library, which it seems like it probably doesn't.

cheers,
sam
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.
> To post to this group, send email to native-cli...@googlegroups.com.
> Visit this group at https://groups.google.com/group/native-client-discuss.
> For more options, visit https://groups.google.com/d/optout.

heiheshang

unread,
Apr 12, 2017, 8:46:04 PM4/12/17
to Native-Client-Discuss
I do not have a file, there is only lib file

четверг, 13 апреля 2017 г., 8:31:08 UTC+9 пользователь Sam Clegg написал:

heiheshang

unread,
Apr 12, 2017, 9:39:34 PM4/12/17
to Native-Client-Discuss
I tried lib to convert to a, using https://code.google.com/archive/p/lib2a/

C:\nacl_sdk\pepper_49\getting_started\SmartBox>make
C:/nacl_sdk/pepper_49/toolchain/win_pnacl/bin/pnacl-clang++ -o smart_box.bc smar
t_box.cc -O2 -IC:/nacl_sdk/pepper_49/include -LC:/nacl_sdk/pepper_49/lib/pnacl/R
elease -lppapi_cpp -lppapi -LC:/nacl_sdk/pepper_49/lib/box_api -lbox_api
pnacl-ld: C:/nacl_sdk/pepper_49/lib/box_api/libbox_api.a: Inva
lid archive member header magic string
diges00083.o/   1492046603  0     0     100666  623       `
Makefile:51: recipe for target 'smart_box.bc' failed
make: *** [smart_box.bc] Error -1

C:\nacl_sdk\pepper_49\getting_started\SmartBox>

четверг, 13 апреля 2017 г., 8:31:08 UTC+9 пользователь Sam Clegg написал:
Do see the commands that make is running can you add VERBOSE=1 to your

Sam Clegg

unread,
May 1, 2017, 3:11:06 PM5/1/17
to native-cli...@googlegroups.com
If you want to use the library you would need to compile it with the
NaCl toolchain.
>> > email to native-client-di...@googlegroups.com.
>> > To post to this group, send email to native-cli...@googlegroups.com.
>> > Visit this group at
>> > https://groups.google.com/group/native-client-discuss.
>> > For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Native-Client-Discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to native-client-di...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages