About ccPointCloud problem.
Posted: Thu Jul 12, 2018 10:19 am
I try to create a GLWindow, and a ccPointCloud object, and something going wrong.
I got an error from the linker, here is my code and error below.
untitled1.pro
main.cpp
After many times of try and error, I find something wired.
When I declared the ccPointCloud object as a pointer, errors would disappear.
like this
Is there anyone understand what is this situation? and why?
Please help me~
Thank you.
I got an error from the linker, here is my code and error below.
untitled1.pro
Code: Select all
#-------------------------------------------------
#
# Project created by QtCreator 2018-07-03T14:01:18
#
#-------------------------------------------------
QT += core gui opengl openglextensions
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = untitled1
TEMPLATE = app
# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
main.cpp
HEADERS +=
FORMS += \
win32:CONFIG(release, debug|release): LIBS += -LD:/CloudCompare-2.9.1/build_v2/libs/qCC_db/release/ -lQCC_DB_LIB \
-LD:/CloudCompare-2.9.1/build_v2/CC/release/ -lCC_CORE_LIB \
-LD:/CloudCompare-2.9.1/build_v2/libs/qCC_io/release/ -lQCC_IO_LIB \
-LD:/CloudCompare-2.9.1/build_v2/libs/qCC_glWindow/release/ -lQCC_GL_LIB \
-LD:/CloudCompare-2.9.1/build_v2/libs/CCFbo/release/ -lCC_FBO_LIB \
-L$$PWD/../../../../../dev/CGAL-4.12/auxiliary/gmp/lib/ -llibgmp-10 \
-L$$PWD/../../../../../dev/CGAL-4.12/auxiliary/gmp/lib/ -llibmpfr-4 \
else:win32:CONFIG(debug, debug|release): LIBS += -LD:/CloudCompare-2.9.1/build_v2/CC/debug/ -lCC_CORE_LIBd \
-LD:/CloudCompare-2.9.1/build_v2/libs/qCC_io/debug/ -lQCC_IO_LIBd \
-LD:/CloudCompare-2.9.1/build_v2/libs/qCC_glWindow/debug/ -lQCC_GL_LIBd \
-LD:/CloudCompare-2.9.1/build_v2/libs/CCFbo/debug/ -lCC_FBO_LIBd \
-LD:/CloudCompare-2.9.1/build_v2/libs/qCC_db/debug/ -lQCC_DB_LIBd \
-L$$PWD/../../../../../dev/CGAL-4.12/auxiliary/gmp/lib/ -llibgmp-10 \
-L$$PWD/../../../../../dev/CGAL-4.12/auxiliary/gmp/lib/ -llibmpfr-4 \
INCLUDEPATH += D:/CloudCompare-2.9.1/CC/include \
D:/CloudCompare-2.9.1/libs/CCFbo/include \
D:/CloudCompare-2.9.1/libs/qCC_glWindow \
D:/CloudCompare-2.9.1/libs/qCC_io \
D:/CloudCompare-2.9.1/libs/qCC_db \
$$PWD/../../../../../dev/CGAL-4.12/auxiliary/gmp/include \
DEPENDPATH += D:/CloudCompare-2.9.1/CC/include \
D:/CloudCompare-2.9.1/libs/CCFbo/include \
D:/CloudCompare-2.9.1/libs/qCC_glWindow \
D:/CloudCompare-2.9.1/libs/qCC_io \
D:/CloudCompare-2.9.1/libs/qCC_db \
$$PWD/../../../../../dev/CGAL-4.12/auxiliary/gmp/include \
Code: Select all
#include <QApplication>
#include <ccPointCloud.h>
#include <ccGLWidget.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
ccGLWindow *m_window = 0;
QWidget* m_widget = 0;
CreateGLWindow(m_window, m_widget);
m_widget->show();
ccPointCloud points;
return a.exec();
}
When I declared the ccPointCloud object as a pointer, errors would disappear.
like this
Code: Select all
#include <QApplication>
#include <ccPointCloud.h>
#include <ccGLWidget.h>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
ccGLWindow *m_window = 0;
QWidget* m_widget = 0;
CreateGLWindow(m_window, m_widget);
m_widget->show();
ccPointCloud *points = new ccPointCloud;
return a.exec();
}
Please help me~
Thank you.