我用残损的手掌的VS2010,CGAL4.2,Qt5,为什么Qt4.8的例程跑不出呢?如何破解

&re: QT4.7.3在vs2010下建工程出错了,诚邀大虾提供解决方案&&&&
项目--&属性--&链接器--&依赖项添加“boost_thread-vc90-mt-1_57.lib boost_thread-vc90-mt-1_57.lib CGAL_Core-vc90-mt-4.5.lib CGAL_Core-vc90-mt-gd-4.5.lib CGAL_ImageIO-vc90-mt-4.5.lib CGAL_ImageIO-vc90-mt-gd-4.5.lib CGAL_Qt4-vc90-mt-4.5.lib CGAL_Qt4-vc90-mt-gd-4.5.lib CGAL-vc90-mt-4.5.lib CGAL-vc90-mt-gd-4.5.lib QtCore4.lib QtCored4.lib QtGui4.lib QtGuid4.lib”之前我少了最后四个lib,加上去之后编译就好了.cmake-qt(7) — CMake 3.0.2 Documentation
CMake can find and use Qt 4 and Qt 5 libraries.
The Qt 4 libraries are found
find-module shipped with CMake, whereas the
Qt 5 libraries are found using “Config-file Packages” shipped with Qt 5. See
for more information about CMake packages, and
for your Qt version.
Qt 4 and Qt 5 may be used together in the same
cmake_minimum_required(VERSION 3.0.0 FATAL_ERROR)
project(Qt4And5)
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
find_package(Qt5Widgets REQUIRED)
add_executable(publisher publisher.cpp)
target_link_libraries(publisher Qt5::Widgets Qt5::DBus)
find_package(Qt4 REQUIRED)
add_executable(subscriber subscriber.cpp)
target_link_libraries(subscriber Qt4::QtGui Qt4::QtDBus)
A CMake target may not link to both Qt 4 and Qt 5.
A diagnostic is issued if
this is attempted or results from transitive target dependency evaluation.
Qt relies on some bundled tools for code generation, such as moc for
meta-object code generation, uic for widget layout and population,
and rcc for virtual filesystem content generation.
These tools may be
automatically invoked by
if the appropriate conditions
The automatic tool invocation may be used with both Qt 4 and Qt 5.
The tools are executed as part of a synthesized custom target generated by
Target dependencies may be added to that custom target by adding them
target property.
target property controls whether
inspects the C++ files in the target to determine if they require moc to
be run, and to create rules to execute moc at the appropriate time.
If a Q_OBJECT or Q_GADGET macro is found in a header file, moc
will be run on the file.
The result will be put into a file named according
to moc_&basename&.cpp.
If the macro is found in a C++ implementation
file, the moc output will be put into a file named according to
&basename&.moc, following the Qt conventions.
The moc file may be
included by the user in the C++ implementation file with a preprocessor
If it is not so included, it will be added to a separate file
which is compiled into the target.
The moc command line will consume the
target properties from the target it is being
invoked for, and for the appropriate build configuration.
Generated moc_*.cpp and *.moc files are placed in the build directory
so it is convenient to set the
target property may be pre-set for all
following targets by setting the
target property may be populated to set
options to pass to moc. The
variable may be populated to pre-set the options for all following targets.
target property controls whether
inspects the C++ files in the target to determine if they require uic to
be run, and to create rules to execute uic at the appropriate time.
If a preprocessor #include directive is found which matches
ui_&basename&.h, and a &basename&.ui file exists, then uic will
be executed to generate the appropriate file.
Generated ui_*.h files are placed in the build directory so it is
convenient to set the
target property may be pre-set for all following targets
by setting the
target property may be populated to set options
to pass to uic.
variable may be
populated to pre-set the options for all following targets.
source file property may be set on the
&basename&.ui file to set particular options for the file.
overrides options from the
target property.
A target may populate the
property with options that should be used when invoking uic.
This must be
consistent with the
target property content of the
depender target.
variable may
be used to track the origin target of such
This means that a library which
provides an alternative translation system for Qt may specify options which
should be used when running uic:
add_library(KI18n klocalizedstring.cpp)
target_link_libraries(KI18n Qt5::Core)
# KI18n uses the tr2i18n() function instead of tr().
That function is
# declared in the klocalizedstring.h header.
set(autouic_options
-tr tr2i18n
-include klocalizedstring.h
set_property(TARGET KI18n APPEND PROPERTY
INTERFACE_AUTOUIC_OPTIONS ${autouic_options}
A consuming project linking to the target exported from upstream automatically
uses appropriate options when uic is run by , as a
result of linking with the
set(CMAKE_AUTOUIC ON)
# Uses a libwidget.ui file:
add_library(LibWidget libwidget.cpp)
target_link_libraries(LibWidget
KF5::KI18n
Qt5::Widgets
target property controls whether
creates rules to execute rcc at the appropriate time on source files
which have the suffix .qrc.
add_executable(myexe main.cpp resource_file.qrc)
target property may be pre-set for all following targets
by setting the
target property may be populated to set options
to pass to rcc.
variable may be
populated to pre-set the options for all following targets.
source file property may be set on the
&name&.qrc file to set particular options for the file.
overrides options from the
target property.
The Qt 4 and 5
targets for the QtGui libraries specify
that the qtmain.lib static library shipped with Qt will be linked by all
dependent executables which have the
To disable this behavior, enable the Qt5_NO_LINK_QTMAIN target property for
Qt 5 based targets or QT4_NO_LINK_QTMAIN target property for Qt 4 based
add_executable(myexe WIN32 main.cpp)
target_link_libraries(myexe Qt4::QtGui)
add_executable(myexe_no_qtmain WIN32 main_no_qtmain.cpp)
set_property(TARGET main_no_qtmain PROPERTY QT4_NO_LINK_QTMAIN ON)
target_link_libraries(main_no_qtmain Qt4::QtGui)他的最新文章
他的热门文章
您举报文章:
举报原因:
原文地址:
原因补充:
(最多只允许输入30个字)VS2010环境下安装CGAL步骤_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
VS2010环境下安装CGAL步骤
阅读已结束,下载本文需要
想免费下载本文?
定制HR最喜欢的简历
下载文档到电脑,方便使用
还剩2页未读,继续阅读
定制HR最喜欢的简历
你可能喜欢

我要回帖

更多关于 我的世界龙息有什么用 的文章

 

随机推荐