简体   繁体   English

在Netbeans中编译V8 Hello World

[英]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. 我是C / C ++编程的新手,并且编写并编译了一个简单的adserver作为个人项目。 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. 我现在想合并Google的开源V8 javascript引擎,以便在请求期间执行编译时不可用的逻辑,以确定哪种广告以流行和众所周知的语言进行投放。

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: 我已经花了两周的时间使用该文档来构建V8,并且能够使用此文档和以下命令从Ubuntu 14的命令提示符处构建并运行hello-world:

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) 我也从ubuntu上的netbeans项目位置使用符号链接模拟了构建示例的文件结构(远程主机上的本地用户目录),

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. 我的IDE是使用远程构建主机(前述的ubuntu)的Windows上的Netbeans,但是我无法弄清楚如何获得与上述命令中构建程序相同的编译器标志,以在project->下的链接器和cpp选项下工作(右键单击)->属性->在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. 如果有人可以帮助我找到在Netbeans项目构建下的编译器标志,链接器或链接器库选项中放置的内容,我将不胜感激。

Regards, 问候,

James 詹姆士

-I. -一世。 -Iinclude Include Paths: C++ Compiler -> Include Directories -Iinclude包含路径:C ++编译器->包含目录

-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). -lrt -ldl -pthread库:链接器->库->添加标准库->选择“ Posix Threads”,“ Realtime”和“ Dynamic Loader”(我不太确定确切的名称,因为我不在目前是Linux机顶盒)。

-std=c++0x: C++ Compiler -> C++ Standard -> C++11 -std = c ++ 0x:C ++编译器-> C ++标准-> 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 -Wl,-start-group out.gn/x64.release/obj/{libv8_{base,libbase,external_snapshot,libplatform,libsampler},third_party/icu/libicu{uc,i18n},src/inspector/libinspector}。 -Wl,-端基
I guess that all of this needs to go into 我想所有这些都需要

Linker -> Additional Options 链接器->其他选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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