Home » Language IDEs » C / C++ IDE (CDT) » Building wxWidgets undefined references
Building wxWidgets undefined references [message #229873] |
Mon, 02 February 2009 11:11  |
Eclipse User |
|
|
|
Originally posted by: jamescobban.sympatico.ca
I cannot figure out what options to set in the Eclipse CDT so I can
build an executable for a wxWidgets project. Following the Eclipse
integration wiki I copied all of the flags from the command line make
but I get the following when I try to build the project:
**** Build of configuration Debug for project Ged2Html ****
make all
Building target: Ged2Html.exe
Invoking: GCC C++ Linker
g++ -L/c/wxWidgets-2.8.9/build-debug/lib -mwindows -lrpcrt4 -loleaut32
-lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32
-lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -lwx_mswd_core-2.8 -lwx_based-2.8
-lwxtiffd-2.8 -lwxjpegd-2.8 -lwxpngd-2.8 -lwxzlibd-2.8 -lwxregexd-2.8
-lwxexpatd-2.8 -mthreads -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool
-lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32
-lgdi32 -o"Ged2Html.exe" ./Address.o ./Attribute.o ./CharNoCase.o
../Child.o ./Date.o ./DateParser.o ./Debug.o ./Dupbuf.o ./Event.o
../Family.o ./File.o ./Ged2Html.o ./Header.o ./Individ.o
../IndividPointer.o ./MainWindow.o ./MultimediaRec.o ./NoSubtags.o
../Note.o ./NoteRec.o ./PersName.o ./Place.o ./RepositoryCitation.o
../RepositoryRec.o ./Root.o ./SourceCit.o ./SourceCitData.o ./SourceRec.o
../String.o ./SubmissionRec.o ./SubmitterRec.o ./Syntax.o ./Tag.o
../Text.o ./Unexpected.o ./printable.o
../Ged2Html.o: In function `WinMain@16':
C:\Documents and Settings\Jim Cobban\My Documents\My
Programs\EclipseWorkspace\Ged2Html\Debug/../Ged2Html.cpp:30: undefined
reference to `wxEntry(HINSTANCE__*, HINSTANCE__*, char*, int)'
../Ged2Html.o: In function `Z11wxCreateAppv':
C:\Documents and Settings\Jim Cobban\My Documents\My
Programs\EclipseWorkspace\Ged2Html\Debug/../Ged2Html.cpp:30: undefined
reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'
../Ged2Html.o:C:/wxWidgets-2.8.9/include/wx/app.h:279: undefined
reference to `wxAppConsole::ms_appInitFn'
../Ged2Html.o:C:/wxWidgets-2.8.9/include/wx/app.h:287: undefined
reference to `wxAppConsole::ms_appInstance'
../Ged2Html.o: In function `~wxThreadHelperThread':
C:/wxWidgets-2.8.9/include/wx/thread.h:594: undefined reference to
`wxThread::~wxThread()'
C:/wxWidgets-2.8.9/include/wx/thread.h:594: undefined reference to
`wxThread::~wxThread()'
../Ged2Html.o: In function `~GenApp':
C:\Documents and Settings\Jim Cobban\My Documents\My
Programs\EclipseWorkspace\Ged2Html\Debug/../GenApp.h:13: undefined
reference to `wxApp::~wxApp()'
C:\Documents and Settings\Jim Cobban\My Documents\My
Programs\EclipseWorkspace\Ged2Html\Debug/../GenApp.h:13: undefined
reference to `wxApp::~wxApp()'
../Ged2Html.o: In function `wxStringBase':
C:/wxWidgets-2.8.9/include/wx/string.h:368: undefined reference to
`wxStringBase::npos'
C:/wxWidgets-2.8.9/include/wx/string.h:368: undefined reference to
`wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
../Ged2Html.o: In function `GenApp':
C:\Documents and Settings\Jim Cobban\My Documents\My
Programs\EclipseWorkspace\Ged2Html\Debug/../GenApp.h:13: undefined
reference to `wxApp::wxApp()'
../Ged2Html.o:Ged2Html.cpp:(.rdata$_ZTV6GenApp[vtable for GenApp]+0x8):
undefined reference to `wxApp::GetClassInfo() const'
../Ged2Html.o:Ged2Html.cpp:(.rdata$_ZTV6GenApp[vtable for GenApp]+0x14):
undefined reference to `wxObject::CreateRefData() const'
|
|
| | | | |
Re: Building wxWidgets undefined references [message #229960 is a reply to message #229945] |
Wed, 04 February 2009 03:31   |
Eclipse User |
|
|
|
James Cobban schrieb:
> I followed these instructions as closely as I could considering that I
> already have wxWidgets installed according to the procedure described in
> C:\wxWidgets-2.8.9\docs\msw\install.txt, which is not the procedure
> described in the referenced wiki.
Ok, change that ;)
> I do not understand what I am doing, because I am blindly following the
> advice in the various wikis and guides, without understanding why I am
> being asked to issue the various incantations. As a result I have no
> knowledge upon which to intelligently adjust the actions that I am taking.
But you are willing to learn.
> For example at one point in the instructions I am asked to issue the
> incantation:
>
> mv /mingw/lib/wx*.dll /mingw/bin/
>
> However there are no wx*.dll files in /mingw/lib.
So it seems that you compiled wxWidgets static.
> I have clearly done something wrong, but I am mystified as to how to
> determine what.
Hmm...
First you need the MinGW and MSYS /bin directories in the path
environment variable.
And you must tell MSYS where your MinGW installation resides.
To "Building and configuring wxWidgets"
"./configure --prefix=/mingw --enable-shared"
with this line a makefile is created, which will copy all builded files
to /mingw/bin, /mingw/lib etc. after "make install". If you change to
"--prefix=/xyz" make install will copy all files to /xyz/bin, /xyz/lib
etc.. "--enable-shared" will configure the makefile to build shared
libraries (in windows: *.dll).
This step: "mv /mingw/lib/wx*.dll /mingw/bin/"
is a quick trick ;)
If you compile a program which uses "wxwidgets shared" then you need the
necessary .dlls- so you could copy them in the path where your compiled
program will be started or you can put the .dll- directory also in your
windows path environment variable. Here the .dlls are moved to a
location which is already mentioned in the windows path environment
variable.
What should be mentioned- the makefile also prepares a script named
"wx-config", which can set up all necessary include dirs etc. (this is
clearly dependent on your --prefix option!)- this script is very
comfortable and should be used.
In eclipse the line:
"g++ `wx-config --static=no --cxxflags`"
starts the wx-config script within g++ (therefore the backticks are
used- and it _must_ be done with backticks) -> that cannot be done by
the windows shell, so you need MSYS. To tell eclipse that it has to use
MSYS you have to use the "Linux toolchain".
If you get linking errors then check all configuration lines in eclipse
that contain these backticks (eclipse is sometimes oblivious) also
check if the order of the linker command line pattern (${COMMAND}
${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT} ${INPUTS} ${FLAGS}) is right.
You should really use the mentioned guide step by step and then ask again!
HTH,
Heiko
|
|
|
Re: Building wxWidgets undefined references [message #230019 is a reply to message #229960] |
Wed, 04 February 2009 22:33   |
Eclipse User |
|
|
|
Originally posted by: jamescobban.sympatico.ca
Heiko Lechner wrote:
> James Cobban schrieb:
>
>
> You should really use the mentioned guide step by step and then ask again!
>
Thank you for your patience.
I have tried going back and rebuilding wxWidgets from scratch into the
recommended target and the build fails:
/c/MinGW/wxWidgets-2.8.9/bk-deps g++ -c -o richtextdll_richtextbuffer.o
-I.pch/wxprec_richtextdll -D__WXMSW__ -I./src/tiff -I./src/jpeg
-I./src/png -I./src/zlib -I./src/regex -I./src/expat/lib -DWXUSINGDLL
-DWXMAKINGDLL_RICHTEXT
-I/c/MinGW/wxWidgets-2.8.9/lib/wx/include/msw-ansi-release-2 .8
-I./include -DWX_PRECOMP -mthreads -Wall -Wundef -Wno-ctor-dtor-privacy
-O2 -fno-strict-aliasing ./src/richtext/richtextbuffer.cpp
0 [main] sh 5924 open_stackdumpfile: Dumping stack trace to
sh.exe.stackdump
0 [main] sh 5688 open_stackdumpfile: Dumping stack trace to
sh.exe.stackdump
sh.exe.stackdump contains:
MSYS-1.0.10 Build:2004-03-15 07:17
Exception: STATUS_ACCESS_VIOLATION at eip=71070C43
eax=7FFDF000 ebx=00000000 ecx=00000000 edx=0022F2B8 esi=00000000
edi=0022F0D8
ebp=0022EC7C esp=0022EC58 program=C:\msys\1.0\bin\sh.exe
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame Function Args
0022EC7C 71070C43 (00000000, 0000001C, 000006DC, 00000000)
0022F138 7102AC7D (0022F2B8, 0022F2BC, 0022F2C0, 0022F160)
0022F2C8 7102B532 (0A0185C8, FFFFFFFF, 0A014E2E, 0040D5FC)
0022F2F8 0041BDFE (0A0150F8, 00000000, 0022F378, 004114C5)
0022F378 004114D5 (0A0185C8, FFFFFFFF, 00000004, 00000000)
0022F3D8 0040E9C6 (0A0185B0, 00000000, FFFFFFFF, 00000004)
0022F438 0040F8B8 (0A0186E0, 00000000, FFFFFFFF, FFFFFFFF)
0022F488 0040FBC4 (0A0186E0, 00000000, FFFFFFFF, FFFFFFFF)
0022F4E8 0040EBE2 (0A0186E0, 00000000, FFFFFFFF, FFFFFFFF)
0022F538 004499BB (0A018250, 00422DC6, 00000004, 00000000)
0022F594 0042313C (0A018250, 00000000, 0022F734, 00426AFD)
0022F734 00426FDD (0022F77C, 00000000, 00000000, 00000000)
0022F784 00428D6A (0A018338, 00000000, 00000000, 0022F7F4)
0022F7B4 00421631 (0A018338, 00000000, 00428D24, 0040D511)
0022F7F4 0042112E (0A0182C8, 00000001, 0022F854, 004489EA)
0022F834 004286C3 (0A015F28, 0000001F, 0A015E98, 0042C063)
End of stack trace (more stack frames may be present)
|
|
| | |
Re: Building wxWidgets undefined references [message #230139 is a reply to message #230065] |
Fri, 06 February 2009 02:42  |
Eclipse User |
|
|
|
James Cobban schrieb:
> I believe I have identified a problem in the wiki
> http://wiki.wxwidgets.org/Eclipse%2C_CDT_%26_MingW_%26_MSYS_ Setup_Guide
>
> """"""""quote"""""""""""
> * move the contained folder wxWidgets-2.8.7 to "C:\MinGW" (so that
> it becomes C:\MinGW\wxWidgets-2.8.7)
> * execute "C:\msys\1.0\msys.bat" (or use the MSYS shortcut on your
> desktop)
>
> In the command prompt window that opens
>
> * type (& confirm each line with Enter)
>
> cd /mingw/wxWidgets-2.8.7
> ./configure --prefix=/mingw --enable-shared
>
> """"""""""end quote"""""""""""""
>
> The problem that I observe is that C:\MinGW\wxWidgets-2.8.9 (under
> Windows) and /MinGW/wxWidgets-2.8.9 (under msys) are not the same
> directory! Consistently using the Windows filesystem terminology they are:
>
> C:\MinGW\wxWidgets-2.8.9 and C:\msys\1.0\MinGW\wxWidgets-2.8.9
MSYS "mounts" the original MinGW directory to "/mingw".
So if you have installed MinGW to C:\XYZ\ABC\MinGW and told MSYS where
you installed MinGW then it will be "/mingw" (under MSYS) anyway.
> As a result the either cd command fails, and if you change that command to:
> cd /c/MinGW/wxWidgets-2.8.9
> then you also have to change the configure command to:
> ./configure -- prefix=/c/MinGW --enable-shared
If "cd /mingw/bin" fails under MSYS or there are no files in it then you
made a mistake "installing" MSYS- rerun "\MSYS\postinstall\pi.bat" under
windows.
HTH,
Heiko.
|
|
|
Goto Forum:
Current Time: Thu May 08 19:04:13 EDT 2025
Powered by FUDForum. Page generated in 0.04635 seconds
|