I'm stuck trying to get some openCV code working on my raspberry pi. I'm almost certain the problem is caused by the linker not knowing where the openCV library files are but I'm unfamiliar with both Linux and Netbeans so I'm in a bit of a pickle!
So, in short, my set-up is: attempting to build my code to my raspberryPi via remote C++ build host (G++). I am writing my code in Netbeans.
The builds worked fine up until the point I wrote two new classes using the "opencv2/core/core.hpp"
Now, when I attempt to build, I get the following error/s:
Copying project files to /home/pi/.netbeans/remote/192.168.1.99/desktop-g6lev01-Windows-x86_64 at pi#192.168.1.99
Building project files list...
Checking directory structure...
Checking previously uploaded files...
Checking links...
Uploading changed files:
Zipping 1 changed files...
Uploading zip to pi#192.168.1.99...
Unzipping changed files...
Checking exec permissions...
Uploading changed files finished successfully.
cd '/home/pi/.netbeans/remote/192.168.1.99/desktop-g6lev01-Windows-x86_64/E/Work/RasberryPi/Code/Raspberrypi_Test'
/usr/bin/make -f Makefile CONF=Release
"/usr/bin/make" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory '/home/pi/.netbeans/remote/192.168.1.99/desktop-g6lev01-Windows-x86_64/E/Work/RasberryPi/Code/Raspberrypi_Test'
"/usr/bin/make" -f nbproject/Makefile-Release.mk IOTestBuild
make[2]: Entering directory '/home/pi/.netbeans/remote/192.168.1.99/desktop-g6lev01-Windows-x86_64/E/Work/RasberryPi/Code/Raspberrypi_Test'
g++ -o IOTestBuild build/Release/GNU-Linux/CommsManager.o build/Release/GNU-Linux/ImageManager.o build/Release/GNU-Linux/Server.o build/Release/GNU-Linux/main.o -L../../opencv- -lwiringPi -opencv
build/Release/GNU-Linux/ImageManager.o: In function `ImageManager::getStoredImg()':
ImageManager.cpp:(.text+0xcc): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
build/Release/GNU-Linux/ImageManager.o: In function `ImageManager::ImageManager()':
ImageManager.cpp:(.text+0x134): undefined reference to `cv::VideoCapture::VideoCapture()'
ImageManager.cpp:(.text+0x1c0): undefined reference to `cv::Mat::deallocate()'
ImageManager.cpp:(.text+0x288): undefined reference to `cv::Mat::deallocate()'
ImageManager.cpp:(.text+0x2b8): undefined reference to `cv::fastFree(void*)'
ImageManager.cpp:(.text+0x2c0): undefined reference to `cv::VideoCapture::VideoCapture()'
ImageManager.cpp:(.text+0x32c): undefined reference to `cv::VideoCapture::~VideoCapture()'
ImageManager.cpp:(.text+0x344): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
ImageManager.cpp:(.text+0x350): undefined reference to `cv::Ptr<CvCapture>::delete_obj()'
ImageManager.cpp:(.text+0x358): undefined reference to `cv::fastFree(void*)'
ImageManager.cpp:(.text+0x36c): undefined reference to `cv::VideoCapture::~VideoCapture()'
ImageManager.cpp:(.text+0x388): undefined reference to `cv::VideoCapture::~VideoCapture()'
build/Release/GNU-Linux/ImageManager.o: In function `ImageManager::~ImageManager()':
ImageManager.cpp:(.text+0x3a0): undefined reference to `cv::VideoCapture::~VideoCapture()'
ImageManager.cpp:(.text+0x404): undefined reference to `cv::fastFree(void*)'
ImageManager.cpp:(.text+0x414): undefined reference to `cv::Mat::deallocate()'
build/Release/GNU-Linux/ImageManager.o: In function `ImageManager::getRawImg(cv::Mat*)':
ImageManager.cpp:(.text+0x43c): undefined reference to `cv::VideoCapture::open(int)'
ImageManager.cpp:(.text+0x450): undefined reference to `cv::VideoCapture::operator>>(cv::Mat&)'
ImageManager.cpp:(.text+0x494): undefined reference to `cv::VideoCapture::release()'
build/Release/GNU-Linux/ImageManager.o: In function `ImageManager::updateFrame()':
ImageManager.cpp:(.text+0x5f0): undefined reference to `cv::Mat::copySize(cv::Mat const&)'
ImageManager.cpp:(.text+0x67c): undefined reference to `cv::fastFree(void*)'
ImageManager.cpp:(.text+0x6b8): undefined reference to `cv::Mat::deallocate()'
ImageManager.cpp:(.text+0x6c4): undefined reference to `cv::Mat::deallocate()'
build/Release/GNU-Linux/ImageManager.o: In function `cv::Mat::~Mat()':
ImageManager.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x68): undefined reference to `cv::fastFree(void*)'
ImageManager.cpp:(.text._ZN2cv3MatD2Ev[_ZN2cv3MatD5Ev]+0x74): undefined reference to `cv::Mat::deallocate()'
collect2: error: ld returned 1 exit status
nbproject/Makefile-Release.mk:65: recipe for target 'IOTestBuild' failed
make[2]: *** [IOTestBuild] Error 1
make[2]: Leaving directory '/home/pi/.netbeans/remote/192.168.1.99/desktop-g6lev01-Windows-x86_64/E/Work/RasberryPi/Code/Raspberrypi_Test'
nbproject/Makefile-Release.mk:62: recipe for target '.build-conf' failed
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory '/home/pi/.netbeans/remote/192.168.1.99/desktop-g6lev01-Windows-x86_64/E/Work/RasberryPi/Code/Raspberrypi_Test'
nbproject/Makefile-impl.mk:39: recipe for target '.build-impl' failed
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 701ms)
Any ideas?
I'm sure I just need to point the linker to the appropriate libs but I've no idea how to specify that relative path when using a build host.
Regards
Guy
I have a project I want to build with CMake and compile with MinGW. The project uses Zlib. When I build with CMake I get no errors but then when I run MinGW Make it gives the following output:
C:\Projects\MultiMCBuild>C:\Qt\Tools\mingw492_32\bin\mingw32-make.exe
.
.
.
[ 50%] Linking CXX shared library ..\libMultiMC_logic.dll
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x1f6c): undefined reference to 'z_inflateEnd'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x29e2): undefined reference to 'z_inflateInit2_'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x2a6d): undefined reference to 'z_get_crc_table'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x2ca7): undefined reference to 'z_inflateEnd'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x2f52): undefined reference to 'z_inflateInit2_'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x2f77): undefined reference to 'z_inflateEnd'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x3239): undefined reference to 'z_inflateInit2_'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x3317): undefined reference to 'z_inflateEnd'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x3626): undefined reference to 'z_crc32'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x371f): undefined reference to 'z_inflate'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x376a): undefined reference to 'z_crc32'
C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj):unzip.c:(.text+0x3a57): undefined reference to 'z_inflateEnd'
C:/Qt/Tools/mingw492_32/bin/../lib/gcc/i686-w64- mingw32/4.9.2/../../../../i686-w64-mingw32/bin/ld.exe: C:/Projects/MultiMCBuild/External/Install/QuaZIP/lib/libquazip.a(unzip.c.obj): bad reloc address 0x20 in section `.eh_frame'
collect2.exe: error: ld returned 1 exit status
logic\CMakeFiles\MultiMC_logic.dir\build.make:3186: recipe for target 'libMultiMC_logic.dll' failed
mingw32-make[2]: * * * [libMultiMC_logic.dll] Error 1
CMakeFiles\Makefile2:1806: recipe for target 'logic/CMakeFiles/MultiMC_logic.dir/all' failed
mingw32-make[1]: * * * [logic/CMakeFiles/MultiMC_logic.dir/all] Error 2
makefile:159: recipe for target 'all' failed
mingw32-make: * * * [all] Error 2
Anyone have a clue what I can do to fix this? I read that the code can't find the ZLib library, how do I link it?
EDIT here is my CMakeLists.txt. I got this from the Git project.
I just tried to generate a small example to reproduce your errors. I took my test file from the home page of zlib http://zlib.net/zpipe.c
My initial CMakeLists.txt was
cmake_minimum_required(VERSION 3.4)
project(zlib_test)
set(ZLIB_TEST_SOURCES zpipe.c)
add_executable(${PROJECT_NAME} ${ZLIB_TEST_SOURCES})
And I got the same errors
[ 50%] Building C object CMakeFiles/zlib_test.dir/zpipe.c.o
[100%] Linking C executable zlib_test
CMakeFiles/zlib_test.dir/zpipe.c.o: In function `def':
zpipe.c:(.text+0x65): undefined reference to `deflateInit_'
zpipe.c:(.text+0xcd): undefined reference to `deflateEnd'
zpipe.c:(.text+0x135): undefined reference to `deflate'
zpipe.c:(.text+0x1cf): undefined reference to `deflateEnd'
zpipe.c:(.text+0x25d): undefined reference to `deflateEnd'
CMakeFiles/zlib_test.dir/zpipe.c.o: In function `inf':
zpipe.c:(.text+0x2eb): undefined reference to `inflateInit_'
zpipe.c:(.text+0x353): undefined reference to `inflateEnd'
zpipe.c:(.text+0x3a4): undefined reference to `inflate'
zpipe.c:(.text+0x404): undefined reference to `inflateEnd'
zpipe.c:(.text+0x476): undefined reference to `inflateEnd'
zpipe.c:(.text+0x4a6): undefined reference to `inflateEnd'
collect2: error: ld returned 1 exit status
make[2]: *** [zlib_test] Error 1
make[1]: *** [CMakeFiles/zlib_test.dir/all] Error 2
make: *** [all] Error 2
After changing CMakeLists.txt to this form
cmake_minimum_required(VERSION 3.4)
project(zlib_test)
find_package(ZLIB REQUIRED)
if (ZLIB_FOUND)
include_directories(${ZLIB_INCLUDE_DIRS})
endif()
set(ZLIB_TEST_SOURCES zpipe.c)
add_executable(${PROJECT_NAME} ${ZLIB_TEST_SOURCES})
target_link_libraries(${PROJECT_NAME} ${ZLIB_LIBRARIES})
I could compile the program.
So your problem is: Where is ZLIB added in your CMakeLists.txt? At least, you need the line find_package(ZLIB REQUIRED).
I'm trying to build the SOCI library to run with PostgreSQL. I followed these steps:
Install PostgreSQL in Ubutu 15.10
Download SOCI source code
Extract SOCI code
I then run the following commands:
mkdir build
cd build
cmake -G "Unix Makefiles" -DWITH_BOOST=OFF -DWITH_POSTGRESQL=ON -DPOSTGRESQL_INCLUDE_DIR=/usr/local/pgsql/include -DPOSTGRESQL_LIBRARIES=/usr/local/pgsql/lib ../soci
At this point, CMake gave the following warnings:
WARNING: Target "soci_postgresql" requests linking to directory "/usr/local/pgsql/lib". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "soci_postgresql_static" requests linking to directory "/usr/local/pgsql/lib". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "soci_postgresql_test" requests linking to directory "/usr/local/pgsql/lib". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "soci_postgresql_test" requests linking to directory "/usr/local/pgsql/lib". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "soci_postgresql_test_static" requests linking to directory "/usr/local/pgsql/lib". Targets may link only to libraries. CMake is dropping the item.
WARNING: Target "soci_postgresql_test_static" requests linking to directory "/usr/local/pgsql/lib". Targets may link only to libraries. CMake is dropping the item.
Persisting with the build, I then ran make, which fails with the following error:
[ 98%] Building CXX object tests/postgresql/CMakeFiles/soci_postgresql_test.dir/test-postgresql.cpp.o
Linking CXX executable ../../bin/soci_postgresql_test
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQresultStatus'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQgetvalue'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQclear'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQserverVersion'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQresultErrorMessage'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQexec'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `lo_lseek'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQfsize'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQgetisnull'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQerrorMessage'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `lo_open'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQexecPrepared'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQftype'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `lo_close'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQexecParams'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQfname'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQconnectdb'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQstatus'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQntuples'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQresultErrorField'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQfformat'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `lo_read'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQfinish'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQprepare'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `lo_write'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQcmdTuples'
../../lib/libsoci_postgresql.so.4.0.0: undefined reference to `PQnfields'
collect2: error: ld returned 1 exit status
tests/postgresql/CMakeFiles/soci_postgresql_test.dir/build.make:89: recipe for target 'bin/soci_postgresql_test' failed
make[2]: *** [bin/soci_postgresql_test] Error 1
CMakeFiles/Makefile2:609: recipe for target 'tests/postgresql/CMakeFiles/soci_postgresql_test.dir/all' failed
make[1]: *** [tests/postgresql/CMakeFiles/soci_postgresql_test.dir/all] Error 2
Makefile:126: recipe for target 'all' failed
make: *** [all] Error 2
Any idea what the cause of the CMake warnings and build error might be?
Try to call cmake with slightly different options
cmake -G "Unix Makefiles" -DWITH_BOOST=OFF -DWITH_POSTGRESQL=ON \
-DPOSTGRESQL_INCLUDE_DIR:STRING="/usr/local/pgsql/include" \
-DPOSTGRESQL_LIBRARIES:STRING="/usr/local/pgsql/lib" ../soci
I got the right answer from the github, here is link.
The following reply is largely taken from there, but repeated here for convenience (with cleanup and clarification):
-DPOSTGRESQL_LIBRARIES=/usr/local/psql/lib should point to the libraries, not directories.
This is what the following warning already highlights:
WARNING: Target "soci_postgresql" requests linking to directory
"/usr/local/postgresql/lib"
Try the following command instead (you may need to delete your CMakeCache.txt from the build directory first as well):
cmake -G "Unix Makefiles" -DWITH_BOOST=OFF -DWITH_POSTGRESQL=ON ../soci
On Linux systems where "postgresql-devel.x86_64 : PostgreSQL development header files and libraries" is installed, this command should be enough.
I've just started working my way through the OpenGL SuperBible 6th ed and am having a very hard time getting any of the samples to compile on Ubuntu 14.04. I installed the dev packages dependencies:
sudo apt-get install xorg-dev libglu1-mesa-dev libglfw-dev nvidia-331-dev cmake
I grabbed gl3w from skaslev's github, ran the python script and then sudo copied gl3w.h and glcorearb.h to /usr/include/GL/
I grabbed the samples from the SuperBible github and the media files, unzipped the media files into bin/media. Then I went back to the root of the sb6 files (the folder is called sb6code_2013_11_10 in my case) where and ran:
cmake .
make
cmake works fine, but make throws:
[ 6%] Built target sb6
Linking CXX executable bin/alienrain
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::run(sb6::application*)':
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x21): undefined reference to `glfwInit'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x7a): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x90): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x9f): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xae): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xc4): undefined reference to `glfwOpenWindowHint'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o:alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xee): more undefined references to `glfwOpenWindowHint' follow
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::run(sb6::application*)':
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x12c): undefined reference to `glfwGetDesktopMode'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x18e): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1a8): undefined reference to `glfwSwapInterval'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1f2): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x22e): undefined reference to `glfwSetWindowTitle'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x238): undefined reference to `glfwSetWindowSizeCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x242): undefined reference to `glfwSetKeyCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x24c): undefined reference to `glfwSetMouseButtonCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x256): undefined reference to `glfwSetMousePosCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x260): undefined reference to `glfwSetMouseWheelCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x277): undefined reference to `glfwEnable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x27e): undefined reference to `glfwDisable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x28f): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x373): undefined reference to `glfwGetTime'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x393): undefined reference to `glfwSwapBuffers'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x39d): undefined reference to `glfwGetKey'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3bd): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3f5): undefined reference to `glfwTerminate'
lib/libsb6.a(gl3w.c.o): In function `open_libgl':
gl3w.c:(.text+0xf): undefined reference to `dlopen'
lib/libsb6.a(gl3w.c.o): In function `close_libgl':
gl3w.c:(.text+0x2b): undefined reference to `dlclose'
lib/libsb6.a(gl3w.c.o): In function `get_proc':
gl3w.c:(.text+0x45): undefined reference to `glXGetProcAddress'
gl3w.c:(.text+0x66): undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/alienrain] Error 1
make[1]: *** [CMakeFiles/alienrain.dir/all] Error 2
make: *** [all] Error 2
So I decided to try and write my own small program based on Listing 2.1 in the book:
#include "sb6.h"
class my_application : public sb6::application
{
void init()
{
static const char title[] = "OpenGL SuperBible - Listing 2.1";
sb6::application::init();
memcpy(info.title, title, sizeof(title));
}
void render(double currentTime)
{
static const GLfloat red[] = {1.0f, 0.0f, 0.0f, 1.0f};
glClearBufferfv(GL_COLOR, 0, red);
}
};
DECLARE_MAIN(my_application)
Then I try to compile it:
g++ listing2.1.cpp -o listing2.1 -lGL -lGLU -lX11 -lglfw -D_LINUX
But that gives me a different set of errors:
In file included from sb6.h:65:0,
from listing2.1.cpp:1:
GL/gl3w.h:546:8: error: ‘PFNGLGETNMAPDVARBPROC’ does not name a type
extern PFNGLGETNMAPDVARBPROC gl3wGetnMapdvARB;
^
GL/gl3w.h:547:8: error: ‘PFNGLGETNMAPFVARBPROC’ does not name a type
extern PFNGLGETNMAPFVARBPROC gl3wGetnMapfvARB;
^
GL/gl3w.h:548:8: error: ‘PFNGLGETNMAPIVARBPROC’ does not name a type
extern PFNGLGETNMAPIVARBPROC gl3wGetnMapivARB;
^
GL/gl3w.h:549:8: error: ‘PFNGLGETNPIXELMAPFVARBPROC’ does not name a type
extern PFNGLGETNPIXELMAPFVARBPROC gl3wGetnPixelMapfvARB;
^
GL/gl3w.h:550:8: error: ‘PFNGLGETNPIXELMAPUIVARBPROC’ does not name a type
extern PFNGLGETNPIXELMAPUIVARBPROC gl3wGetnPixelMapuivARB;
^
GL/gl3w.h:551:8: error: ‘PFNGLGETNPIXELMAPUSVARBPROC’ does not name a type
extern PFNGLGETNPIXELMAPUSVARBPROC gl3wGetnPixelMapusvARB;
^
GL/gl3w.h:552:8: error: ‘PFNGLGETNPOLYGONSTIPPLEARBPROC’ does not name a type
extern PFNGLGETNPOLYGONSTIPPLEARBPROC gl3wGetnPolygonStippleARB;
^
GL/gl3w.h:553:8: error: ‘PFNGLGETNCOLORTABLEARBPROC’ does not name a type
extern PFNGLGETNCOLORTABLEARBPROC gl3wGetnColorTableARB;
^
GL/gl3w.h:554:8: error: ‘PFNGLGETNCONVOLUTIONFILTERARBPROC’ does not name a type
extern PFNGLGETNCONVOLUTIONFILTERARBPROC gl3wGetnConvolutionFilterARB;
^
GL/gl3w.h:555:8: error: ‘PFNGLGETNSEPARABLEFILTERARBPROC’ does not name a type
extern PFNGLGETNSEPARABLEFILTERARBPROC gl3wGetnSeparableFilterARB;
^
GL/gl3w.h:556:8: error: ‘PFNGLGETNHISTOGRAMARBPROC’ does not name a type
extern PFNGLGETNHISTOGRAMARBPROC gl3wGetnHistogramARB;
^
GL/gl3w.h:557:8: error: ‘PFNGLGETNMINMAXARBPROC’ does not name a type
extern PFNGLGETNMINMAXARBPROC gl3wGetnMinmaxARB;
^
I checked in sb6.h that gl3w.h is included before any of the OpenGL dependencies and that's true so I'll really not sure what to try next. Seems to be a linking problem but it's been a long time since I've been developing in C++ and I'm not sure what to try next.
Update
I followed didierc's suggestion and found that there was a sb6code_2013_11_10/include/GL folder with gl3w.h and glcorearb.h. I temporarily moved the GL folder out of sb6code_2013_11_10/include and then ran cmake and make again and then received the following error:
Scanning dependencies of target sb6
[ 1%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o
In file included from /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/include/sb6ext.h:29:0,
from /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/include/sb6.h:71,
from /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/src/sb6/sb6.cpp:26:
/usr/include/GL/glext.h:6184:181: error: conflicting declaration ‘typedef void (* PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)(GLuint, GLenum, GLsizeiptr, GLsizeiptr, GLenum, GLenum, const void*)’
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
^
In file included from /usr/include/GL/gl3w.h:4:0,
from /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/include/sb6.h:65,
from /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/src/sb6/sb6.cpp:26:
/usr/include/GL/glcorearb.h:4348:25: error: ‘PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC’ has a previous declaration as ‘typedef void (* PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)(GLuint, GLenum, GLenum, GLenum, GLsizeiptr, GLsizeiptr, const void*)’
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);
^
make[2]: *** [CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o] Error 1
make[1]: *** [CMakeFiles/sb6.dir/all] Error 2
make: *** [all] Error 2
Then I thought "Ok, then maybe I'll try using the gl3w.h and glcorearb.h that came with the sb6 package." So I restored the GL folder and then deleted the gl3w.h and glcorearb.h I previously generated with the python script and placed in /usr/include/GL. After a cmake and make I then get this error:
[ 1%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o
[ 2%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6ktx.cpp.o
[ 3%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6object.cpp.o
[ 5%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6shader.cpp.o
[ 6%] Building C object CMakeFiles/sb6.dir/src/sb6/gl3w.c.o
Linking CXX static library lib/libsb6.a
[ 6%] Built target sb6
Linking CXX executable bin/alienrain
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::run(sb6::application*)':
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x21): undefined reference to `glfwInit'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x7a): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x90): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x9f): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xae): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xc4): undefined reference to `glfwOpenWindowHint'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o:alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xee): more undefined references to `glfwOpenWindowHint' follow
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::run(sb6::application*)':
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x12c): undefined reference to `glfwGetDesktopMode'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x18e): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1a8): undefined reference to `glfwSwapInterval'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1f2): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x22e): undefined reference to `glfwSetWindowTitle'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x238): undefined reference to `glfwSetWindowSizeCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x242): undefined reference to `glfwSetKeyCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x24c): undefined reference to `glfwSetMouseButtonCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x256): undefined reference to `glfwSetMousePosCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x260): undefined reference to `glfwSetMouseWheelCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x277): undefined reference to `glfwEnable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x27e): undefined reference to `glfwDisable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x28f): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x373): undefined reference to `glfwGetTime'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x393): undefined reference to `glfwSwapBuffers'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x39d): undefined reference to `glfwGetKey'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3bd): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3f5): undefined reference to `glfwTerminate'
lib/libsb6.a(gl3w.c.o): In function `open_libgl':
gl3w.c:(.text+0xf): undefined reference to `dlopen'
lib/libsb6.a(gl3w.c.o): In function `close_libgl':
gl3w.c:(.text+0x2b): undefined reference to `dlclose'
lib/libsb6.a(gl3w.c.o): In function `get_proc':
gl3w.c:(.text+0x45): undefined reference to `glXGetProcAddress'
gl3w.c:(.text+0x66): undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/alienrain] Error 1
make[1]: *** [CMakeFiles/alienrain.dir/all] Error 2
make: *** [all] Error 2
So I'm not sure if that's progress but at least is exposes some of the snakes. Any advice on what to do next would be appreciated!
Update 2
Here's what I get from running make VERBOSE=1 with the GL folder intact (ie just as it was when I downloaded the sb6 files, but I also have glw3.h and glcorearb.h in /usr/include/GL):
/usr/bin/cmake -H/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 -B/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 --check-build-system CMakeFiles/Makefile.cmake 0
/usr/bin/cmake -E cmake_progress_start /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/CMakeFiles /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
make -f CMakeFiles/sb6.dir/build.make CMakeFiles/sb6.dir/depend
make[2]: Entering directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
cd /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/CMakeFiles/sb6.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
make -f CMakeFiles/sb6.dir/build.make CMakeFiles/sb6.dir/build
make[2]: Entering directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
/usr/bin/cmake -E cmake_progress_report /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/CMakeFiles 51
[ 1%] Building CXX object CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o
/usr/bin/c++ -D_LINUX -I/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/include -I/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/extern/glfw-2.7.6/include -o CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o -c /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/src/sb6/sb6.cpp
Linking CXX static library lib/libsb6.a
/usr/bin/cmake -P CMakeFiles/sb6.dir/cmake_clean_target.cmake
/usr/bin/cmake -E cmake_link_script CMakeFiles/sb6.dir/link.txt --verbose=1
/usr/bin/ar cr lib/libsb6.a CMakeFiles/sb6.dir/src/sb6/sb6.cpp.o CMakeFiles/sb6.dir/src/sb6/sb6ktx.cpp.o CMakeFiles/sb6.dir/src/sb6/sb6object.cpp.o CMakeFiles/sb6.dir/src/sb6/sb6shader.cpp.o CMakeFiles/sb6.dir/src/sb6/gl3w.c.o
/usr/bin/ranlib lib/libsb6.a
make[2]: Leaving directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
/usr/bin/cmake -E cmake_progress_report /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/CMakeFiles 51 52 53 54 55
[ 6%] Built target sb6
make -f CMakeFiles/alienrain.dir/build.make CMakeFiles/alienrain.dir/depend
make[2]: Entering directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
cd /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 && /usr/bin/cmake -E cmake_depends "Unix Makefiles" /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10 /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/CMakeFiles/alienrain.dir/DependInfo.cmake --color=
make[2]: Leaving directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
make -f CMakeFiles/alienrain.dir/build.make CMakeFiles/alienrain.dir/build
make[2]: Entering directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
/usr/bin/cmake -E cmake_progress_report /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/CMakeFiles 1
[ 7%] Building CXX object CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o
/usr/bin/c++ -D_LINUX -I/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/include -I/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/extern/glfw-2.7.6/include -o CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o -c /home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/src/alienrain/alienrain.cpp
Linking CXX executable bin/alienrain
/usr/bin/cmake -E cmake_link_script CMakeFiles/alienrain.dir/link.txt --verbose=1
/usr/bin/c++ -D_LINUX CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o -o bin/alienrain -L/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/lib -rdynamic lib/libsb6.a -Wl,-rpath,/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10/lib
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::run(sb6::application*)':
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x21): undefined reference to `glfwInit'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x7a): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x90): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x9f): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xae): undefined reference to `glfwOpenWindowHint'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xc4): undefined reference to `glfwOpenWindowHint'
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o:alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0xee): more undefined references to `glfwOpenWindowHint' follow
CMakeFiles/alienrain.dir/src/alienrain/alienrain.cpp.o: In function `sb6::application::run(sb6::application*)':
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x12c): undefined reference to `glfwGetDesktopMode'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x18e): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1a8): undefined reference to `glfwSwapInterval'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x1f2): undefined reference to `glfwOpenWindow'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x22e): undefined reference to `glfwSetWindowTitle'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x238): undefined reference to `glfwSetWindowSizeCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x242): undefined reference to `glfwSetKeyCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x24c): undefined reference to `glfwSetMouseButtonCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x256): undefined reference to `glfwSetMousePosCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x260): undefined reference to `glfwSetMouseWheelCallback'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x277): undefined reference to `glfwEnable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x27e): undefined reference to `glfwDisable'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x28f): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x373): undefined reference to `glfwGetTime'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x393): undefined reference to `glfwSwapBuffers'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x39d): undefined reference to `glfwGetKey'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3bd): undefined reference to `glfwGetWindowParam'
alienrain.cpp:(.text._ZN3sb611application3runEPS0_[_ZN3sb611application3runEPS0_]+0x3f5): undefined reference to `glfwTerminate'
lib/libsb6.a(gl3w.c.o): In function `open_libgl':
gl3w.c:(.text+0xf): undefined reference to `dlopen'
lib/libsb6.a(gl3w.c.o): In function `close_libgl':
gl3w.c:(.text+0x2b): undefined reference to `dlclose'
lib/libsb6.a(gl3w.c.o): In function `get_proc':
gl3w.c:(.text+0x45): undefined reference to `glXGetProcAddress'
gl3w.c:(.text+0x66): undefined reference to `dlsym'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/alienrain] Error 1
make[2]: Leaving directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
make[1]: *** [CMakeFiles/alienrain.dir/all] Error 2
make[1]: Leaving directory `/home/lewa/workspace-cpp/opengl-superbible/sb6code_2013_11_10'
make: *** [all] Error 2
Update 3
I was able to find a solution to the build problem with the sb6 sample code. It turns out there is a error in the CMakeLists.txt included with the sample code where on line 13 the 'elif (UNIX)' should be 'elseif (UNIX)'. See references:
trouble trying to build opengl superbible example code
https://github.com/openglsuperbible/sb6code/issues/12
https://github.com/openglsuperbible/sb6code/issues/8
With that fix the sb6 sample code now compiles for me. However, when I try to use sb6.h in my own sample code (listed in my_application above) I still get
In file included from sb6ext.h:29:0,
from sb6.h:71,
from listing2.1.cpp:1:
/usr/include/GL/glext.h:6184:181: error: conflicting declaration ‘typedef void (* PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)(GLuint, GLenum, GLsizeiptr, GLsizeiptr, GLenum, GLenum, const void*)’
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLsizeiptr offset, GLsizeiptr size, GLenum format, GLenum type, const void *data);
^
In file included from /usr/include/GL/gl3w.h:4:0,
from sb6.h:65,
from listing2.1.cpp:1:
/usr/include/GL/glcorearb.h:4348:25: error: ‘PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC’ has a previous declaration as ‘typedef void (* PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC)(GLuint, GLenum, GLenum, GLenum, GLsizeiptr, GLsizeiptr, const void*)’
typedef void (APIENTRYP PFNGLCLEARNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLenum internalformat, GLenum format, GLenum type, GLsizeiptr offset, GLsizeiptr size, const void *data);
^
I was able to solve the sb6 sample code compilation problems by fixing a bug in CMakeLists.txt where on line 13 the 'elif (UNIX)' should be 'elseif (UNIX)'. See the following for references:
trouble trying to build opengl superbible example code
https://github.com/openglsuperbible/sb6code/issues/12
https://github.com/openglsuperbible/sb6code/issues/8
I have not solve my compilation problems when I use sb6.h in my own code yet but will update this answer when I do
I have downloaded the pcl-1.7.1 release from github and have tried to build the code using
cd PCL-1.6.0 && mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
make
sudo make install
The cmake command runs successful and and writes this concerning boost
-- Boost version: 1.55.0
-- Found the following Boost libraries:
-- system
-- filesystem
-- thread
-- date_time
-- iostreams
The problem comes with the make command which after some time returns the following error:
Scanning dependencies of target pcl_convert_pcd_ascii_binary
[ 12%] Building CXX object io/tools/CMakeFiles/pcl_convert_pcd_ascii_binary.dir/convert_pcd_ascii_binary.cpp.o
Linking CXX executable ../../bin/pcl_convert_pcd_ascii_binary
../../lib/libpcl_common.so.1.7.1: error: undefined reference to 'boost::thread::join_noexcept()'
../../lib/libpcl_common.so.1.7.1: error: undefined reference to 'boost::thread::start_thread_noexcept()'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::permissions(boost::filesystem::path const&, boost::filesystem::perms, boost::system::error_code*)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::status(boost::filesystem::path const&, boost::system::error_code*)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::path::extension() const'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::dir_itr_close(void*&, void*&)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::path::stem() const'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::directory_iterator_construct(boost::filesystem::directory_iterator&, boost::filesystem::path const&, boost::system::error_code*)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::detail::directory_iterator_increment(boost::filesystem::directory_iterator&, boost::system::error_code*)'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::filesystem::directory_entry::m_get_status(boost::system::error_code*) const'
../../lib/libpcl_io.so.1.7.1: error: undefined reference to 'boost::thread::do_try_join_until_noexcept(timespec const&, bool&)'
collect2: ld returned 1 exit status
make[2]: *** [bin/pcl_convert_pcd_ascii_binary] Error 1
make[1]: *** [io/tools/CMakeFiles/pcl_convert_pcd_ascii_binary.dir/all] Error 2
make: *** [all] Error 2
Is it correct that this is a linking problem? can it be the boost installation that causes the problem?
I have built the boost library from source (version 1.55.0) by executing the following inside the boost_1_55_0 directory
sudo ./bootstrap
sudo ./b2 install
The boost is then installed in /usr/local/include and /usr/local/lib
I use 32 bit Ubuntu 12.04
I found some libboost files in /usr/lib which I forgot to delete from the last install of boost (as pointed out by #D.J.Duff). Removing those files and intstalling boost again fixed the problem.