本文介绍了Synology DSM helloworld包编译错误写成C ++的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请帮帮我。我尝试编译hello world package编写的c ++。我的环境是OS:Ubuntu 14.4,而synology工具链是bromolow 64bit编译器,但我无法获得helloworld.cgi。我不知道原因。源代码是

Please help me. I try to compile hello world package written c++. My environment is OS : Ubuntu 14.4,and synology toolchain is bromolow 64bit compiler, But I cannot get helloworld.cgi. I don't know the reason. Source code are

#include "webman.h"

#include <string>

#include <stdio.h>

#include <synosdk/proc.h>

using namespace std;

int main(int argc, char* argv[]) {
    WebMan _cgi;
    Json::Value out;
    out["uname"] = szData;
    out["ret"] = ret;
    out["success"] = ret;
    _cgi.WriteHeader();
    _cgi.WriteBody(out);
    return 0;
}



和make文件是


and make file is

.PHONY: all clean
.SUFFIXES: .cgi
CXXFLAGS=$(shell pkg-config libdsm --cflags)
LDFLAGS+=$(shell pkg-config libdsm --libs)
 
# source files

SRC=${cgi_name}.cpp
CGI=$(SRC:%.cpp=../%.cgi)
 
all: $(CGI)
 
../%.cgi: %.cpp
    echo $(CXX) -o $@ $^ $(CFLAGS) $(LDFLAGS)
    $(CXX) -o $@ $^ $(CXXFLAGS) $(LDFLAGS)
 
clean:
    rm -f core *~ *.o $(CGI)



我运行命令./PkgCreate.py -x0 -c helloworld。

然后我收到了这样的错误。

< pre lang =css> ; =======运行构建脚本=======



make:***没有规则可以制作目标`distclean&#39; 。停止。

==& gt; cgi

==& gt; js

& lt; == js

/ usr / local / i686-linux-gnu / bin / i686-linux-gnu-ccache-g ++ -o .. /helloworld.cgi helloworld.cpp -I / usr / local / i686-linux-gnu / include -DSYNO_X64 -O2 -I / usr / syno / include -g -DSYNO_PLATFORM = X64 -g -DSDK_VER_MIN_REQUIRED = 400 -L / usr / local / i686-linux-gnu / lib -L ​​/ usr / syno / lib -Wl,-rpath-link -Wl,/ usr / syno / lib -L ​​/ usr / local / i686-linux-gnu / lib -L ​​/ usr / syno / lib -L ​​/ source / libsynocgi / lib -L ​​/ usr / syno / sqlite3 / lib / -L / source / libsynoacl / lib / -L / source / libsynosdk / gpl / -L / source / google-authenticator -1.x -lsynocgi -ljson -lsynowireless-core -lsynoacl -lsynogpl -lsynocoregpl -lsynobandwidth -lsynowimax -lsynosdk -lsynocore -lcrypt -lnet -licui18n -licuuc -licudata -lxml2 -lattr -lm -ldl -lz -lsqlite3 -lgoogleauth -ldsm

/usr/local/i686-linux-gnu/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux -gnu / bin / ld:找不到-lnet

collect2:ld返回1退出状态

make [2]:*** [../helloworld.cgi]错误1

make [1]:*** [cgi]错误2

make:*** [ui]错误2



helloworld没有install-dev脚本。



时间成本:00:00:03 [Build - & gt; helloworld]

我收到以下错误:

make [2 ]:*** [../helloworld.cgi]错误1

make [1]:*** [cgi]错误2

make:*** [ ui]错误2< / pre>

请帮助我。


I run command ./PkgCreate.py -x0 -c helloworld.
then I got such error.
<pre lang="css">======= Run build script =======

make: *** No rule to make target `distclean&#39;. Stop.
==&gt; cgi
==&gt; js
&lt;== js
/usr/local/i686-linux-gnu/bin/i686-linux-gnu-ccache-g++ -o ../helloworld.cgi helloworld.cpp -I/usr/local/i686-linux-gnu/include -DSYNO_X64 -O2 -I/usr/syno/include -g -DSYNO_PLATFORM=X64 -g -DSDK_VER_MIN_REQUIRED=400 -L/usr/local/i686-linux-gnu/lib -L/usr/syno/lib -Wl,-rpath-link -Wl,/usr/syno/lib -L/usr/local/i686-linux-gnu/lib -L/usr/syno/lib -L/source/libsynocgi/lib -L/usr/syno/sqlite3/lib/ -L/source/libsynoacl/lib/ -L/source/libsynosdk/gpl/ -L/source/google-authenticator-1.x -lsynocgi -ljson -lsynowireless-core -lsynoacl -lsynogpl -lsynocoregpl -lsynobandwidth -lsynowimax -lsynosdk -lsynocore -lcrypt -lnet -licui18n -licuuc -licudata -lxml2 -lattr -lm -ldl -lz -lsqlite3 -lgoogleauth -ldsm
/usr/local/i686-linux-gnu/lib/gcc/i686-linux-gnu/4.2.1/../../../../i686-linux-gnu/bin/ld: cannot find -lnet
collect2: ld returned 1 exit status
make[2]: *** [../helloworld.cgi] Error 1
make[1]: *** [cgi] Error 2
make: *** [ui] Error 2

There is no install-dev scripts for helloworld.

Time cost: 00:00:03 [Build--&gt;helloworld]
I got the following error:
make[2]: *** [../helloworld.cgi] Error 1
make[1]: *** [cgi] Error 2
make: *** [ui] Error 2</pre>
please help me.

推荐答案




这篇关于Synology DSM helloworld包编译错误写成C ++的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 17:26