Talk:Questions and Answers

From WxWiki
Jump to navigation Jump to search

Was unable to build on Cygwin. Please have patience newb to wxWidgets and Cygwin.

created build-debug directory and navigated to it.

$ ../configure --enable-debug

Causes lots of output can attach a file if desired. Near the end:

 Installation directory:             /usr/local
 Documentation directory:            ${prefix}/share/doc/tiff-4.0.3
 C compiler:                         gcc -g -O2 -Wall -W
 C++ compiler:                       g++ -g -O2
 Enable runtime linker paths:        no
 Enable linker symbol versioning:    no
 Support Microsoft Document Imaging: yes
 Use win32 IO:                       no
Support for internal codecs:
 CCITT Group 3 & 4 algorithms:       yes
 Macintosh PackBits algorithm:       yes
 LZW algorithm:                      yes
 ThunderScan 4-bit RLE algorithm:    yes
 NeXT 2-bit RLE algorithm:           yes
 LogLuv high dynamic range encoding: yes
Support for external codecs:
 ZLIB support:                       yes
 Pixar log-format algorithm:         yes
 JPEG support:                       yes
 Old JPEG support:                   yes
 JPEG 8/12 bit dual mode:            no
 ISO JBIG support:                   no
 LZMA2 support:                      no
 C++ support:                        yes
 OpenGL support:                     no


Configured wxWidgets 3.0.4 for `x86_64-unknown-cygwin'

 Which GUI toolkit should wxWidgets use?                 msw
 Should wxWidgets be compiled into single library?       no
 Should wxWidgets be linked as a shared library?         yes
 Should wxWidgets support Unicode?                       yes (using wchar_t)
 What level of wxWidgets compatibility should be enabled?
                                      wxWidgets 2.6      no
                                      wxWidgets 2.8      yes
 Which libraries should wxWidgets use?
                                      STL                no
                                      jpeg               sys
                                      png                sys
                                      regex              builtin
                                      tiff               builtin
                                      zlib               sys
                                      expat              sys
                                      libmspack          no
                                      sdl                no

When I run make

make

/home/jjacobs/WxWidgets/wxWidgets-3.0.4/build-debug/bk-deps gcc -c -o wxregex_regcomp.o -DNDEBUG -D__WXMSW__ -D_FILE_OFFSET_BITS=64 -I/home/jjacobs/WxWidgets/wxWidgets-3.0.4/build-debug/lib/wx/include/msw-unicode-3.0 -I../include -Wall -Wundef -g -O0 ../src/regex/regcomp.c In file included from ../include/wx/chkconf.h:1222,

                from ../include/wx/platform.h:596,
                from ../include/wx/defs.h:27,
                from ../src/regex/regcustom.h:39,
                from ../src/regex/regguts.h:38,
                from ../src/regex/regcomp.c:33:

../include/wx/msw/chkconf.h:414:13: error: #error "wxMediaCtl requires wxActiveXContainer"

 414 | #           error "wxMediaCtl requires wxActiveXContainer"
     |             ^JeffreyHJacobs (talk) 13:56, 15 April 2020 (MDT)

../include/wx/msw/chkconf.h:420:9: warning: "wxUSE_WEB" is not defined, evaluates to 0 [-Wundef]

 420 | #    if wxUSE_WEB
     |         ^13:56, 15 April 2020 (MDT)JeffreyHJacobs (talk)

../include/wx/msw/chkconf.h:443:9: warning: "wxUSE_WEB" is not defined, evaluates to 0 [-Wundef]

 443 | #    if wxUSE_WEB
     |         ^13:56, 15 April 2020 (MDT)JeffreyHJacobs (talk)

make: *** [Makefile:16230: wxregex_regcomp.o] Error 1

uname -a in cygwin shell shows: CYGWIN_NT-10.0 ENGWSL201908-16 3.1.4(0.340/5/3) 2020-02-19 08:49 x86_64 Cygwin

Any and all help greatly appreciated.

Cygwin Eclipse linker error undefined symbol `wxString::ConvertStr

Using Eclipse and the MinGW tool chain I get the error: undefined symbol `wxString::ConvertStr(char const*, unsigned long, wxMBConv const&)'

This is a really simple project which should just show a window.

Source code is:

/*

* Main.h
*
*  Created on: Apr 16, 2020
*      Author: jjacobs
*/

#ifndef MAIN_H_

#define MAIN_H_

#include <wx/wx.h>

class Main : wxFrame {

  public:
Main();
~Main();

};
#endif /* MAIN_H_ */

/*

* Main.cpp
*
*  Created on: Apr 16, 2020
*      Author: jjacobs
*/

#include "Main.h"
Main::Main() : wxFrame(nullptr, wxID_ANY, "First WxWidgets App") {}
Main::~Main() {}

/*

* FirstApp.h
*
*  Created on: Apr 16, 2020
*      Author: jjacobs
*/

#ifndef FIRSTAPP_H_

#define FIRSTAPP_H_

#include <wx/wx.h>

class FirstApp : public wxApp

{

  public:
FirstApp();
~FirstApp();
bool OnInit();

};

#endif /* FIRSTAPP_H_ */

/*

* FirstApp.cpp
*
*  Created on: Apr 16, 2020
*      Author: jjacobs
*/

#include "FirstApp.h"

wxIMPLEMENT_APP(FirstApp);
FirstApp::FirstApp() {}

FirstApp::~FirstApp() {}

bool FirstApp::OnInit() { return true; }


Error in the console window:
/usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: Src\Main.o:Main.cpp:(.text+0x85): undefined reference to `wxString::ConvertStr(char const*, unsigned long, wxMBConv const&)' Src\Main.o:Main.cpp:(.text+0x85): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `wxString::ConvertStr(char const*, unsigned long, wxMBConv const&)' /usr/lib/gcc/x86_64-pc-cygwin/9.3.0/../../../../x86_64-pc-cygwin/bin/ld: Src\Main.o:Main.cpp:(.text+0x131): undefined reference to `wxString::ConvertStr(char const*, unsigned long, wxMBConv const&)' Src\Main.o:Main.cpp:(.text+0x131): relocation truncated to fit: R_X86_64_PC32 against undefined symbol `wxString::ConvertStr(char const*, unsigned long, wxMBConv const&)' collect2: error: ld returned 1 exit status


Successfully building the object files.
Command line for compilation:
g++ -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ "-IC:\\cygwin64\\usr\\x86_64-w64-mingw32\\sys-root\\mingw\\lib\\wx\\include\\x86_64-w64-mingw32-msw-unicode-3.0" "-IC:\\cygwin64\\usr\\x86_64-w64-mingw32\\sys-root\\mingw\\include\\wx-3.0" -O3 -Wall -c -fmessage-length=0 -o "Src\\FirstApp.o" "..\\Src\\FirstApp.cpp"
g++ -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ "-IC:\\cygwin64\\usr\\x86_64-w64-mingw32\\sys-root\\mingw\\lib\\wx\\include\\x86_64-w64-mingw32-msw-unicode-3.0" "-IC:\\cygwin64\\usr\\x86_64-w64-mingw32\\sys-root\\mingw\\include\\wx-3.0" -O3 -Wall -c -fmessage-length=0 -o "Src\\Main.o" "..\\Src\\Main.cpp"

Command line for link:
g++ -o FirstWxWidgets.exe "Src\\FirstApp.o" "Src\\Main.o" -lwx_mswu_xrc-3.0-x86_64-w64-mingw32 -lwx_mswu_webview-3.0-x86_64-w64-mingw32 -lwx_mswu_html-3.0-x86_64-w64-mingw32 -lwx_mswu_qa-3.0-x86_ 64-w64-mingw32 -lwx_mswu_adv-3.0-x86_64-w64-mingw32 -lwx_mswu_core-3.0-x86_64-w64-mingw32 -lwx_baseu_xml-3.0-x86_64-w64-mingw32 -lwx_baseu_net-3.0-x86_64-w64-mingw32 -lwx_baseu-3.0-x86_64-w64-mingw32 "-LC:\\cygwin64\\usr\\x86_64-w64-mingw32\\sys-root\\mingw\\lib" -Wl,--subsystem,windows -mwindows


I seem to be missing a chapter. Any and all help greatly appreciated.

I solved this myself the trick was to use x86_64-w64-mingw32-g++.exe in the "GCC C++ Compiler Command:" and also in the "MinGW C++ Linker Command:" inside of C/C++ Build Settings in Eclipse.