简体   繁体   中英

Compiling native client's hello_world.c

In the pepper_21 examples folder is a hello_world.c file I'm trying to compile. Here's the command I'm using:

$NACL_SDK_ROOT/toolchain/linux_x86_newlib/bin/x86_64-nacl-gcc hello_world.c -o a.nexe -lppapi

And here's the error:

hello_world.c: In function ‘Instance_DidCreate’:
hello_world.c:86: error: ‘TCNAME’ undeclared (first use in this function)

I adapted the command from this page . How can it successfully be compiled?

You can see by inspecting the Makefile that TCNAME is defined on the command line.

x86_64-nacl-gcc hello_world.c -o a.nexe -lppapi -DTCNAME=newlib 

OR

x86_64-nacl-gcc hello_world.c -o a.nexe -lppapi -DTCNAME=glibc

Depending on which version of the toolchain you are using.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM