Go back to Richel Bilderbeek's homepage.

Go back to Richel Bilderbeek's C++ page.

 

 

 

 

 

(C++) QCanvas: No such file or directory

 

Compile error.

 

 

 

 

 

Full error message

 

/MyFolder/main.cpp:1: error: QCanvas: No such file or directory

 

 

 

 

 

 

Cause

 

Operating system: Ubuntu 10.04 LTS Lucid Lynx

IDE: Qt Creator 2.0.0

Project type: Console Application

Compiler: G++ 4.4.1

Libraries used:

 

 

 

 

 

Qt project file

 

#-------------------------------------------------
#
# Project created by QtCreator 2010-07-26T10:46:45
#
#-------------------------------------------------
QT += core
QT -= gui
TARGET = CppCompileErrorQCanvasNoSuchFileOrDirectory
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp

 

 

 

 

 

Source code

 

#include <QCanvas>

int main()
{

}

 

 

 

 

 

 

Solution

 

As far as I can understand, QCanvas is a Qt3 class that is obsolete in Qt Creator 2.0.0.

 

The code below, although #including the proper header file, will give the compile error ':: error: collect2: ld returned 1 exit status'.

 

#include <qt3/qcanvas.h>

int main()
{

}

 

 

 

 

 

Go back to Richel Bilderbeek's C++ page.

Go back to Richel Bilderbeek's homepage.

 

Valid XHTML 1.0 Strict