Stupid C ++ syntax has not been declared

I am trying to take a Qt C ++ project originally written for Windows and cross-compile it for embedded Linux. Now this program compiles the search and works on Windows, so this problem should be something specific to the OS (which I did not think about with Qt code) or configuration-related, but it’s difficult for me to track this because I do not fully understand C ++ syntax.

my make command:

arm-linux-gnueabihf-g ++ -c -march = armv7-a -marm -mthumb-interwork -mfloat-abi = hard -mfpu = neon -mtune = cortex-a8 -O2 -O3 -Wall -W -D_REENTRANT -DCHL80Net - DPHASE_TO_NEUTRAL -DCHL80NET -DCANLCD_BUILD -DQT_NO_DEBUG -DQT_XML_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I ../ mkspecs / qws / linux-am335x. -I ../include/QtCore -I ../include/QtGui -I ../include/QtXml -I ../include -I. -IApp -IApp / Model / ModelSim -IApp / Model -I. -IPages -IApp / GUI / Widgets -App / GUI / Pages -App / GUI -App / GUI / Widgets -App / GUI / Pages / Util -IApp / GUI / Pages -App / Log4Qt -I.obj -o.obj /CanInterface.o App / Can / CanInterface.cpp

Error:

Application / Can / CanInterface.cpp: in the member function 'void CanInterface :: closeConnection (): application /Can/CanInterface.cpp: 68: 5: error:' :: close was not declared make: * [.obj / CanInterface .o]
Error 1

, :

void CanInterface::closeConnection()
{
    ::close(m_socket);
    m_socket = -1;

, , ++, , , ::function() .

, , , close(). , CanInterface undeclaired, ?

CanInterface :

class CanInterface : public QObject 
{
        Q_OBJECT

, , , QObject. :

  • ?
  • , QObject close() ? ::close , ?
  • ?
+3
2

++ , . C, , , , , my_library_foo() C, my_library::foo() ++. :: , , : , , / , (/etc/passwd/) (foo/bar).

, ::close , , , <unistd.h> POSIX.

+3

, ::some_function() .

C . * nix man, .

man close

Ubuntu

NAME
       close - close a file descriptor

SYNOPSIS
       #include <unistd.h>

       int close(int fd);

, , unistd.h - ++ .

, google , . http://linux.die.net/man/2/close

+4

All Articles