<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Yes, this program runs well when compile with qmake.<br><font color="#888888"><br>Linge</font><div><div></div><div class="Wj3C7c"><br><br><div class="gmail_quote">On Fri, Sep 26, 2008 at 5:18 PM, Michael Jackson <span dir="ltr"><<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Look in the GLWidget source file and see if there is actually a zRotationChanged(int) method available.<br>
<br>
Mike<div><div></div><div><br>
<br>
On Sep 26, 2008, at 5:15 PM, Linge Bai wrote:<br>
<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
<br>
I set CMAKE_OSX_SYSROOT to /Developer/SDKs/MacOSX10.5.sdk and generated the makefile. The QTOPENGL and QGLWIDGET are still not found. But they do exist.<br>
<br>
I get these errors:<br>
make<br>
<br>
[ 33%] Building CXX object CMakeFiles/exe.dir/main.o<br>
[ 66%] Building CXX object CMakeFiles/exe.dir/glwidget.o<br>
[100%] Building CXX object CMakeFiles/exe.dir/window.o<br>
Linking CXX executable exe<br>
Undefined symbols:<br>
"GLWidget::zRotationChanged(int)", referenced from:<br>
GLWidget::setZRotation(int) in glwidget.o<br>
"GLWidget::xRotationChanged(int)", referenced from:<br>
GLWidget::setXRotation(int) in glwidget.o<br>
"GLWidget::yRotationChanged(int)", referenced from:<br>
GLWidget::setYRotation(int) in glwidget.o<br>
"vtable for Window", referenced from:<br>
__ZTV6Window$non_lazy_ptr in main.o<br>
__ZTV6Window$non_lazy_ptr in window.o<br>
"Window::staticMetaObject", referenced from:<br>
__ZN6Window16staticMetaObjectE$non_lazy_ptr in window.o<br>
"vtable for GLWidget", referenced from:<br>
__ZTV8GLWidget$non_lazy_ptr in glwidget.o<br>
ld: symbol(s) not found<br>
collect2: ld returned 1 exit status<br>
make[2]: *** [exe] Error 1<br>
make[1]: *** [CMakeFiles/exe.dir/all] Error 2<br>
make: *** [all] Error 2<br>
<br>
<br>
On Fri, Sep 26, 2008 at 4:59 PM, Michael Jackson <<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>> wrote:<br>
Set the CMAKE_OSX_SYSROOT to /Developer/SDKs/MacOSX10.5.sdk<br>
<br>
and try again. Also, you do actually have the MacOSX10.5.sdk available correct?<br>
<br>
The link line contains all the proper OpenGL (both apple and Qt) frameworks. You just need to get past the SDK setting first.<br>
<br>
Mike<br>
<br>
<br>
On Sep 26, 2008, at 4:52 PM, Linge Bai wrote:<br>
<br>
Attached is a screen shot of running ccmake. It's MacOSX10.4u.sdk. And it showed that QTOPENGL and QGLWIDGET are not found.<br>
<br>
make VERBOSE=1<br>
/opt/local/bin/cmake -H/Users/lb353/Desktop/myQt/hellogl -B/Users/lb353/Desktop/myQt/hellogl --check-build-system CMakeFiles/Makefile.cmake 0<br>
/opt/local/bin/cmake -E cmake_progress_start /Users/lb353/Desktop/myQt/hellogl/CMakeFiles /Users/lb353/Desktop/myQt/hellogl/CMakeFiles/progress.make<br>
make -f CMakeFiles/Makefile2 all<br>
make -f CMakeFiles/exe.dir/build.make CMakeFiles/exe.dir/depend<br>
cd /Users/lb353/Desktop/myQt/hellogl && /opt/local/bin/cmake -E cmake_depends "Unix Makefiles" /Users/lb353/Desktop/myQt/hellogl /Users/lb353/Desktop/myQt/hellogl /Users/lb353/Desktop/myQt/hellogl /Users/lb353/Desktop/myQt/hellogl /Users/lb353/Desktop/myQt/hellogl/CMakeFiles/exe.dir/DependInfo.cmake --color=<br>
make -f CMakeFiles/exe.dir/build.make CMakeFiles/exe.dir/build<br>
/opt/local/bin/cmake -E cmake_progress_report /Users/lb353/Desktop/myQt/hellogl/CMakeFiles 1<br>
[ 33%] Building CXX object CMakeFiles/exe.dir/main.o<br>
/usr/bin/c++ -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -isysroot /Developer/SDKs/MacOSX10.4u.sdk -I/usr/local/Trolltech/Qt-4.4.2/include -I/usr/local/Trolltech/Qt-4.4.2/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.4.2/include/QtGui -I/usr/local/Trolltech/Qt-4.4.2/include/QtCore -F/usr/local/Trolltech/Qt-4.4.2/lib -L/usr/local/Trolltech/Qt-4.4.2/lib -F/usr/local/Trolltech/Qt-4.4.2/lib -o CMakeFiles/exe.dir/main.o -c /Users/lb353/Desktop/myQt/hellogl/main.cpp<br>
/opt/local/bin/cmake -E cmake_progress_report /Users/lb353/Desktop/myQt/hellogl/CMakeFiles 2<br>
[ 66%] Building CXX object CMakeFiles/exe.dir/glwidget.o<br>
/usr/bin/c++ -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -isysroot /Developer/SDKs/MacOSX10.4u.sdk -I/usr/local/Trolltech/Qt-4.4.2/include -I/usr/local/Trolltech/Qt-4.4.2/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.4.2/include/QtGui -I/usr/local/Trolltech/Qt-4.4.2/include/QtCore -F/usr/local/Trolltech/Qt-4.4.2/lib -L/usr/local/Trolltech/Qt-4.4.2/lib -F/usr/local/Trolltech/Qt-4.4.2/lib -o CMakeFiles/exe.dir/glwidget.o -c /Users/lb353/Desktop/myQt/hellogl/glwidget.cpp<br>
/opt/local/bin/cmake -E cmake_progress_report /Users/lb353/Desktop/myQt/hellogl/CMakeFiles 3<br>
[100%] Building CXX object CMakeFiles/exe.dir/window.o<br>
/usr/bin/c++ -DQT_DLL -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_CORE_LIB -isysroot /Developer/SDKs/MacOSX10.4u.sdk -I/usr/local/Trolltech/Qt-4.4.2/include -I/usr/local/Trolltech/Qt-4.4.2/include/QtOpenGL -I/usr/local/Trolltech/Qt-4.4.2/include/QtGui -I/usr/local/Trolltech/Qt-4.4.2/include/QtCore -F/usr/local/Trolltech/Qt-4.4.2/lib -L/usr/local/Trolltech/Qt-4.4.2/lib -F/usr/local/Trolltech/Qt-4.4.2/lib -o CMakeFiles/exe.dir/window.o -c /Users/lb353/Desktop/myQt/hellogl/window.cpp<br>
Linking CXX executable exe<br>
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/exe.dir/link.txt --verbose=1<br>
/usr/bin/c++ -isysroot /Developer/SDKs/MacOSX10.4u.sdk -Wl,-search_paths_first -headerpad_max_install_names -fPIC CMakeFiles/exe.dir/main.o CMakeFiles/exe.dir/glwidget.o CMakeFiles/exe.dir/window.o -o exe -F/usr/local/Trolltech/Qt-4.4.2/lib -framework QtOpenGL -framework OpenGL -framework AGL -framework QtGui -framework Carbon -framework AppKit -framework QtCore /usr/lib/libz.dylib -framework ApplicationServices<br>
ld: library not found for -lcrt1.10.5.o<br>
collect2: ld returned 1 exit status<br>
make[2]: *** [exe] Error 1<br>
make[1]: *** [CMakeFiles/exe.dir/all] Error 2<br>
make: *** [all] Error 2<br>
<br>
Have I linked to QTOPENGL or not?<br>
<br>
Linge<br>
<br>
On Fri, Sep 26, 2008 at 4:43 PM, Michael Jackson <<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>> wrote:<br>
run ccmake instead of cmake on your project. Look down the left hand side of cmake variables. It should be listed.<br>
<br>
By default it should be 10.5.sdk so I am not sure what is really going wrong.<br>
<br>
also, do the following:<br>
<br>
make clean<br>
make VERBOSE=1<br>
<br>
in your build directory and lets examine the compile and link lines..<br>
<br>
<br>
Mike<br>
<br>
<br>
<br>
On Sep 26, 2008, at 4:40 PM, Linge Bai wrote:<br>
<br>
my mac os x is 10.5.4, it's PPC. Xcode is version 3.1. I'm sorry that I have no idea how to check CMAKE_OSX_SYSROOT.<br>
<br>
Linge<br>
<br>
On Fri, Sep 26, 2008 at 4:33 PM, Michael Jackson <<a href="mailto:mike.jackson@bluequartz.net" target="_blank">mike.jackson@bluequartz.net</a>> wrote:<br>
What is your OS X version, (PPC or Intel), Xcode toolset version, and what are you setting the CMAKE_OSX_SYSROOT value to? It should be /Developer/SDKs/MacOSX10.5.sdk<br>
<br>
<br>
Mike<br>
<br>
<br>
On Sep 26, 2008, at 4:26 PM, Linge Bai wrote:<br>
<br>
so if I use cmake 2.6.1, with the following CMakeList.txt file:<br>
<br>
PROJECT ( COMBINED )<br>
FIND_PACKAGE (Qt4 REQUIRED)<br>
SET(QT_USE_QTOPENGL TRUE)<br>
INCLUDE( ${QT_USE_FILE} )<br>
ADD_EXECUTABLE(exe main.cpp glwidget.cpp window.cpp)<br>
TARGET_LINK_LIBRARIES(exe ${QT_LIBRARIES})<br>
<br>
I am able to link to Qt4's OpenGL, but I have a link error:<br>
<br>
make<br>
Scanning dependencies of target exe<br>
Linking CXX executable exe<br>
ld: library not found for -lcrt1.10.5.o<br>
collect2: ld returned 1 exit status<br>
make[2]: *** [exe] Error 1<br>
make[1]: *** [CMakeFiles/exe.dir/all] Error 2<br>
make: *** [all] Error 2<br>
<br>
I have no idea what this error means.<br>
<br>
Linge<br>
<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
<Picture 2.png><br>
<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
<br>
<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote>
<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</div></div></blockquote></div><br></div></div></div>
</div><br></div>