Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Linking wxPropertyGrid Problem , Please Help

Help
2012-08-31
2013-05-22
  • Hello , i am having a problem with linking wxPropertyGrid , i really need help as i have a deadline for my task in a project , thank you in advance :)

    what is the flag to use with GCC or wx-config to link wxPropertyGrid ?

    i am using this very minimalistic example:

    /*****************************************************************************************/

    #include <wx/wx.h>
    #include <wx/propgrid/propgrid.h>
    class MyApp : public wxApp{
        public:
            virtual bool OnInit();
    };
    class MyFrame : public wxFrame 
    { 
    public: 
        MyFrame(); 
    };
    IMPLEMENT_APP(MyApp)
    bool MyApp::OnInit(){
        MyFrame *frame = new MyFrame();
        frame->Show(true);
        return true;
    }
    MyFrame::MyFrame() : wxFrame(NULL, wxID_ANY, wxT("wxPropertyGrid Test")){
        wxPropertyGrid *pg = new wxPropertyGrid(this);
        SetSize(400, 600);
    }
    

    /*****************************************************************************************/

    and i compile using this:
    g++ test.cpp `wx-config -cppflags -libs core,base` -o test

    and i get these undefined refrence errors:
    /*******************************************************/
    /tmp/ccCmleP5.o: In function `MyFrame::MyFrame()':
    test.cpp:(.text+0x178): undefined reference to `wxPropertyGridNameStr'
    test.cpp:(.text+0x1ff): undefined reference to `wxPropertyGrid::wxPropertyGrid(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
    /tmp/ccCmleP5.o: In function `MyFrame::MyFrame()':
    test.cpp:(.text+0x308): undefined reference to `wxPropertyGridNameStr'
    test.cpp:(.text+0x38f): undefined reference to `wxPropertyGrid::wxPropertyGrid(wxWindow*, int, wxPoint const&, wxSize const&, long, wxString const&)'
    collect2: ld returned 1 exit status
    /*******************************************************/

    Here is my configuration:
    EasyPeasy ( Ubuntu 10.04 )
    wxWidgets 2.8
    GCC 4.7
    wxPropertyGrid 1.4.15

    i built wxPropertyGrid normally using configure , make , make install. here are the logs:

    configure:

    checking build system type… i686-pc-linux-gnu
    checking host system type… i686-pc-linux-gnu
    checking target system type… i686-pc-linux-gnu
    checking for the -enable-debug option… will be automatically detected
    checking for the -enable-unicode option… will be automatically detected
    checking for the -enable-shared option… will be automatically detected
    checking for the -with-toolkit option… will be automatically detected
    checking for the -with-wxshared option… will be automatically detected
    checking for the -with-wxversion option… will be automatically detected
    checking for gcc… gcc
    checking for C compiler default output file name… a.out
    checking whether the C compiler works… yes
    checking whether we are cross compiling… no
    checking for suffix of executables…
    checking for suffix of object files… o
    checking whether we are using the GNU C compiler… yes
    checking whether gcc accepts -g… yes
    checking for gcc option to accept ANSI C… none needed
    checking for g++… g++
    checking whether we are using the GNU C++ compiler… yes
    checking whether g++ accepts -g… yes
    checking for wx-config… /usr/bin/wx-config
    checking for wxWidgets version >= 2.6.1… yes (version 2.8.12)
    checking for wxWidgets static library… no
    checking if wxWidgets was built with UNICODE enabled… yes
    checking if wxWidgets was built in DEBUG mode… no
    checking if wxWidgets was built in STATIC mode… no
    checking which wxWidgets toolkit was selected… gtk2
    checking for ranlib… ranlib
    checking for a BSD-compatible install… /usr/bin/install -c
    checking whether ln -s works… yes
    checking whether make sets $(MAKE)… yes
    checking for ar… ar
    checking for strip… strip
    checking for nm… nm
    checking if make is GNU make… yes
    checking for dependency tracking method… gcc
    configure: creating ./config.status
    config.status: creating Makefile


      Configuration for PROPGRID 1.4.15 successfully completed.
      Summary of main configuration settings for PROPGRID:
      - RELEASE build
      - UNICODE mode
      - SHARED mode

      The wxWidgets build which will be used by PROPGRID 1.4.15
      has the following settings:
      - RELEASE build
      - UNICODE mode
      - SHARED mode
      - VERSION: 2.8.12
      - PORT: gtk2

      Now, just run make.

    make :

    /home/darko/propgrid/bk-deps g++ -c -o propgrid_dll_advprops.o -I./include -DWXMAKINGDLL_PROPGRID -fPIC -DPIC -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./src/advprops.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgrid_dll_editors.o -I./include -DWXMAKINGDLL_PROPGRID -fPIC -DPIC -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./src/editors.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgrid_dll_extras.o -I./include -DWXMAKINGDLL_PROPGRID -fPIC -DPIC -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./src/extras.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgrid_dll_manager.o -I./include -DWXMAKINGDLL_PROPGRID -fPIC -DPIC -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./src/manager.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgrid_dll_odcombo.o -I./include -DWXMAKINGDLL_PROPGRID -fPIC -DPIC -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./src/odcombo.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgrid_dll_propgrid.o -I./include -DWXMAKINGDLL_PROPGRID -fPIC -DPIC -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./src/propgrid.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgrid_dll_props.o -I./include -DWXMAKINGDLL_PROPGRID -fPIC -DPIC -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./src/props.cpp
    g++ -shared -fPIC -o lib/libwxcode_gtk2u_propgrid-2.8.so.0.0.0 propgrid_dll_advprops.o propgrid_dll_editors.o propgrid_dll_extras.o propgrid_dll_manager.o propgrid_dll_odcombo.o propgrid_dll_propgrid.o propgrid_dll_props.o  -L./lib   -Wl,-soname,libwxcode_gtk2u_propgrid-2.8.so.0   -pthread -Wl,-Bsymbolic-functions  -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_baseu_xml-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu-2.8 
    (cd ./lib/; rm -f libwxcode_gtk2u_propgrid-2.8.so libwxcode_gtk2u_propgrid-2.8.so.0; ln -s libwxcode_gtk2u_propgrid-2.8.so.0.0.0 libwxcode_gtk2u_propgrid-2.8.so.0; ln -s libwxcode_gtk2u_propgrid-2.8.so.0 libwxcode_gtk2u_propgrid-2.8.so)
    /home/darko/propgrid/bk-deps g++ -c -o propgridsample_minimal.o -I./include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./samples/minimal.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgridsample_propgridsample.o -I./include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./samples/propgridsample.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgridsample_sampleprops.o -I./include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./samples/sampleprops.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgridsample_tests.o -I./include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./samples/tests.cpp
    /home/darko/propgrid/bk-deps g++ -c -o propgridsample_xh_propgrid.o -I./include -I/usr/lib/wx/include/gtk2-unicode-release-2.8 -I/usr/include/wx-2.8 -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES -D__WXGTK__ -pthread  -g -O2 -O2 ./src/xh_propgrid.cpp
    g++ -o samples/propgridsample propgridsample_minimal.o propgridsample_propgridsample.o propgridsample_sampleprops.o propgridsample_tests.o propgridsample_xh_propgrid.o  -L./lib  -L./lib  -Wl,-rpath,../lib   -lwxcode_gtk2u_propgrid-2.8 -pthread -Wl,-Bsymbolic-functions  -lwx_gtk2u_xrc-2.8 -lwx_gtk2u_html-2.8 -lwx_gtk2u_adv-2.8 -lwx_baseu_xml-2.8 -lwx_gtk2u_core-2.8 -lwx_baseu-2.8

    make install:

    /usr/bin/install -c -d /usr/local/lib
    /usr/bin/install -c -m 644 ./lib/libwxcode_gtk2u_propgrid-2.8.so /usr/local/lib
    /usr/bin/install -c ./lib/libwxcode_gtk2u_propgrid-2.8.so.0.0.0 /usr/local/lib
    (cd /usr/local/lib ; rm -f libwxcode_gtk2u_propgrid-2.8.so libwxcode_gtk2u_propgrid-2.8.so.0; ln -s libwxcode_gtk2u_propgrid-2.8.so.0.0.0 libwxcode_gtk2u_propgrid-2.8.so.0; ln -s libwxcode_gtk2u_propgrid-2.8.so.0 libwxcode_gtk2u_propgrid-2.8.so)
    /usr/bin/install -c -d /usr/local
    for f in include/wx/propgrid/advprops.h include/wx/propgrid/editors.h include/wx/propgrid/extras.h include/wx/propgrid/manager.h include/wx/propgrid/odcombo.h include/wx/propgrid/pg_dox_mainpage.h include/wx/propgrid/propdev.h include/wx/propgrid/propgrid.h include/wx/propgrid/props.h include/wx/propgrid/xh_propgrid.h; do \
    if test ! -d /usr/local/`dirname $f` ; then \
    /usr/bin/install -c -d /usr/local/`dirname $f`; \
    fi; \
    /usr/bin/install -c -m 644 ./$f /usr/local/$f; \
    done

    any help will be appreciated :) , please try to help me soon , time is critical