Click here to Skip to main content
15,888,610 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
C++
#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 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.
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900