jeudi 26 mars 2015

Synology DSM helloworld package compile error written C++

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;
}



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)



I got such error





======= Run build script =======

make: *** No rule to make target `distclean'. Stop.
==> cgi
==> js
<== 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-->helloworld]
I got the following error:
make[2]: *** [../helloworld.cgi] Error 1
make[1]: *** [cgi] Error 2
make: *** [ui] Error 2



Aucun commentaire:

Enregistrer un commentaire