我正在尝试编译 Qt-Library osgQt,因为它没有在预编译包中提供(至少不支持 Windows 7(x64) 和 MSVS 11 - x64)。因此,我遵循这些说明:
Note: This library is part of OSG sources, but it is not part of prebuilt binaries. It is necessary to download whole OSG project to build osgQt library.
I. Download osg 3.0.1 sources.
II. Generate Visual Studio solution with CMake.
To do this you can run prepared batch file. - It creates VS solution without any osg dependencies. (hopefully sufficient) - It is necessary to set variables in the file header. - After running it, there should be build folder with OpenSceneGraph.sln file and src/osgQt directory.
我不能使用这个批处理文件,因为它不可用和其他软件条件(MSVS 2008,Qt 4.7.4),因此我必须自己用 CMake 构建它。
III. Open OpenSceneGraph.sln in Visual studio
IV. Choose debug win32 (or other configuration you want)
V. Select osgQt project
VI. From menu select Build, Build osgQt
Result: osgQt lib and dll files ...copy them beside prebuilt osg libraries.
但是我在第二步遇到了麻烦:
使用 CMake 2.8.11.2 时,我收到以下错误:
CMake Error at D:/Programme/QT/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:14 (message):
Failed to find "glu32" in "".
Call Stack (most recent call first):
D:/Programme/QT/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake:48 (_qt5gui_find_extra_libs)
D:/Programme/QT/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Gui/Qt5GuiConfig.cmake:127 (include)
D:/Programme/QT/5.1.0/msvc2012_64_opengl/lib/cmake/Qt5Widgets/Qt5WidgetsConfig.cmake:83 (find_package)
CMakeLists.txt:570 (FIND_PACKAGE)
因为很多其他人在我按照这个说明之前遇到了这个问题 ( http://qt-project.org/forums/viewthread/30006/ ):
So it worked for me(at least the CMake coniguration, didnt try to actually use it in compilation yet). Steps to reproduce:
- I used precompiled version of Qt 5.1(the one with OpenGL x64 for VS2012). To use it should be fine for you, as Qt 5.1 should support OpenGL3.2+ profiles out of the box, i dont think you need to use Glew anymore, just look at http://qt-project.org/doc/qt->5.1/qtgui/qabstractopenglfunctions.html hierarchy
- Installed Win SDK 8.0. But i think 7.0 could be fine.
- added set (CMAKE_PREFIX_PATH “C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64”) line to my cmake file. That’s where glu32.lib and similar files are located.
- Run cmake-gui configure&generate, using VS 11 win64 as generator.
它尝试了两者(不是在同一个构建过程中):
set(CMAKE_PREFIX_PATH “D:\Programme\Microsoft SDKs\Windows\v7.0\Lib\x64”)
set(CMAKE_PREFIX_PATH “C:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64”)
我收到上面发布的错误和以下警告:
CMake Warning (dev) at CMakeLists.txt:4 (set):
Syntax error in cmake code at
D:/OpenSceneGraph-3.2.0/OpenSceneGraph/CMakeLists.txt:4
when parsing string
"C:\Program
Invalid escape sequence \P
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:4 (set):
Syntax error in cmake code at
D:/OpenSceneGraph-3.2.0/OpenSceneGraph/CMakeLists.txt:4
when parsing string
\Windows
Invalid escape sequence \W
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning (dev) at CMakeLists.txt:4 (set):
Syntax error in cmake code at
D:/OpenSceneGraph-3.2.0/OpenSceneGraph/CMakeLists.txt:4
when parsing string
Kits\8.0\Lib\win8\um\x64”
Invalid escape sequence \8
Policy CMP0010 is not set: Bad variable reference syntax is an error. Run
"cmake --help-policy CMP0010" for policy details. Use the cmake_policy
command to set the policy and suppress this warning.
This warning is for project developers. Use -Wno-dev to suppress it.
我认为这些警告不像大多数其他警告那样无害,并且表明 CMake 根本无法找到正确的目录。
有没有人知道如何解决这个问题,或者如果不是的话,有没有在 Windows7(x64) 上使用 osg 3.2.0 和 MSVS2012 为 Qt 5.1 预编译的 osgQt 版本?
编辑 1:
Qt5GuiConfigExtras.cmake 代码
macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
set(Qt5Gui_${Name}_LIBRARIES)
set(Qt5Gui_${Name}_INCLUDE_DIRS ${IncDirs})
foreach(_lib ${Libs})
string(REGEX REPLACE [^_A-Za-z0-9] _ _cmake_lib_name ${_lib})
if (NOT TARGET Qt5::Gui_${_cmake_lib_name})
find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY ${_lib}
)
if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
if ("${ARGN}" STREQUAL "OPTIONAL")
break()
else()
message(FATAL_ERROR "Failed to find \"${_lib}\" in \"${LibDir}\".")
endif()
endif()
add_library(Qt5::Gui_${_cmake_lib_name} SHARED IMPORTED)
set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${IncDirs})
set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
_qt5_Gui_check_file_exists("${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_RELEASE "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_RELEASE "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
unset(Qt5Gui_${_cmake_lib_name}_LIBRARY CACHE)
find_library(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG ${_lib}d
PATHS "${LibDir}" NO_DEFAULT_PATH)
if (Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG)
set_property(TARGET Qt5::Gui_${_cmake_lib_name} APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
_qt5_Gui_check_file_exists("${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}")
set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_LOCATION_DEBUG "${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}")
set_property(TARGET Qt5::Gui_${_cmake_lib_name} PROPERTY IMPORTED_IMPLIB_DEBUG "${Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG}")
endif()
unset(Qt5Gui_${_cmake_lib_name}_LIBRARY_DEBUG CACHE)
endif()
list(APPEND Qt5Gui_${Name}_LIBRARIES Qt5::Gui_${_cmake_lib_name})
endforeach()
if (NOT CMAKE_CROSSCOMPILING)
foreach(_dir ${IncDirs})
_qt5_Gui_check_file_exists(${_dir})
endforeach()
endif()
endmacro()
_qt5gui_find_extra_libs(OPENGL "GlU32;opengl32;gdi32;user32" "" "")
set(Qt5Gui_OPENGL_IMPLEMENTATION GL)
get_target_property(_configs Qt5::Gui IMPORTED_CONFIGURATIONS)
foreach(_config ${_configs})
set_property(TARGET Qt5::Gui APPEND PROPERTY
IMPORTED_LINK_DEPENDENT_LIBRARIES_${_config}
${Qt5Gui_EGL_LIBRARIES} ${Qt5Gui_OPENGL_LIBRARIES}
)
endforeach()
unset(_configs)
提前致谢。
最佳答案
在CMake中,\是转义字符。要将实际的 \ 添加到字符串,您需要将其转义,即使其成为 \\。
所以你需要做:
set(CMAKE_PREFIX_PATH "D:\\Programme\\Microsoft SDKs\\Windows\\v7.0\\Lib\\x64")
或者,您可以将路径分隔符更改为 /,即使对于 Windows:
set(CMAKE_PREFIX_PATH "D:/Programme/Microsoft SDKs/Windows/v7.0/Lib/x64")
关于windows - 使用 CMake 2.8.11.2 编译 osgQt (Windows7 MSVS11 Qt 5.1 OSG 3.2.0),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18665667/
我需要在客户计算机上运行Ruby应用程序。通常需要几天才能完成(复制大备份文件)。问题是如果启用sleep,它会中断应用程序。否则,计算机将持续运行数周,直到我下次访问为止。有什么方法可以防止执行期间休眠并让Windows在执行后休眠吗?欢迎任何疯狂的想法;-) 最佳答案 Here建议使用SetThreadExecutionStateWinAPI函数,使应用程序能够通知系统它正在使用中,从而防止系统在应用程序运行时进入休眠状态或关闭显示。像这样的东西:require'Win32API'ES_AWAYMODE_REQUIRED=0x0
这似乎非常适得其反,因为太多的gem会在window上破裂。我一直在处理很多mysql和ruby-mysqlgem问题(gem本身发生段错误,一个名为UnixSocket的类显然在Windows机器上不能正常工作,等等)。我只是在浪费时间吗?我应该转向不同的脚本语言吗? 最佳答案 我在Windows上使用Ruby的经验很少,但是当我开始使用Ruby时,我是在Windows上,我的总体印象是它不是Windows原生系统。因此,在主要使用Windows多年之后,开始使用Ruby促使我切换回原来的系统Unix,这次是Linux。Rub
之前在培训新生的时候,windows环境下配置opencv环境一直教的都是网上主流的vsstudio配置属性表,但是这个似乎对新生来说难度略高(虽然个人觉得完全是他们自己的问题),加之暑假之后对cmake实在是爱不释手,且这样配置确实十分简单(其实都不需要配置),故斗胆妄言vscode下配置CV之法。其实极为简单,图比较多所以很长。如果你看此文还配不好,你应该思考一下是不是自己的问题。闲话少说,直接开始。0.CMkae简介有的人到大二了都不知道cmake是什么,我不说是谁。CMake是一个开源免费并且跨平台的构建工具,可以用简单的语句来描述所有平台的编译过程。它能够根据当前所在平台输出对应的m
运行bundleinstall后出现此错误:Gem::Package::FormatError:nometadatafoundin/Users/jeanosorio/.rvm/gems/ruby-1.9.3-p286/cache/libv8-3.11.8.13-x86_64-darwin-12.gemAnerroroccurredwhileinstallinglibv8(3.11.8.13),andBundlercannotcontinue.Makesurethat`geminstalllibv8-v'3.11.8.13'`succeedsbeforebundling.我试试gemin
深度学习部署:Windows安装pycocotools报错解决方法1.pycocotools库的简介2.pycocotools安装的坑3.解决办法更多Ai资讯:公主号AiCharm本系列是作者在跑一些深度学习实例时,遇到的各种各样的问题及解决办法,希望能够帮助到大家。ERROR:Commanderroredoutwithexitstatus1:'D:\Anaconda3\python.exe'-u-c'importsys,setuptools,tokenize;sys.argv[0]='"'"'C:\\Users\\46653\\AppData\\Local\\Temp\\pip-instal
我在目录“C:\DocumentsandSettings\test.exe”中有一个文件,但是当我用单引号编写命令时`C:\DocumentsandSettings\test.exe(我无法在此框中显示),用于在Ruby中执行命令,我无法这样做,我收到的错误是找不到文件或目录。我尝试用“//”和“\”替换“\”,但似乎没有任何效果。我也使用过系统、IO.popen和exec命令,但所有的努力都是徒劳的。exec命令还使程序退出,这是我不想发生的。提前致谢。 最佳答案 反引号环境就像双引号,所以反斜杠用于转义。此外,Ruby会将空格解
我正在运行Ubuntu11.10并像这样安装Ruby1.9:$sudoapt-getinstallruby1.9rubygems一切都运行良好,但ri似乎有空文档。ri告诉我文档是空的,我必须安装它们。我执行此操作是因为我读到它会有所帮助:$rdoc--all--ri现在,当我尝试打开任何文档时:$riArrayNothingknownaboutArray我搜索的其他所有内容都是一样的。 最佳答案 这个呢?apt-getinstallri1.8编辑或者试试这个:(非rvm)geminstallrdocrdoc-datardoc-da
我正在使用PostgreSQL9.1.3(x86_64-pc-linux-gnu上的PostgreSQL9.1.3,由gcc-4.6.real(Ubuntu/Linaro4.6.1-9ubuntu3)4.6.1,64位编译)和在ubuntu11.10上运行3.2.2或3.2.1。现在,我可以使用以下命令连接PostgreSQLsupostgres输入密码我可以看到postgres=#我将以下详细信息放在我的config/database.yml中并执行“railsdb”,它工作正常。开发:adapter:postgresqlencoding:utf8reconnect:falsedat
我在安装“redcarpet”gem时遇到以下错误。它在我friend的机器上安装没有问题。(我想安装它来运行yard)ruby版本:1.9.3命令输出:D:\Learning\Common_POM_FW\SampleProjects>yard[error]:Missing'redcarpet'gemforMarkdownformatting.Installitwith`geminstallredcarpet`D:\Learning\Common_POM_FW\SampleProjects>geminstallredcarpetTemporarilyenhancingPATHtoinc
我们正在开发一个需要推送通知的WP8应用程序。为了测试它,我们使用CURL命令行运行推送通知POST请求,确保它实际连接,使用客户端SSL证书进行身份验证并发送正确的数据。我们确实知道,当我们收到对设备的推送时,这项工作是有效的。这是我们一直用于测试目的的CURL命令:curl--certclient_cert.pem-v-H"Content-Type:text/xml"-H"X-WindowsPhone-Target:Toast"-H"X-NotificationClass:2"-XPOST-d"MytitleMysubtitle"https://db3.notify.live.ne