I succeeded to build helloworld.c following the openwrt guide and installing the file on the router, however, I have big troubles in installing the cpp version. I don't get what I am missing in the make file as I manage to get an executable, and installing it on the modem but it looks like l can't really run it, the error I get is:
/usr/bin/helloworld: line 1: syntax error: unexpected word (expecting ")")
It is not really a syntax error as I managed to build successfully the file and run it on my host arch, therefore I suspect is a dependency I am missing, could you please tell me if I am doing something wrong? Thanks!
# Name, version and release number
# The name and version of your package are used to define the variable to point to the build directory of your package: $(PKG_BUILD_DIR)
# Source settings (i.e. where to find the source codes)
# This is a custom variable, used below
# Package definition; instructs on how and where our package will appear in the overall configuration menu ('make menuconfig')
# Package description; a more verbose description on what our package does
A simple "Hello, world!" -application.
# Package preparation instructions; create the build directory and copy the source code.
# The last command is necessary to ensure our preparation instructions remain compatible with the patching system.
mkdir -p $(PKG_BUILD_DIR)
cp $(SOURCE_DIR)/* $(PKG_BUILD_DIR)
# Package build instructions; invoke the target-specific compiler to first compile the source file, and then to link the file into the final executable
$(TARGET_CXX) $(TARGET_CXXFLAGS) -c $(PKG_BUILD_DIR)/helloworld.cpp -o $(PKG_BUILD_DIR)/helloworld
# Package install instructions; create a directory inside the package to hold our executable, and then copy the executable we built previously into the folder
$(INSTALL_BIN) $(PKG_BUILD_DIR)/helloworld $(1)/usr/bin
# This command is always the last, it uses the definitions and variables we give above in order to get the job done
$(eval $(call BuildPackage,helloworld))