Tag Archives: C

error: expected declaration or statement at end of input

This error is sometimes reported in Linux programming, and it hurts a lot because the compiler doesn’t tell you exactly what went wrong…
There are several possible reasons for this error:
1) Where the program is missing a parenthesis.
The detection method is as follows. If you are programming with VIM, you can use % to match the parentheses one by one. Here is how I did it
2) the variable does not declare

Error c2371: ‘xxx’: redefinition; different basic types solutions

http://blog.csdn.net/araecall/article/details/5583644
 
error C2371: ‘XXX’ : redefinition; Different basic types
define a structure, stored in a separate.h file, compile the error above, remove the #include “structure filename” from the.cpp file that instantiates the structure, and solve the problem.
later in a separate file and instantiate a such structure, the results and the above problems, structure of the object name is the same, in order to avoid the problems caused by this, and another. The CPP file renaming structure of the object, the problem was not solved, then the structure defined. H file, plus the “# pragma once”, compiled through.

win7 VMware Error:1325 Documents Is not a valid short name solution

Recently, when installing VMware8.0 in Win7, I encountered Error:1325 Documents is not an valid short name. I still cannot install it. There are many answers on the Internet, but I failed to solve them one by one. Finally, combined with the solutions on the Internet, I summed up an effective method, at least on my machine is a success.
Found in the registry HKEY_CURRENT_USER/Software/Microsoft/Windows/CurrentVersion/Explorer/Shell Folders directory, double-click the Favorites options. The diagram below:

Check whether the computer has D partition (D disk). If it does not (where the problem is), set it as follows:


Change the partition identifier specified by the Favorites string. Mine is D:\Favorites.
Note: at the beginning, there were no D disks on my machine, there were C, E, F and G disks, but I changed G disks to D disks.

solve atibtmon.exe error

After the laptop installed Win7, toss and turn, with the driver wizard updated all the drivers, and installed a variety of software, then use QQ housekeeper optimization system.

Later, it was found that the system often reported errors at startup, atibtmon.exe, as follows:

Searched on the Internet, some said to reinstall the video card driver, some said to reinstall visual c++ 2008.

Reinstall again, report the error as before.

Finally, he tossed around AMD’s management software and tried it. It was a battery setup problem.

When the battery is selected to “maximize battery life”, atibtmon.exe will report an error when the laptop is switched from the wired power supply to the battery.

The following Settings, battery select “Maximize performance” when the problem is resolved.

Ora-00947: not enough values

Transfer: http://space.itpub.net/21213917/viewspace-607671
ORA-00947: Not enough values
This error occurred while performing the INSERT.
Insert into table 1 values (123,2423,12);
The structure of Table 1 has four columns, and obviously only three values are inserted, so this problem arises.
After the value of the column is added, OK.
If you want to insert only three values:
Insert into table 1(a,b,c) values (123,2423,12);
Just use this statement.

Solution to msxml3.dll error ‘800c0008’ the system cannot locate the resource specified

msxml3.dll ?펳 ‘800 c0005’

The system always locate The resource specified.

/plugins. Asp??А 165

this is usually used when collecting information or statically updating a web page with XMLHTTP, and I’ve used similar errors before

set objXmlHttp = server.createobject (” microsoft.xmlhttp “) ‘is generally used in versions below msxml2.6

‘ set objXmlHttp = server.createobject (” msxml2.xmlhttp “) ‘supported by msxml3.dll+

is used instead of
, but now every error is reported.

has searched all the technical forums and search engines I know on the Internet, and there may be a variety of situations that could cause such a problem. Here is a summary:

(a) that is the most basic, your server does not support XMLHTTP or component version low, you need to download the corresponding component. This is not required by the average server, and XMLHTTP is supported in most cases, so this is a rare case.

(2) msxml3.dll file may be corrupted or the file is not authorized enough (this case is less likely), if the file is corrupted, you can download the corresponding system environment’s msxml3.dll file to replace (2003 system seems to be under c:// Windows /system32), need to close the corresponding service such as iis and so on to overwrite.

(three) fireproof or anti-virus software has disabled the corresponding port, the specific how to set it depends on different software, you can try to close the firewall or anti-virus software and then test to determine whether it is the problem.

(4) try re-registering the component. Start & gt; > Run: RegsvR32 MSxml3.DLL

(5) DNS resolution error, check your network Settings or correct DNS access

(6) check your IP filter Settings (this is not very clear)

(7) resource failure of the other party. For example, when collecting some information, the other party does not have the error that leads to program termination, which may also be the case. This error occurs when the XMLHTTP component’s Open method is called, followed by the Send method. An 8000005 error occurs when the URL parameter of the open method is not accessible. And if such an error occurs, the application terminates and cannot continue. Most programs are written like this:

Function functionName(pararm …)

Dim Http

= Set Http Server. CreateObject (” MSXML2. XMLHTTP. 4.0 “)

With Http

.open “GET”,HttpUrl,False

.Send

End With

If Http.Readystate< > 4 then

Set Http=Nothing

……

Exit function

End if

End Function

most programs use the XMLHTTP Readystate property to determine the return status from the server. This is not always the case, and many times using the ReadyState property does not actually detect errors in the program flow. When an error is encountered, the program will still be terminated. In fact, modify the above code, it is possible to achieve the process of skipping the execution of the program encountered errors, so that the program continues to run. The modified code is as follows:

Function functionName(pararm …)

Dim Http

= Set Http Server. CreateObject (” MSXML2. XMLHTTP. 4.0 “)

With Http

.open “GET”,HttpUrl,False

.Send

End With

On Error Resume Next

If Http.Status< > 200 then

Set Http=Nothing

……

Exit function

End if

End Function
When the
Send method produces an error, the ReadyState value may be 4, but the Status value must not be 200. Well, I’ve tracked ReadyState and Status’s worth to previous results many times. There may be mistakes. I haven’t found them so far.

hope the above program solution can help you!! If you have a better solution, please let me know.

, which I illustrate with msxml2.xmlhttp.4.0, is also suitable for other versions of the XMLHTTP component. To check which versions of the XMLHTTP component you have installed on your system, look under HKEY_CLASSES_ROOT in the registry.

(8) go to the server and set your IE security options (try setting the level to medium or low). Just add the domain name you want in the trusted website.

(9) I have tried all of the above methods after looking at them, but none of them worked out. So I went to Microsoft and downloaded MSXML4.0 Service Pack 2 (Microsoft XML Core Services) and Hotfix for MSXML4.0 Service Pack 2 – KB832414 – Simplified Chinese (KB832414_MSxml4.0_x86.exe) and installed it. The problem was finally solved!!

(10) if your case, I can solve the above methods, it is back, you continue to look for other possible to online, if you don’t want to continue to find you reinstall your iis or simply reshipment system (do this before you can try to restart the system to see, may probably as if lucky can use again

Analysis of compilation errors of “error conflicting types for function”

When you’re compiling a C program using GCC, you sometimes run into a compilation error that says “error: conflicting Types for ‘function.'” The definition of a function is not consistent with the declaration.

(a) First, let’s take a look at an example where the definition and declaration of a function are inconsistent:

#include <stdio.h>

int func(int a);

int func(void) {
    return 0;
}

int main(void) {

    func();

    return 0;
}

Compiler:

gcc -g -o a a.c
a.c:5:5: error: conflicting types for ‘func’
 int func(void) {
     ^
a.c:3:5: note: previous declaration of ‘func’ was here
 int func(int a);

You can see that this error occurs at compile time because the declaration and definition of “func” are inconsistent (one with arguments and one without).
(b) Recently, when I ported some code to JFFS2, this error also occurred at compile time. But I found that the declaration and definition of the function in the header file were exactly the same, which surprised me. The conclusion is that the function parameter type is defined after the function is declared. The simplified code is as follows:

#include <stdio.h>

void func(struct A *A);

struct A {
        int a;
};

void func(struct A *A)
{
        printf("%d", A->a);
}

int main(void) {
        // your code goes here
        struct A a = {4};
        func(&a);
        return 0;
}

Where the definition of “structure A” is placed after the “func” function declaration, and the func function argument is the “structure A*” type. The compilation results are as follows:

gcc -g -o a a.c
a.c:3:18: warning: ‘struct A’ declared inside parameter list
 void func(struct A *A);
                  ^
a.c:3:18: warning: its scope is only this definition or declaration, which is probably not what you want
a.c:9:6: error: conflicting types for ‘func’
 void func(struct A *A)
      ^
a.c:3:6: note: previous declaration of ‘func’ was here
 void func(struct A *A);
      ^

You can also see the output error “error: Conflicting Types for ‘func'”. Perhaps a compilation warning is a clue.

Error c2259 cannot instance abstract class due to following members

Error description:
E:/mywork/1.7 sp1/ginfo/client/SRC/skdesigner/dsgquerydlg. H. (295) : error C2259: ‘CDsgFormatDataMgrDlg’ : Always instantiate the abstract class due to the following members:
e:/mywork/1.7 sp1/ginfo/client/SRC/skdesigner/dsgformatdatamgrdlg. H (14) : see declaration of ‘CDsgFormatDataMgrDlg’
 
Reason for error:
An implementation class inherits an abstract base class, but does not implement all the methods in the abstract base class.
 
Can be similarly implemented:
Virtual Void EnableControl(PSKOPEROBJECT Lpoo, BOOL bEnable) {}//
 
Code example:
 
class CDsgFormatDataMgrDlg : public CDialogImpl< CDsgFormatDataMgrDlg> ,
public ISkBusinessEngineSink// abstract base class
{
public:
enum {IDD = IDD_FORMATDATAMGR_DLG};

CDsgFormatDataMgrDlg ();
virtual ~ CDsgFormatDataMgrDlg ();
virtual BOOL PreTranslateMessage(MSG* pMsg);

}
 
The class ISkBusinessEngineSink
{
public:
virtual void HandleOneCSObject (LPCTSTR lpszName) {}
virtual BOOL HandleUpdateCalendarResult (int nType, PCALENDAREVENT lpce,
DWORD dwClientTmpId, BOOL bRet, DWORD dwErrorCode) {return FALSE; }
virtual BOOL HandleUpdateDesktopResult (int nType, PDESKTOPITEM lpdi,
DWORD dwClientTmpId, BOOL bRet, dwords dwErrorCode) = 0.

virtual void HandleHotBUList(PHOTBU LPHB, int nCount) {}
virtual void OnDBFuncReady(BOOL bReady) = 0;
virtual void OnDBViewReady(BOOL bReady) = 0;
virtual void OnSNReady(BOOL bReady) = 0;
virtual void OnTableReady(BOOL bReady) = 0;

}
 
Methods in the abstract base class must fully implement…
Appendix:
The choice of http://www.cnblogs.com/shenfx318/archive/2007/01/25/630760.html (abstract base classes and interfaces) and the difference between
http://www.cnblogs.com/TravelingLight/archive/2010/06/02/1750073.html (abstract base class for some of the problems)
http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Companion/cxx_crib/interfaces.html
(OO concepts and abstract classes and interfaces)
 

VS2010 library function problem: objidl. H (11266): error c2061: syntax error: identifier ‘__ RPC__ out_ xcount_ part’

This error was caused by the lack of lib files or include, but the UI in VS2010 was set up so badly that people didn’t know how to edit the original VC++ directory files. The solution is as follows:
Open the VS2010 project
Notice that in the lower left corner are Solution Explorer, Class View, Property Manager, and many other options.
is revised for Directories like the one we introduced in VS2010.

display Property Manager
contains the Debug|Win32 and Release|Win32 options
. You can set the project properties of Debug and Release
. Open any of them
. Double click microsoft.cpp.win32.
is modified here for the tutorial vc Directories. H (11266) : error C2061: syntax error: identifier ‘___, rpc___, out_xcount_part’
use the above method to delete the DirectX SDK Include from the Include path. Supplements: the

Directories that were modified for VC++ Directories in the project property dialog are project specific. The above modified VC++ Directories are large, affecting all project Directories and configuration Directories (Debug/Release/…) .

error: expected unqualified-id before ‘.’ token

C++ introduced the mutex header, which USES mutext.lock() to lock and mutex.unlock() to release the lock.

#include <mutex>

using namespace std;

mutex t_mutex;

class Csingleob
{
        private:
                Csingleob(){}
        static Csingleob *p;

        public:
                static Csingleob* getInstance()
                {
                        mutex.lock();
                        if (p == NULL)
                        {
                                p = new Csingleob();
                        }
                        mutex.unlock();
                        return p;
                }
};

However, an error is reported at compile time. Prompt:

error: expected unqualified-id before ‘.’ token    mutex.lock();

It is an error to use mutext.lock() to lock, and mutex.unlock() to release the lock. You should instantiate the class or structure first, then call the corresponding method with “.”
After modification:

#include <mutex>

using namespace std;

mutex t_mutex;

class Csingleob
{
        private:
                Csingleob(){}
        static Csingleob *p;

        public:
                static Csingleob* getInstance()
                {
                        t_mutex.lock();
                        if (p == NULL)
                        {
                                p = new Csingleob();
                        }
                        t_mutex.unlock();
                        return p;
                }
};

Csingleob* Csingleob::p = NULL;