MySQL framework for C++ - c++

I'm trying to write a c++ application that requires access to a MySQL database.
Until I updated the MySQL version from 5.7 to 8.0 I could use the framework provided here and suggested in this StackOverflow post
Since the MySQL upgrade, I get the following linker errors:
/usr/bin/ld: warning: libmysqlclient.so.18, needed by /usr/lib/libmysqlpp.so, not found (try using -rpath or -rpath-link)`mysql_num_fields#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_options#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_fetch_lengths#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_close#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_field_count#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_error#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_select_db#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_next_result#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_real_connect#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_get_server_info#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_fetch_row#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_init#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_get_client_info#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_thread_init#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_fetch_field#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_thread_id#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_get_proto_info#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_thread_end#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_info#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_kill#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_get_host_info#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_more_results#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_insert_id#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_ping#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_errno#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_use_result#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_free_result#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_store_result#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_set_server_option#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_real_query#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_affected_rows#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_num_rows#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_field_seek#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_real_escape_string#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_escape_string#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_ssl_set#libmysqlclient_18'
/usr/bin/ld: /usr/lib/libmysqlpp.so: undefined reference to `mysql_stat#libmysqlclient_18'
Any help on fixing the current issue or recommendation of a c++ MySQL framework that will work with MySQL version >= 8.0 will be greatly appreciated.

Related

Undefined reference to `proj_context_create' while run PROJ example

I have installed Proj 6.3.1 and I tried to run a Proj example from https://proj.org/development/quickstart.html. I implemented it with CLion on Ubuntu 20.04. And I got many undefined reference errors as follows,
cd "/path_to_the_file/" && g++ transformation.cpp -o transformation && "/path_to_the_file/"transformation
/usr/bin/ld: /tmp/cckO2X58.o: in function `main':
transformation.cpp:(.text+0x1f): undefined reference to `proj_context_create'
/usr/bin/ld: transformation.cpp:(.text+0x42): undefined reference to `proj_create_crs_to_crs'
/usr/bin/ld: transformation.cpp:(.text+0x8a): undefined reference to `proj_normalize_for_visualization'
/usr/bin/ld: transformation.cpp:(.text+0xcb): undefined reference to `proj_destroy'
/usr/bin/ld: transformation.cpp:(.text+0x102): undefined reference to `proj_coord'
/usr/bin/ld: transformation.cpp:(.text+0x14f): undefined reference to `proj_trans'
/usr/bin/ld: transformation.cpp:(.text+0x1c3): undefined reference to `proj_trans'
/usr/bin/ld: transformation.cpp:(.text+0x21c): undefined reference to `proj_destroy'
/usr/bin/ld: transformation.cpp:(.text+0x228): undefined reference to `proj_context_destroy'
collect2: error: ld returned 1 exit status
This problem is similar to https://gis.stackexchange.com/questions/370771/unable-to-run-proj-c-example, but I can't find the solutions accordingly. The <proj.h> header is in my usr/include folder and Clion can detect it automatically. Could anyone help?

wxWidgets sample files mediaplayer ans splash don't compile

I downloaded and built the wxWidgets library on Ubuntu 21.04 using the following flags:
--enable-monolithic
--disable-shared
--enable-cxx11
--enable-stl
--enable-std_containers_compat
--enable-std_iostreams
--enable-std_string
--enable-std_string_conv_in_wxstring
--disable-unsafe_conv_in_wxstring
--enable-utf8
--enable-profile
--disable-vararg_macros
--enable-universal_binary
--enable-intl
--enable-config
--enable-protocols
--enable-ftp
--enable-http
--enable-fileproto
--enable-sockets
--enable-ipv6
--enable-dataobj
--enable-webrequest
--enable-ipc
--enable-baseevtloop
--enable-epollloop
--enable-selectloop
--enable-any
--enable-arcstream
--enable-base64
--enable-backtrace
--enable-catch_segvs
--enable-cmdline
--enable-datetime
--enable-debugreport
--enable-dialupman
--enable-dynlib
--enable-dynamicloader
--enable-exceptions
--enable-ffile
--enable-file
--enable-filehistory
--enable-filesystem
--enable-fontenum
--enable-fontmap
--enable-fs_archive
--enable-fs_inet
--enable-fsvolume
--enable-fswatcher
--enable-geometry
--enable-log
--enable-longlong
--enable-mimetype
--enable-printfposparam
--enable-secretstore
--enable-snglinst
--enable-sound
--enable-stdpaths
--enable-stopwatch
--enable-streams
--enable-sysoptions
--enable-tarstream
--enable-textbuf
--enable-textfile
--enable-timer
--enable-variant
--enable-zipstream
--enable-url
--enable-protocol
--enable-protocol-http
--enable-protocol-ftp
--enable-protocol-file
--enable-threads
--enable-docview
--enable-help
--enable-html
--enable-htmlhelp
--enable-xrc
--enable-aui
--enable-propgrid
--enable-ribbon
--enable-stc
--enable-constraints
--enable-loggui
--enable-logwin
--enable-logdialog
--enable-mdi
--enable-mdidoc
--enable-mediactrl
--enable-richtext
--enable-postscript
--enable-printarch
--enable-svg
--enable-webview
--enable-graphics_ctx
--enable-clipboard
--enable-dnd
--enable-markup
--enable-accel
--enable-actindicator
--enable-addremovectrl
--enable-animatectrl
--enable-bannerwindow
--enable-artstd
--enable-arttango
--enable-bmpbutton
--enable-bmpcombobox
--enable-button
--enable-calendar
--enable-caret
--enable-checkbox
--enable-checklst
--enable-choice
--enable-choicebook
--enable-collpane
--enable-colourpicker
--enable-combobox
--enable-comboctrl
--enable-commandlinkbutton
--enable-dataviewctrl
--enable-datepick
--enable-detect_sm
--enable-dirpicker
--enable-display
--enable-editablebox
--enable-filectrl
--enable-filepicker
--enable-fontpicker
--enable-gauge
--enable-grid
--enable-headerctrl
--enable-hyperlink
--enable-imaglist
--enable-infobar
--enable-listbook
--enable-listbox
--enable-listctrl
--enable-notebook
--enable-notifmsg
--enable-odcombobox
--enable-popupwin
--enable-prefseditor
--enable-privatefonts
--enable-radiobox
--enable-radiobtn
--enable-richmsgdlg
--enable-richtooltip
--enable-rearrangectrl
--enable-sash
--enable-scrollbar
--enable-searchctrl
--enable-slider
--enable-spinbtn
--enable-spinctrl
--enable-splitter
--enable-statbmp
--enable-statbox
--enable-statline
--enable-stattext
--enable-statusbar
--enable-taskbaricon
--enable-tbarnative
--enable-textctrl
--enable-timepick
--enable-tipwindow
--enable-togglebtn
--enable-toolbar
--enable-toolbook
--enable-treebook
--enable-treectrl
--enable-treelist
--enable-commondlg
--enable-aboutdlg
--enable-choicedlg
--enable-coldlg
--enable-creddlg
--enable-filedlg
--enable-finddlg
--enable-fontdlg
--enable-dirdlg
--enable-msgdlg
--enable-numberdlg
--enable-splash
--enable-textdlg
--enable-tipdlg
--enable-progressdlg
--enable-wizarddlg
--enable-menus
--enable-menubar
--enable-miniframe
--enable-tooltips
--enable-splines
--enable-mousewheel
--enable-validators
--enable-busyinfo
--enable-hotkey
--enable-joystick
--enable-metafile
--enable-dragimage
--enable-dctransform
--enable-webviewwebkit
--enable-palette
--enable-image
--enable-gif
--enable-pcx
--enable-tga
--enable-iff
--enable-pnm
--enable-xpm
--enable-ico_cur
--enable-autoidman
I used all these flags because I mainly want to play around with the library and having a static, monolithic library with all the features enabled suits that purpose. At first I faced some issues at configuration with GStreamer which wasn't installed but after I installed it the library compiled just fine. For the sake of completeness, these are the exact steps I followed:
#Current dir -> ~/Programs/C++/wxWidgets-3.1.5
mkdir build-gtk
cd build-gtk
../configure #all the above flags
make
sudo checkinstall
and finally I installed the library through the generated .deb file.
I then proceeded to build the sample files with the provided make files. All but two compiled, mediaplayer and splash directories. Again, the exact procedure I followed was:
cd samples
make
The error I got for mediaplayer is:
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `draw':
mediactrl.cpp:(.text+0x195): undefined reference to `gst_video_overlay_expose'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::SetPosition(wxLongLongNative)':
mediactrl.cpp:(.text+0x200): undefined reference to `gst_element_seek'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::GetDuration()':
mediactrl.cpp:(.text+0x24f): undefined reference to `gst_element_query_duration'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::GetDownloadTotal()':
mediactrl.cpp:(.text+0x2cf): undefined reference to `gst_element_query_duration'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::GetPosition()':
mediactrl.cpp:(.text+0x545): undefined reference to `gst_element_query_position'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `gtk_window_realize_callback':
mediactrl.cpp:(.text+0x615): undefined reference to `gst_video_overlay_set_window_handle'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::~wxGStreamerMediaBackend()':
mediactrl.cpp:(.text+0x6e6): undefined reference to `gst_object_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0x75a): undefined reference to `gst_element_set_state'
/usr/bin/ld: mediactrl.cpp:(.text+0x75f): undefined reference to `gst_object_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0x773): undefined reference to `gst_object_unref'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::SetupXOverlay()':
mediactrl.cpp:(.text+0x918): undefined reference to `gst_video_overlay_set_window_handle'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::TryAudioSink(_GstElement*)':
mediactrl.cpp:(.text+0xac8): undefined reference to `gst_element_get_type'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::TryVideoSink(_GstElement*)':
mediactrl.cpp:(.text+0xb5e): undefined reference to `gst_bin_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0xb89): undefined reference to `gst_video_overlay_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0xbaf): undefined reference to `gst_bin_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0xbd1): undefined reference to `gst_video_overlay_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0xbd9): undefined reference to `gst_bin_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0xbef): undefined reference to `gst_bin_get_by_interface'
/usr/bin/ld: mediactrl.cpp:(.text+0xbfb): undefined reference to `gst_video_overlay_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0xc2a): undefined reference to `gst_element_set_state'
/usr/bin/ld: mediactrl.cpp:(.text+0xc50): undefined reference to `gst_video_overlay_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0xc61): undefined reference to `gst_video_overlay_get_type'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::CreateControl(wxControl*, wxWindow*, int, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)':
mediactrl.cpp:(.text+0x100c): undefined reference to `gst_init_check'
/usr/bin/ld: mediactrl.cpp:(.text+0x122a): undefined reference to `gst_element_factory_make'
/usr/bin/ld: mediactrl.cpp:(.text+0x1236): undefined reference to `gst_element_get_type'
/usr/bin/ld: mediactrl.cpp:(.text+0x190c): undefined reference to `gst_element_get_bus'
/usr/bin/ld: mediactrl.cpp:(.text+0x191e): undefined reference to `gst_bus_add_watch'
/usr/bin/ld: mediactrl.cpp:(.text+0x1927): undefined reference to `gst_element_get_bus'
/usr/bin/ld: mediactrl.cpp:(.text+0x193b): undefined reference to `gst_bus_set_sync_handler'
/usr/bin/ld: mediactrl.cpp:(.text+0x194e): undefined reference to `gst_element_factory_make'
/usr/bin/ld: mediactrl.cpp:(.text+0x1977): undefined reference to `gst_element_factory_make'
/usr/bin/ld: mediactrl.cpp:(.text+0x19a0): undefined reference to `gst_element_factory_make'
/usr/bin/ld: mediactrl.cpp:(.text+0x1b4f): undefined reference to `gst_element_factory_make'
/usr/bin/ld: mediactrl.cpp:(.text+0x1b7f): undefined reference to `gst_element_factory_make'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o):mediactrl.cpp:(.text+0x1ba8): more undefined references to `gst_element_factory_make' follow
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::CreateControl(wxControl*, wxWindow*, int, wxPoint const&, wxSize const&, long, wxValidator const&, wxString const&)':
mediactrl.cpp:(.text+0x1d2b): undefined reference to `gst_element_get_static_pad'
/usr/bin/ld: mediactrl.cpp:(.text+0x1d5c): undefined reference to `gst_object_unref'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::Play()':
mediactrl.cpp:(.text+0x30d1): undefined reference to `gst_element_set_state'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::Pause()':
mediactrl.cpp:(.text+0x312c): undefined reference to `gst_element_set_state'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::QueryVideoSizeFromPad(_GstPad*)':
mediactrl.cpp:(.text+0x3f44): undefined reference to `gst_pad_get_current_caps'
/usr/bin/ld: mediactrl.cpp:(.text+0x3f5a): undefined reference to `gst_caps_get_structure'
/usr/bin/ld: mediactrl.cpp:(.text+0x3f79): undefined reference to `gst_structure_get_int'
/usr/bin/ld: mediactrl.cpp:(.text+0x3f8c): undefined reference to `gst_structure_get_int'
/usr/bin/ld: mediactrl.cpp:(.text+0x3fa2): undefined reference to `gst_structure_get_value'
/usr/bin/ld: mediactrl.cpp:(.text+0x40be): undefined reference to `gst_mini_object_unref'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `gst_bus_async_callback':
mediactrl.cpp:(.text+0x5fe7): undefined reference to `gst_message_parse_state_changed'
/usr/bin/ld: mediactrl.cpp:(.text+0x6014): undefined reference to `gst_message_parse_error'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `gst_bus_sync_callback':
mediactrl.cpp:(.text+0x607a): undefined reference to `gst_is_video_overlay_prepare_window_handle_message'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::SyncStateChange(_GstElement*, GstState, long)':
mediactrl.cpp:(.text+0x6497): undefined reference to `gst_element_get_bus'
/usr/bin/ld: mediactrl.cpp:(.text+0x64b0): undefined reference to `gst_bus_have_pending'
/usr/bin/ld: mediactrl.cpp:(.text+0x64f4): undefined reference to `gst_bus_pop'
/usr/bin/ld: mediactrl.cpp:(.text+0x6505): undefined reference to `gst_mini_object_unref'
/usr/bin/ld: mediactrl.cpp:(.text+0x656b): undefined reference to `gst_mini_object_unref'
/usr/bin/ld: mediactrl.cpp:(.text+0x65b9): undefined reference to `gst_message_parse_state_changed'
/usr/bin/ld: mediactrl.cpp:(.text+0x65d3): undefined reference to `gst_mini_object_unref'
/usr/bin/ld: mediactrl.cpp:(.text+0x65fa): undefined reference to `gst_message_parse_error'
/usr/bin/ld: mediactrl.cpp:(.text+0x661c): undefined reference to `gst_mini_object_unref'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaEventHandler::OnMediaFinish(wxMediaEvent&)':
mediactrl.cpp:(.text+0x69d1): undefined reference to `gst_element_set_state'
/usr/bin/ld: mediactrl.cpp:(.text+0x69fa): undefined reference to `gst_element_set_state'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::DoLoad(wxString const&)':
mediactrl.cpp:(.text+0x6ad6): undefined reference to `gst_element_set_state'
/usr/bin/ld: mediactrl.cpp:(.text+0x703a): undefined reference to `gst_element_set_state'
/usr/bin/ld: mediactrl.cpp:(.text+0x7046): undefined reference to `gst_uri_protocol_is_valid'
/usr/bin/ld: mediactrl.cpp:(.text+0x70c0): undefined reference to `gst_uri_is_valid'
/usr/bin/ld: mediactrl.cpp:(.text+0x71f0): undefined reference to `gst_element_set_state'
/usr/bin/ld: ~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib/libwx_gtk3u-3.1.a(monolib_unix_mediactrl.o): in function `wxGStreamerMediaBackend::Stop()':
mediactrl.cpp:(.text+0x7759): undefined reference to `gst_element_set_state'
collect2: error: ld returned 1 exit status
make tried to compile the the sample running g++ with the following flags (quoting them in separate lines for readability):
g++
-std=gnu++11
-o mediaplayer mediaplayer_mediaplayer.o
-L~/Programs/C++/wxWidgets-3.1.5/build-gtk/lib
-pthread
-pg
-lgstvideo-1.0
-lgstbase-1.0
-lgstreamer-1.0
-lgobject-2.0
-lglib-2.0
-lwx_gtk3u-3.1
-lwxscintilla-3.1
-lwxregexu-3.1
-pthread
-lz
-ldl
-lcurl
-llzma
-lm
-lexpat
-lgtk-3
-lgdk-3
-lpangocairo-1.0
-lpango-1.0
-lharfbuzz
-latk-1.0
-lcairo-gobject
-lcairo
-lgdk_pixbuf-2.0
-lgio-2.0
-lgobject-2.0
-lgthread-2.0
-pthread
-lglib-2.0
-lX11
-lSM
-lgtk-3
-lgdk-3
-lpangocairo-1.0
-lpango-1.0
-lharfbuzz
-latk-1.0
-lcairo-gobject
-lcairo
-lgdk_pixbuf-2.0
-lgio-2.0
-lgobject-2.0
-lglib-2.0
-lnotify
-lgdk_pixbuf-2.0
-lgio-2.0
-lgobject-2.0
-lglib-2.0
-lXtst
-lpangoft2-1.0
-lpango-1.0
-lgobject-2.0
-lglib-2.0
-lharfbuzz
-lfontconfig
-lfreetype
-lpng
-lz
-ljpeg
-ltiff
-llzma
-ljbig
-lz
-ldl
-lcurl
-llzma
-lm
I've been trying two days now to solve this but I can't figured it out. I've tried installing all the possible GStreamer packages, copying the GStreamer libraries and header files to a bunch of different location, I tried --reinstall and other things but at this point I haven't managed to get anywhere. Does anyone know what am I missing here? How can I compile these sample files?
Edit:
As #VZ. pointed out I should make more clear that:
The make files were autogenerated by building wxWidgets library.
There was a makefile in the build-gtk/samples directory which would compile in batch all examples.
In each example (e.g. build-gtk/samples/mediaplayer) there was a makefile generated by a bakefile - the first lines are a block comment saying:
# =========================================================================
# This makefile was generated by
# Bakefile 0.2.12 ([http://www.bakefile.org][1])
# Do not modify, all changes will be overwritten!
# =========================================================================
I ran make in build-gtk/samples, which compiled all examples except build-gtk/samples/mediaplayer and build-gtk/samples/splash.
Following #VZ.'s answer I also tried to manually compile build-gtk/samples/mediaplayer using g++ and changing the order of the libraries I got the following error:
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libgstvideo-1.0.so: undefined reference to `gst_event_parse_instant_rate_change'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libgstvideo-1.0.so: undefined reference to `gst_aggregator_simple_get_next_time'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libgstvideo-1.0.so: undefined reference to `gst_base_sink_set_processing_deadline'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libgstvideo-1.0.so: undefined reference to `gst_mini_object_add_parent'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libgstvideo-1.0.so: undefined reference to `gst_mini_object_remove_parent'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../x86_64-linux-gnu/libgstvideo-1.0.so: undefined reference to `gst_aggregator_selected_samples'
collect2: error: ld returned 1 exit status
Edit 2:
I fixed the aforementioned error by running the following:
sudo rm /usr/local/lib/libgstbase-1.0.so*
sudo rm /usr/local/lib/libgstreamer-1.0.*
effectively removing any gstreamer libraries under /usr/local/lib that seemed to be conflicting with some other gstreamer libraries elsewhere in the system.
There is a problem with the order of the libraries in the link command you show, gstreamer libraries must come after -lwx_gtk3u-3.1 and not before it as they do, when using static libraries.
It's not clear to me where does this command actually come from, normally you should run make inside build-gtk/samples/mediaplayer directory, is this really what you're doing? I.e. how exactly do you the provided makefiles and which ones are you using?
This looks like a bug in static monolithic build when using media library and should be fixed in wxWidgets itself. I don't know about the new errors, i.e. the missing gst_event_parse_instant_rate_change and other symbols, I don't have anything like this on my system, so I suspect this might be due to a mix of gstreamer libraries on your system due to your previous attempts to circumvent the problem.
P.S. Avoid using all these --enable-xxx options, they're all on by default anyhow (and those that are off are usually off for a good reason).

Undefined reference when linking to .a library

I'm trying out this library:
https://github.com/dacap/clip
I've git-cloned it, then built it using the following:
cmake .
make
This produces a library called libclip.a.
Now, I've taken the sample Hello World code, which is this:
#include "clip/clip.h"
int main() {
clip::set_text("Hello World");
}
Given that the above is in a file called cliptest2.cpp, I compile it as follows:
g++ -lclip cliptest2.cpp -o cliptest2
Every time, I get the following:
/usr/bin/ld: /tmp/cc71SQmy.o: in function `main':
cliptest2.cpp:(.text+0x47): undefined reference to `clip::set_text(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
collect2: error: ld returned 1 exit status
I do understand how the linker works and have gone through dozens of other questions with similar errors. However, given that I am building the third party library and linking it into my sample program, I don't understand why the set_text() method is not being resolved.
Edit: I've tried a few things, also as a result of the comments below. The source code for the clip library resides at ~/git/clip, and I am compiling cliptest2.cpp from the home directory itself. Therefore, adjusting the command suggested by #MathiasSchmid to my environment, I end up with this:
g++ cliptest2.cpp -I git -L git/clip -lclip -lxcb -lpthread -o cliptest2
I run this on my Kubuntu 20.04 LTS, and get all the following errors:
daniel#orion:~$ g++ cliptest2.cpp -I git -L git/clip -lclip -lxcb -lpthread -o cliptest2
/usr/bin/ld: git/clip/libclip.a(clip_x11.cpp.o): in function `clip::x11::write_data_fn(png_struct_def*, unsigned char*, unsigned long)':
clip_x11.cpp:(.text+0x4f): undefined reference to `png_get_io_ptr'
/usr/bin/ld: git/clip/libclip.a(clip_x11.cpp.o): in function `clip::x11::write_png(clip::image const&, std::vector<unsigned char, std::allocator<unsigned char> >&)':
clip_x11.cpp:(.text+0x117): undefined reference to `png_create_write_struct'
/usr/bin/ld: clip_x11.cpp:(.text+0x13a): undefined reference to `png_create_info_struct'
/usr/bin/ld: clip_x11.cpp:(.text+0x158): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: clip_x11.cpp:(.text+0x17d): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: clip_x11.cpp:(.text+0x1a5): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: clip_x11.cpp:(.text+0x1cb): undefined reference to `png_set_write_fn'
/usr/bin/ld: clip_x11.cpp:(.text+0x232): undefined reference to `png_set_IHDR'
/usr/bin/ld: clip_x11.cpp:(.text+0x249): undefined reference to `png_write_info'
/usr/bin/ld: clip_x11.cpp:(.text+0x255): undefined reference to `png_set_packing'
/usr/bin/ld: clip_x11.cpp:(.text+0x268): undefined reference to `png_get_rowbytes'
/usr/bin/ld: clip_x11.cpp:(.text+0x27a): undefined reference to `png_malloc'
/usr/bin/ld: clip_x11.cpp:(.text+0x3cd): undefined reference to `png_write_rows'
/usr/bin/ld: clip_x11.cpp:(.text+0x3e9): undefined reference to `png_free'
/usr/bin/ld: clip_x11.cpp:(.text+0x3fc): undefined reference to `png_write_end'
/usr/bin/ld: clip_x11.cpp:(.text+0x40f): undefined reference to `png_destroy_write_struct'
/usr/bin/ld: git/clip/libclip.a(clip_x11.cpp.o): in function `clip::x11::read_data_fn(png_struct_def*, unsigned char*, unsigned long)':
clip_x11.cpp:(.text+0x45d): undefined reference to `png_get_io_ptr'
/usr/bin/ld: git/clip/libclip.a(clip_x11.cpp.o): in function `clip::x11::read_png(unsigned char const*, unsigned long, clip::image*, clip::image_spec*)':
clip_x11.cpp:(.text+0x575): undefined reference to `png_create_read_struct'
/usr/bin/ld: clip_x11.cpp:(.text+0x5a1): undefined reference to `png_create_info_struct'
/usr/bin/ld: clip_x11.cpp:(.text+0x5cd): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: clip_x11.cpp:(.text+0x5f5): undefined reference to `png_set_longjmp_fn'
/usr/bin/ld: clip_x11.cpp:(.text+0x628): undefined reference to `png_destroy_read_struct'
/usr/bin/ld: clip_x11.cpp:(.text+0x68f): undefined reference to `png_set_read_fn'
/usr/bin/ld: clip_x11.cpp:(.text+0x6a8): undefined reference to `png_read_info'
/usr/bin/ld: clip_x11.cpp:(.text+0x6ea): undefined reference to `png_get_IHDR'
/usr/bin/ld: clip_x11.cpp:(.text+0x747): undefined reference to `png_get_rowbytes'
/usr/bin/ld: clip_x11.cpp:(.text+0x8bf): undefined reference to `png_set_strip_16'
/usr/bin/ld: clip_x11.cpp:(.text+0x8ce): undefined reference to `png_set_packing'
/usr/bin/ld: clip_x11.cpp:(.text+0x8dd): undefined reference to `png_set_expand_gray_1_2_4_to_8'
/usr/bin/ld: clip_x11.cpp:(.text+0x8ec): undefined reference to `png_set_palette_to_rgb'
/usr/bin/ld: clip_x11.cpp:(.text+0x8fb): undefined reference to `png_set_gray_to_rgb'
/usr/bin/ld: clip_x11.cpp:(.text+0x90a): undefined reference to `png_set_tRNS_to_alpha'
/usr/bin/ld: clip_x11.cpp:(.text+0x919): undefined reference to `png_set_interlace_handling'
/usr/bin/ld: clip_x11.cpp:(.text+0x938): undefined reference to `png_read_update_info'
/usr/bin/ld: clip_x11.cpp:(.text+0x95a): undefined reference to `png_malloc'
/usr/bin/ld: clip_x11.cpp:(.text+0x9ab): undefined reference to `png_malloc'
/usr/bin/ld: clip_x11.cpp:(.text+0xa19): undefined reference to `png_read_rows'
/usr/bin/ld: clip_x11.cpp:(.text+0xbe0): undefined reference to `png_free'
/usr/bin/ld: clip_x11.cpp:(.text+0xc05): undefined reference to `png_free'
/usr/bin/ld: clip_x11.cpp:(.text+0xc4b): undefined reference to `png_destroy_read_struct'
collect2: error: ld returned 1 exit status
It is still not clear to me what the problem here is.

Can't compile C/Opengl program using g++

I am taking a computer graphics course using opengl, and for the life of me, I've not been able to compile a single opengl program using the teacher's makefile without doing it on the school's server. I'm not an experience C programmer, so make files are a bit new to me. I've been spoiled by Eclipse compiler always making my build.xml file for me.
I am using cygwin since the teacher's make file is for linux/unix. I have also installed opengl on it via searching under the Graphics category on installation. This is my make file:
#!smake
# Project 1: Simple scene
#
MACHINE= $(shell uname -s)
ifeq ($(MACHINE),Darwin)
OPENGL_INC= -FOpenGL
OPENGL_LIB= -framework OpenGL -framework GLUT -framework Cocoa
else
OPENGL_INC= -I/usr/include
OPENGL_LIB= -L/usr/lib64
LLDLIBS = -lglut -lGL -lGLU -lGL -lXmu -lXext -lX11 -lm
endif
CXX=g++
COMPILER_FLAGS= -g
INCLUDE= $(OPENGL_INC)
While g++ doesn't complain about -lglut, -lGL, -lGLU, etc not existing (it was before), I still get this error message:
g++ -g -L/usr/lib64 -lglut -lGL -lGLU -lGL -lXmu -lXext -lX11 -lm MyCoolModel.o 01primitives.o 01primitivesUtil.o trackball.o model.o -o MyCoolModel
MyCoolModel.o: In function `init()':
/home/01primitives/MyCoolModel.c:48: undefined reference to `__imp_glClearColor'
/home/01primitives/MyCoolModel.c:48:(.text+0x1b): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glClearColor'
/home/01primitives/MyCoolModel.c:49: undefined reference to `__imp_glShadeModel'
/home/01primitives/MyCoolModel.c:49:(.text+0x29): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glShadeModel'
/home/01primitives/MyCoolModel.c:54: undefined reference to `__imp_glGenLists'
/home/01primitives/MyCoolModel.c:54:(.text+0x41): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glGenLists'
/home/01primitives/MyCoolModel.c:58: undefined reference to `__imp_glGenLists'
/home/01primitives/MyCoolModel.c:58:(.text+0x6a): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glGenLists'
MyCoolModel.o: In function `Display()':
/home/01primitives/MyCoolModel.c:71: undefined reference to `__imp_glClear'
/home/01primitives/MyCoolModel.c:71:(.text+0xa2): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glClear'
/home/01primitives/MyCoolModel.c:73: undefined reference to `__imp_glPushMatrix'
/home/01primitives/MyCoolModel.c:73:(.text+0xab): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glPushMatrix'
/home/01primitives/MyCoolModel.c:76: undefined reference to `__imp_glDisable'
/home/01primitives/MyCoolModel.c:76:(.text+0xbe): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glDisable'
/home/01primitives/MyCoolModel.c:77: undefined reference to `__imp_glDisable'
/home/01primitives/MyCoolModel.c:77:(.text+0xcc): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glDisable'
/home/01primitives/MyCoolModel.c:80: undefined reference to `__imp_glColor3f'
/home/01primitives/MyCoolModel.c:80:(.text+0xed): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glColor3f'
/home/01primitives/MyCoolModel.c:82: undefined reference to `__imp_glBegin'
/home/01primitives/MyCoolModel.c:82:(.text+0xfb): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `__imp_glBegin'
/home/01primitives/MyCoolModel.c:83: undefined reference to `__imp_glVertex3f'
/home/01primitives/MyCoolModel.c:83:(.text+0x114): additional relocation overflows omitted from the output
/home/01primitives/MyCoolModel.c:83: undefined reference to `__imp_glVertex3f'
/home/01primitives/MyCoolModel.c:83: undefined reference to `__imp_glVertex3f'
/home/01primitives/MyCoolModel.c:84: undefined reference to `__imp_glEnd'
/home/01primitives/MyCoolModel.c:85: undefined reference to `__imp_glColor3f'
/home/01primitives/MyCoolModel.c:86: undefined reference to `__imp_glBegin'
/home/01primitives/MyCoolModel.c:87: undefined reference to `__imp_glVertex3f'
/home/01primitives/MyCoolModel.c:87: undefined reference to `__imp_glVertex3f'
/home/01primitives/MyCoolModel.c:87: undefined reference to `__imp_glVertex3f'
/home/01primitives/MyCoolModel.c:88: undefined reference to `__imp_glEnd'
/home/01primitives/MyCoolModel.c:98: undefined reference to `__imp_glCallList'
/home/01primitives/MyCoolModel.c:99: undefined reference to `__imp_glPopMatrix'
/home/01primitives/MyCoolModel.c:102: undefined reference to `__imp_glCallList'
/home/01primitives/MyCoolModel.c:107: undefined reference to `glutSwapBuffers'
MyCoolModel.o: In function `Reshape(int, int)':
/home/01primitives/MyCoolModel.c:118: undefined reference to `__imp_glViewport'
/home/01primitives/MyCoolModel.c:119: undefined reference to `__imp_glMatrixMode'
/home/01primitives/MyCoolModel.c:120: undefined reference to `__imp_glLoadIdentity'
/home/01primitives/MyCoolModel.c:121: undefined reference to `gluPerspective'
/home/01primitives/MyCoolModel.c:122: undefined reference to `__imp_glMatrixMode'
/home/01primitives/MyCoolModel.c:123: undefined reference to `__imp_glLoadIdentity'
/home/01primitives/MyCoolModel.c:124: undefined reference to `__imp_glTranslatef'
MyCoolModel.o: In function `Mouse(int, int, int, int)':
/home/01primitives/MyCoolModel.c:133: undefined reference to `glutPostRedisplay'
MyCoolModel.o: In function `Motion(int, int)':
/home/01primitives/MyCoolModel.c:139: undefined reference to `glutPostRedisplay'
MyCoolModel.o: In function `Keyboard(unsigned char, int, int)':
/home/01primitives/MyCoolModel.c:158: undefined reference to `glutPostRedisplay'
MyCoolModel.o: In function `main':
/home/01primitives/MyCoolModel.c:166: undefined reference to `glutInit'
/home/01primitives/MyCoolModel.c:167: undefined reference to `glutInitWindowPosition'
/home/01primitives/MyCoolModel.c:168: undefined reference to `glutInitWindowSize'
/home/01primitives/MyCoolModel.c:169: undefined reference to `glutInitDisplayMode'
/home/01primitives/MyCoolModel.c:170: undefined reference to `glutCreateWindow'
/home/01primitives/MyCoolModel.c:174: undefined reference to `glutDisplayFunc'
/home/01primitives/MyCoolModel.c:175: undefined reference to `glutReshapeFunc'
/home/01primitives/MyCoolModel.c:176: undefined reference to `glutMouseFunc'
/home/01primitives/MyCoolModel.c:177: undefined reference to `glutMotionFunc'
/home/01primitives/MyCoolModel.c:178: undefined reference to `glutKeyboardFunc'
/home/01primitives/MyCoolModel.c:180: undefined reference to `glutMainLoop'
01primitivesUtil.o: In function `uMakeCoordList(unsigned int)':
/home/01primitives/01primitivesUtil.c:35: undefined reference to `__imp_glNewList'
/home/01primitives/01primitivesUtil.c:37: undefined reference to `__imp_glBegin'
/home/01primitives/01primitivesUtil.c:38: undefined reference to `__imp_glColor3f'
/home/01primitives/01primitivesUtil.c:38: undefined reference to `__imp_glVertex3f'
/home/01primitives/01primitivesUtil.c:38: undefined reference to `__imp_glVertex3f'
/home/01primitives/01primitivesUtil.c:39: undefined reference to `__imp_glColor3f'
/home/01primitives/01primitivesUtil.c:39: undefined reference to `__imp_glVertex3f'
/home/01primitives/01primitivesUtil.c:39: undefined reference to `__imp_glVertex3f'
/home/01primitives/01primitivesUtil.c:40: undefined reference to `__imp_glColor3f'
/home/01primitives/01primitivesUtil.c:40: undefined reference to `__imp_glVertex3f'
/home/01primitives/01primitivesUtil.c:40: undefined reference to `__imp_glVertex3f'
/home/01primitives/01primitivesUtil.c:41: undefined reference to `__imp_glEnd'
/home/01primitives/01primitivesUtil.c:42: undefined reference to `__imp_glEndList'
01primitivesUtil.o: In function `uMakeGroundList(unsigned int)':
/home/01primitives/01primitivesUtil.c:51: undefined reference to `__imp_glNewList'
/home/01primitives/01primitivesUtil.c:53: undefined reference to `__imp_glEndList'
trackball.o: In function `_tbStopMotion(int, unsigned int)':
/home/01primitives/trackball.c:83: undefined reference to `glutIdleFunc'
/home/01primitives/trackball.c:87: undefined reference to `glutIdleFunc'
trackball.o: In function `tbInit(unsigned int)':
/home/01primitives/trackball.c:105: undefined reference to `__imp_glPushMatrix'
/home/01primitives/trackball.c:106: undefined reference to `__imp_glLoadIdentity'
/home/01primitives/trackball.c:107: undefined reference to `__imp_glGetFloatv'
/home/01primitives/trackball.c:108: undefined reference to `__imp_glPopMatrix'
trackball.o: In function `tbMatrix()':
/home/01primitives/trackball.c:117: undefined reference to `__imp_glPushMatrix'
/home/01primitives/trackball.c:118: undefined reference to `__imp_glLoadIdentity'
/home/01primitives/trackball.c:119: undefined reference to `__imp_glRotatef'
/home/01primitives/trackball.c:120: undefined reference to `__imp_glMultMatrixf'
/home/01primitives/trackball.c:121: undefined reference to `__imp_glGetFloatv'
/home/01primitives/trackball.c:122: undefined reference to `__imp_glPopMatrix'
/home/01primitives/trackball.c:124: undefined reference to `__imp_glMultMatrixf'
trackball.o: In function `tbMouse(int, int, int, int)':
/home/01primitives/trackball.c:141: undefined reference to `glutGet'
/home/01primitives/trackball.c:143: undefined reference to `glutGet'
trackball.o: In function `tbMotion(int, int, int)':
/home/01primitives/trackball.c:181: undefined reference to `glutGet'
/home/01primitives/trackball.c:187: undefined reference to `glutPostRedisplay'
trackball.o: In function `tbZoom(float)':
/home/01primitives/trackball.c:199: undefined reference to `__imp_glMatrixMode'
/home/01primitives/trackball.c:200: undefined reference to `__imp_glLoadIdentity'
/home/01primitives/trackball.c:202: undefined reference to `__imp_glTranslatef'
trackball.o: In function `translate(float, float)':
/home/01primitives/trackball.c:208: undefined reference to `__imp_glMatrixMode'
/home/01primitives/trackball.c:209: undefined reference to `__imp_glLoadIdentity'
/home/01primitives/trackball.c:214: undefined reference to `__imp_glTranslatef'
model.o: In function `ModelHead()':
/home/01primitives/model.c:18: undefined reference to `__imp_glPushMatrix'
/home/01primitives/model.c:19: undefined reference to `__imp_glTranslatef'
/home/01primitives/model.c:21: undefined reference to `__imp_glPopMatrix'
model.o: In function `ModelTorso()':
/home/01primitives/model.c:26: undefined reference to `__imp_glPushMatrix'
/home/01primitives/model.c:27: undefined reference to `__imp_glTranslatef'
/home/01primitives/model.c:28: undefined reference to `__imp_glPopMatrix'
model.o: In function `ModelUpperBody()':
/home/01primitives/model.c:33: undefined reference to `__imp_glPushMatrix'
/home/01primitives/model.c:34: undefined reference to `__imp_glTranslatef'
/home/01primitives/model.c:35: undefined reference to `__imp_glPopMatrix'
model.o: In function `ModelLegsAndFeet()':
/home/01primitives/model.c:40: undefined reference to `__imp_glPushMatrix'
/home/01primitives/model.c:41: undefined reference to `__imp_glTranslatef'
/home/01primitives/model.c:42: undefined reference to `__imp_glPopMatrix'
model.o: In function `ModelLittleMario()':
/home/01primitives/model.c:69: undefined reference to `__imp_glRasterPos2f'
/home/01primitives/model.c:70: undefined reference to `__imp_glDrawPixels'
collect2: error: ld returned 1 exit status
Makefile:36: recipe for target 'MyCoolModel' failed
make: *** [MyCoolModel] Error 1
I've been hearing that this sort of problem lies with the linker, although I'm not exactly sure what that means. I am assuming that my header files were recognized, my binaries weren't, or were in the wrong directory.
My teacher's Makefile says that the opengl library files are in a directory called /usr/lib64, but checking my cygwin user directory, it does not exist. I can see the /usr/include folder, though. This could the the problem, but I have no idea how to resolve it. I though that installing opengl on cygwin would take care of this.
Assuming that this is the problem, could anyone help me locate these library files?

Ogre g++ compile-time error

On ubuntu, I have compiled and installed all the ogre libraries. However, when I try to compile a tutorial with this command
g++ -o otest ogre.cpp -I `pkg-config --libs --cflags OGRE OIS` -lOgreMain -lOI
and it outputs
/tmp/cc9ndjXQ.o: In function `TutorialApplication::TutorialApplication()':
ogre.cpp:(.text+0xd): undefined reference to `BaseApplication::BaseApplication()'
/tmp/cc9ndjXQ.o: In function `TutorialApplication::TutorialApplication()':
ogre.cpp:(.text+0x51): undefined reference to `BaseApplication::BaseApplication()'
/tmp/cc9ndjXQ.o: In function `TutorialApplication::~TutorialApplication()':
ogre.cpp:(.text+0xc6): undefined reference to `BaseApplication::~BaseApplication()'
/tmp/cc9ndjXQ.o: In function `TutorialApplication::~TutorialApplication()':
ogre.cpp:(.text+0x13a): undefined reference to `BaseApplication::~BaseApplication()'
/tmp/cc9ndjXQ.o: In function `TutorialApplication::~TutorialApplication()':
ogre.cpp:(.text+0x1ae): undefined reference to `BaseApplication::~BaseApplication()'
/tmp/cc9ndjXQ.o: In function `main':
ogre.cpp:(.text+0x44d): undefined reference to `BaseApplication::go()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0xc): undefined reference to `BaseApplication::frameRenderingQueued(Ogre::FrameEvent const&)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x1c): undefined reference to `BaseApplication::go()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x20): undefined reference to `BaseApplication::setup()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x24): undefined reference to `BaseApplication::configure()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x28): undefined reference to `BaseApplication::chooseSceneManager()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x2c): undefined reference to `BaseApplication::createCamera()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x30): undefined reference to `BaseApplication::createFrameListener()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x38): undefined reference to `BaseApplication::destroyScene()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x3c): undefined reference to `BaseApplication::createViewports()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x40): undefined reference to `BaseApplication::setupResources()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x44): undefined reference to `BaseApplication::createResourceListener()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x48): undefined reference to `BaseApplication::loadResources()'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x4c): undefined reference to `BaseApplication::keyPressed(OIS::KeyEvent const&)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x50): undefined reference to `BaseApplication::keyReleased(OIS::KeyEvent const&)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x54): undefined reference to `BaseApplication::mouseMoved(OIS::MouseEvent const&)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x58): undefined reference to `BaseApplication::mousePressed(OIS::MouseEvent const&, OIS::MouseButtonID)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x5c): undefined reference to `BaseApplication::mouseReleased(OIS::MouseEvent const&, OIS::MouseButtonID)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x60): undefined reference to `BaseApplication::windowResized(Ogre::RenderWindow*)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x64): undefined reference to `BaseApplication::windowClosed(Ogre::RenderWindow*)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x7c): undefined reference to `non-virtual thunk to BaseApplication::windowResized(Ogre::RenderWindow*)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x84): undefined reference to `non-virtual thunk to BaseApplication::windowClosed(Ogre::RenderWindow*)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0x9c): undefined reference to `non-virtual thunk to BaseApplication::keyPressed(OIS::KeyEvent const&)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0xa0): undefined reference to `non-virtual thunk to BaseApplication::keyReleased(OIS::KeyEvent const&)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0xb4): undefined reference to `non-virtual thunk to BaseApplication::mouseMoved(OIS::MouseEvent const&)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0xb8): undefined reference to `non-virtual thunk to BaseApplication::mousePressed(OIS::MouseEvent const&, OIS::MouseButtonID)'
/tmp/cc9ndjXQ.o:(.rodata._ZTV19TutorialApplication[vtable for TutorialApplication]+0xbc): undefined reference to `non-virtual thunk to BaseApplication::mouseReleased(OIS::MouseEvent const&, OIS::MouseButtonID)'
/tmp/cc9ndjXQ.o:(.rodata._ZTI19TutorialApplication[typeinfo for TutorialApplication]+0x8): undefined reference to `typeinfo for BaseApplication'
collect2: ld returned 1 exit status
Anyone know how to fix this/what I am doing wrong?
That's not a compile time error, it's a link time error.
By the looks of things, you probably aren't compiling all the *.cpp files. What file is the body of TutorialApplication's constructor in? You need to compile and link with that.
this works on ogre tutorials :
g++ -o otest *.cpp -I `pkg-config --libs --cflags OGRE OIS`