I am trying to use QT in iOS.
#include <QtGui/qprinter.h>
QPrinter print;
Above code gives "Variable has incomplete type 'QPrinter'" error. Though QtGui/qprinter.h has complete definition for QPrinter. Any ideas how to resolve this problem?
The qprinter.h file has this preprocessor condition before the definition of QPrinter:
#ifndef QT_NO_PRINTER
// class QPrinter {
// ...
// }
#endif
Maybe on iOS QT_NO_PRINTER is defined, perhaps because it is not supported? I can't find any official documentation that says as much, but it would be easy enough to test if that macro is defined in your build.
Related
The implementation of function memcmp in glibc uses the macro DBLALIGN(eg, DBLALIG(a3, a0, srcli)) to compare two unsinged int integer. DBLALIGN is delcared as follows. However, the definition of __insn_dword_align is not found in glibc source codes. Where can I find it. Thank you!
#ifdef __tilegx__
#define DBLALIGN __insn_dblalign
#define REVBYTES __insn_revbytes
#else
#define DBLALIGN __insn_dword_align
#define REVBYTES __insn_bytex
#endif
It's a gcc builtin. See e.g. here.
I cannot find the definition
You wouldn't find a definition for any builtin. That's what "builtin" means: the compiler recognizes builtin by name and emits required instructions directly to assembly.
I just learn clang tool about How to write RecursiveASTVisitor based ASTFrontendActions.
I followed the example in the documentation and compile the example code, and there was always one error. I don't know why it have this error and how to solve it. I didn't find the solution of related problem. I don't know whether who meet the same problem and solved it.
/home/sun/project/clang-llvm/llvm/tools/clang/tools/extra/find-class-decls/FindClassDecls.cpp:44:31: error: conflicting return type specified for ‘virtual clang::ASTConsumer* FindNamedClassAction::CreateASTConsumer(clang::CompilerInstance&, llvm::StringRef)’
In file included from /home/sun/project/clang-llvm/llvm/tools/clang/tools/extra/find-class-decls/FindClassDecls.cpp:4:0:
/home/sun/project/clang-llvm/llvm/tools/clang/include/clang/Frontend/FrontendAction.h:64:40: error: overriding ‘virtual std::unique_ptr clang::FrontendAction::CreateASTConsumer(clang::CompilerInstance&, llvm::StringRef)’
ninja: build stopped: subcommand failed.
Thanks!
Oops. I've updated the documentation the rest of the way. It should have read:
class FindNamedClassAction : public clang::ASTFrontendAction {
public:
virtual std::unique_ptr<clang::ASTConsumer> CreateASTConsumer(
clang::CompilerInstance &Compiler, llvm::StringRef InFile) {
return std::unique_ptr<clang::ASTConsumer>(
new FindNamedClassConsumer(&Compiler.getASTContext()));
}
};
As of r215323, FrontendAction::CreateASTConsumer was changed to return a std::unique_ptr<clang::ASTConsumer> instead. I've updated the documentation on http://clang.llvm.org/docs/RAVFrontendAction.html to reflect that.
when I change to std::unique_ptr. At the same time, I keep return new FindNamedClassConsumer(&Compiler.getASTContext()); not like you have updated the documentation "return new FindNamedClassConsumer;". Now When I compile FindClassDecls.cpp, there is still another error.
/home/sun/project/clang-llvm/llvm/tools/clang/tools/extra/find-class-decls/FindClassDecls.cpp:46:64: error: could not convert ‘((&(& Compiler)->clang::CompilerInstance::getASTContext()), (operator new(24ul), (((FindNamedClassConsumer*))->FindNamedClassConsumer::FindNamedClassConsumer(), ((FindNamedClassConsumer*)))))’ from ‘FindNamedClassConsumer*’ to ‘std::unique_ptr’.
Thank you very much!
I'm trying to use the sqlite3 C library for our iOS app, and so I've included the sqilte3.c file into my project (this one http://goo.gl/BcIChe). When I build the project, I've only one error, but several times :
Use of undeclared identifier sqlite3one
I discovered that sqlite3one is used like this :
SQLITE_PRIVATE const int sqlite3one;
# define SQLITE_BIGENDIAN (*(char *)(&sqlite3one)==0)
# define SQLITE_LITTLEENDIAN (*(char *)(&sqlite3one)==1)
# define SQLITE_UTF16NATIVE (SQLITE_BIGENDIAN ? SQLITE_UTF16BE : SQLITE_UTF16LE)
And so, when I use the SQLITE_UTF16NATIVE directive, the error occurs. I suspect that the sqlite3one constant is not here at the preprocessor compile time, and so it can't resolve SQLITE_BIGENDIAN, SQLITE_LITTLEENDIAN and so on.
My question is : can we use constant variable in preprocessor directive like this ? Have you another solution about this ?
Many thanks
EDIT : Oh, I resolved it, it was just a mistake of the library (which I have imported as it stands), the sqlite3one constant was not declared in the appropriate #ifdef section ;)
Thanks for your answer.
I have installed the current stable JEDI Code library in C++ Builder XE3 on Windows 7 x32. It works fine, but only as long as I don't include files like JclFileUtils.hpp which are including JclWin32.hpp. Then I get always the compiler error E2040: "Declaration terminated incorrectly" (in file JclWin32.hpp, line 682, second line in the following code snippet):
#define NetApi32 L"netapi32.dll"
static const System::Int8 CSIDL_PROGRAM_FILESX86 = System::Int8(0x2a);
#define RT_MANIFEST (System::WideChar *)(0x18)
I neither have an idea were this error comes from, nor could I found any hints to this. What could be the cause? Thanks in advance.
I got help and the solution for this problem. Just replace the static const declaration:
static const System::Int8 CSIDL_PROGRAM_FILESX86 = System::Int8(0x2a);
with this macro definition:
#define CSIDL_PROGRAM_FILESX86 0x2a
This is a bug in JclWin32.pas.
In C/C++, the Win32 API declares CSIDL values in Microsoft's shlobj.h header using preprocessor #define statements, eg:
#define CSIDL_PROGRAM_FILESX86 0x002a
After the preprocessor is run and performs #define symbol replacements, the compiler ends up seeing the following invalid declaration in JclWin32.hpp:
static const System::Int8 0x002a = System::Int8(0x2a);
JCL should not be re-declaring CSIDL_PROGRAM_FILESX86 (or any other CSIDL value) at all. It should be either:
using Delphi's own Winapi.ShlObj unit, which already declares CSIDL values.
if not using the Winapi.ShlObj unit, then it should at least be declaring its manual CSIDL values as {$EXTERNALSYM} so they do not appear in the generated JclWin32.hpp file. If needed, JCL can include an {$HPPEMIT '#include <shlobj.h>'} statement to pull in the existing Win32 API declarations for C/C++ projects to use.
Why I try to run the following OpenCV program, it shows the following error :
ERROR:
test_1.exe - Application Error
The application failed to initialize properly (0x80000003).
Click on OK to terminate the application.
CODE:
#include "cv.h"
#include "highgui.h"
int main()
{
IplImage *img = cvLoadImage("C:\\face.bmp");
cvSetImageROI(img, cvRect(100,100, 100, 100));
cvAddS(img, cvScalar(50), img);
cvResetImageROI(img);
cvShowImage("Test", img);
cvWaitKey(0);
return 0;
}
When i press F5(im using vs2008express), the program encounters a break point...i have attached a picture...dont know, whether, it will help or not.
Error Snapshot Link
It is not that, only this program is producing this error, but also any kind of image manipulation funciton containing (OpenCV)program is resulting in this sitution.
Such as : cvSmooth
one last thing, it there any dedicated OpenCV forum or sth like that?
I am an administrator.So, yes, ive the permission.
a version mismatch.
sorry, i didn't get it?Version mismatch with what?
But, i have found the error using dependency walker.
Warning: At least one module has an unresolved import due to a missing export
function in a delay-load dependent module.
and also found that, it is a common problem, and found some info in the FAQ of DW...
Why am I seeing a lot of applications where MPR.DLL shows up in red under
SHLWAPI.DLL because it is missing a function named WNetRestoreConnectionA?
I also get a "Warning: At least one module has an unresolved import due to
a missing export function in a delay-load dependent module" message.
Function name : WNetRestoreConnectionA
But there is no guideline about how to solve it. Though, they say, it is not a problem.
i googled a little and found a suggestion.It says,
Turn off your compilers setting to assume you are programming for Win9x.
(I just lost which setting but it is not that difficult, use a #define...)
But i have no idea, how to do that in Visual Studio 2008 express.
Any suggestion how to solve it...
This usually indicates a problem with a dll; either you don't have permission, or a version is mismatched. Try running as Administrator to see if it is a permissions problem. If that doesn't help, try using the Dependency Walker.