New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demo生成问题,使用HelloWorld CPP里面的命令生成的时候,出现了以下问题 #48
Comments
HelloServer, 怎么来的? |
我用了官方文档中创建服务这一项的命令:/usr/local/tars/cpp/script/cmake_tars_server.sh TestApp HelloServer Hello |
这是因为你编译tars没有开启http2, 这种情况下: 可以参考: |
除此以外,我重启服务器后,切换到root用户,再次运行pm2 start tars-web-system,返回了script not found 的错误,似乎pm2查找脚本的目录是当前目录 |
因为切换用户以后, 你的nodejs的环境变量没有生效, 安装过程中会写这个环境变量到~/.bashrc or ~/.profile, 可以检查一下, 更新到你当前用户的环境变量即可
…------------------ 原始邮件 ------------------
发件人: "XiDianZuoYun"<notifications@github.com>;
发送时间: 2020年3月26日(星期四) 上午10:56
收件人: "TarsCloud/TarsCpp"<TarsCpp@noreply.github.com>;
抄送: "Jarod"<ruanshudong@qq.com>;"Manual"<manual@noreply.github.com>;
主题: Re: [TarsCloud/TarsCpp] Demo生成问题,使用HelloWorld CPP里面的命令生成的时候,出现了以下问题 (#48)
除此以外,我重启服务器后,切换到root用户,再次运行pm2 start tars-web-system,返回了script not found 的错误,似乎pm2查找脚本的目录是当前目录
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
运行了,重启之后依然无效 |
另外之前两个问题我已经解决了,第一个我选择更新GCC到5.3+,第二个我安装了libnghttp2,并复制libnghttp2.a重命名libnghttp2_static.a |
你是需要用http2的功能?
nghttp2 1.4以后的版本静态库应该是libnghttp2_static.a 啊?
开启tars编译,打开HTTP2会自动拉取nghttp2的包并编译, 最终安装在/usr/local/tars/cpp/thirdparty/lib 下
…------------------ 原始邮件 ------------------
发件人: "XiDianZuoYun"<notifications@github.com>;
发送时间: 2020年3月26日(星期四) 中午11:20
收件人: "TarsCloud/TarsCpp"<TarsCpp@noreply.github.com>;
抄送: "Jarod"<ruanshudong@qq.com>;"Manual"<manual@noreply.github.com>;
主题: Re: [TarsCloud/TarsCpp] Demo生成问题,使用HelloWorld CPP里面的命令生成的时候,出现了以下问题 (#48)
另外之前两个问题我已经解决了,第一个我选择更新GCC到5.3+,第二个我安装了libnghttp2,并复制libnghttp2.a重命名libnghttp2_static.a
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
不是我需不需要的问题,我完全按照https://tarscloud.github.io/TarsDocs/installation/source.html这个里面的说明进行安装的, |
1 默认编译tars是没有打开HTTP2, 你编译tars的时候, cmake .. 可以看到TARS_HTTP2 OFF这样的输出
2 因此你的创建自己的Helloworld时, 也需要关闭http2, 在cmake时 cmake .. -DTARS_HTTP2=OFF, 这里demo处理得不好, 默认打开了http2, 导致你编译不过(新版本应该改了的), 要看你用cmake_tars_server.sh创建的服务的CMakeLists.txt里面的默认值是什么
3 tars-node-web打不开的问题分两个:
- source ~/.bashrc, 使nodejs的环境变量生效, 这个环境变量是安装tars时自动下载nodejs安装, 并设置好环境变量的
- pm2 list, 查看模块(有两个模块)
- 3000端口对应的tars-node-web
- 3001端口对应的tars-user-system
这两个模块都需要打开, web具体定位见文档: https://tarscloud.github.io/TarsDocs/installation/web.html
…------------------ 原始邮件 ------------------
发件人: "XiDianZuoYun"<notifications@github.com>;
发送时间: 2020年3月26日(星期四) 中午11:31
收件人: "TarsCloud/TarsCpp"<TarsCpp@noreply.github.com>;
抄送: "Jarod"<ruanshudong@qq.com>;"Manual"<manual@noreply.github.com>;
主题: Re: [TarsCloud/TarsCpp] Demo生成问题,使用HelloWorld CPP里面的命令生成的时候,出现了以下问题 (#48)
不是我需不需要的问题,我完全按照https://tarscloud.github.io/TarsDocs/installation/source.html这个里面的说明进行安装的,里面似乎没有提到打开/关闭nghttp2的问题,
然后我试图运行https://tarscloud.github.io/TarsDocs/hello-world/tarscpp.html
分别遇见了打不开tars-node-web、找不到-lnghttp2_static的问题
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
[ 50%] Linking CXX executable ../bin/HelloServer
/usr/local/tars/cpp/lib/libtarsutil.a(tc_thread.cpp.o): In function
tars::TC_Thread::start()': tc_thread.cpp:(.text+0xb79): undefined reference to
pthread_create'/usr/local/tars/cpp/lib/libtarsservant.a(Application.cpp.o): In function
tars::Application::main(tars::TC_Option const&)': Application.cpp:(.text.startup+0x8a3): undefined reference to
pthread_create'Application.cpp:(.text.startup+0x1002): undefined reference to
pthread_create' /usr/local/tars/cpp/lib/libtarsutil.a(tc_logger.cpp.o): In function
tars::TC_LoggerThreadGroup::start(unsigned long)':tc_logger.cpp:(.text+0x1e3): undefined reference to
pthread_create' /usr/local/tars/cpp/lib/libtarsutil.a(tc_timeprovider.cpp.o): In function
tars::TC_TimeProvider::getInstance()':tc_timeprovider.cpp:(.text+0x132): undefined reference to `pthread_create'
collect2: error: ld returned 1 exit status
src/CMakeFiles/HelloServer.dir/build.make:122: recipe for target 'bin/HelloServer' failed
make[2]: *** [bin/HelloServer] Error 1
CMakeFiles/Makefile2:223: recipe for target 'src/CMakeFiles/HelloServer.dir/all' failed
make[1]: *** [src/CMakeFiles/HelloServer.dir/all] Error 2
Makefile:83: recipe for target 'all' failed
make: *** [all] Error 2
这似乎是由于生成tars静态库libtarsutil.a的时候没有正确链接lpthread导致?但是我之前的利用源码编译tars框架和tarsweb的时候是完全按照指南做的,没有发现有需要特别链接lphtread的地方
The text was updated successfully, but these errors were encountered: