简体   繁体   中英

Compile V8 Hello World in Netbeans

thankyou for reading

I'm relatively new to programming in C/C++ and have written and compiled a simple adserver as a personal project. I'd now like to incorporate the open source V8 javascript engine from Google so logic unavailable at compile time can be executed during requests to determine which advert to serve in a popular and well known language.

I've spent the last two weeks building V8 using the documentation and have got as far as being able to build and run hello-world from the command prompt on Ubuntu 14 using this documentation and the following command:

g++ -I. -Iinclude main.cpp -o hello-world -Wl,--start-group out.gn/x64.release/obj/{libv8_{base,libbase,external_snapshot,libplatform,libsampler},third_party/icu/libicu{uc,i18n},src/inspector/libinspector}.a -Wl,--end-group -lrt -ldl -pthread -std=c++0x

I've also got this to work from the netbeans project location on ubuntu using symlinks to simulate the file structure where the example is built (my local user directory on the remote host)

My IDE is Netbeans on windows using a remote build host (aforementioned ubuntu) however I can't figure out how to get the same compiler flags that build the program in the above command to work under the linker and cpp options found under project->(right click)->properties->build in Netbeans. I'm close to exhausting research on my own over the past week or so but haven't linked to specific posts, blogs, searches etc as they do not provide additional information relevant to this post that I can apply.

If anybody could help me to find what to place in the compiler flags, linker or linker libraries options under the project build in Netbeans I'd be most grateful.

Regards,

James

-I. -Iinclude Include Paths: C++ Compiler -> Include Directories

-lrt -ldl -pthread libraries: Linker -> Libraries -> Add Standard Libraries -> select "Posix Threads", "Realtime" and "Dynamic Loader" (I'm not too sure of the exact names as I'm not on a Linux box at the moment).

-std=c++0x: C++ Compiler -> C++ Standard -> C++11

-Wl,--start-group out.gn/x64.release/obj/{libv8_{base,libbase,external_snapshot,libplatform,libsampler},third_party/icu/libicu{uc,i18n},src/inspector/libinspector}.a -Wl,--end-group
I guess that all of this needs to go into

Linker -> Additional Options

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