I've managed to successfully build wxwidgets 2.8.7 libraries under
cygwin, and if I move to the samples folder, and do
$ g++ minimal.cpp `wx-config --libs` `wx-config --cxxflags` -o minimal.exe
everything works perfectly fine - I get a message
Info: resolving ___timezone by linking to __imp___timezone (auto-import)
and that's it. I get the minimal.exe which runs as intended.
$ make -f makefile.unx BUILD=release RUNTIME_LIBS=statis
also works fine. Really does. However, when I try to compile with
Eclipse, I get the same error messages that I would get using the
makefile.gcc (see below) - and I seriously don't know what is wrong here.
Can someone tell me what compiler options to give eclipse for this? Or
do I need to build wxwidgets with Eclipse in order to use it? I managed
to integrate other stuff compiled with cygwin just fine (XercesC).
Any help appreciated!
Lars
Eclipse problems:
**** Build of configuration Debug for project minimal ****
make -k all
Building file: ../minimal.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"minimal.d"
-MT"minimal.d" -o"minimal.o" "../minimal.cpp"
In file included from /usr/local/include/wx/platform.h:279,
from /usr/local/include/wx/defs.h:21,
from /usr/local/include/wx/wxprec.h:13,
from ../minimal.cpp:21:
/usr/local/include/wx/chkconf.h:103:9: #error "wxUSE_DYNLIB_CLASS must
be defined."
/usr/local/include/wx/chkconf.h:111:9: #error "wxUSE_EXCEPTIONS must be
defined."
/usr/local/include/wx/chkconf.h:119:9: #error "wxUSE_FILESYSTEM must be
defined."
/usr/local/include/wx/chkconf.h:127:9: #error "wxUSE_FS_ARCHIVE must be
defined."
/usr/local/include/wx/chkconf.h:140:9: #error "wxUSE_DYNAMIC_LOADER must
be defined."
/usr/local/include/wx/chkconf.h:148:9: #error "wxUSE_LOG must be defined."
/usr/local/include/wx/chkconf.h:156:9: #error "wxUSE_LONGLONG must be
defined."
/usr/local/include/wx/chkconf.h:164:9: #error "wxUSE_MIMETYPE must be
defined."
/usr/local/include/wx/chkconf.h:172:9: #error "wxUSE_ON_FATAL_EXCEPTION
must be defined."
/usr/local/include/wx/chkconf.h:180:9: #error "wxUSE_PRINTF_POS_PARAMS
must be defined."
/usr/local/include/wx/chkconf.h:188:9: #error "wxUSE_PROTOCOL must be
defined."
*** snipped for the sake of brevity ***
Anyways - the wxwiki entry on setup.h doesn't seem helpful either, other
than making me believe it IS source of the problem somehow.
Just wanted to add this in case it helps anyone helping me...
Best Regards,
Lars
Solved first part of the problem by:
In eclipse:
Project->Properties->C/C++ Build->Environment->Configuration
--> New Environment Variable:
Name PATH
Operation APPEND
Value C:\cygwin\usr\local\bin
Project->Properties->C/C++ Build->Tool Settings->GCC C++ Compiler
--> Command: g++ `wx-config --cxxflags`
this last change wasn't working without the environment variable being
set to the wx-config bin dir (makes sense if you think about it).
Now the compiler runs fine. However, something is missing.
When the linker is invoked with
g++ `wx-config --libs` -L"C:\cygwin\usr\local\lib" -o"minimal.exe"
./minimal.o
I get bunch of undefined references, just as if I had forgotten to link
a certain library. So what's the general library name for the g++ -l
option for wxwidgets?
I think that should be all I need to get this running...
Best Regards & Thanks,
Lars
In addition to the above settings, the linker ORDER was wrong. The
output file from the compiler needs to be given as a g++ command line
argument before the `wx-config --libs` flag:
Project->Properties->C/C++ Build->Tool Settings->GCC C++ Linker
--> Command Line Pattern: move ${FLAGS} _behind_ ${INPUTS} - or vice
versa. Example: ${COMMAND} ${OUTPUT_FLAG}${OUTPUT_PREFIX}${OUTPUT}
${INPUTS} ${FLAGS}
Then
Project->Properties->C/C++ Build->Tool Settings->GCC C++
Linker->Miscellaneous
--> Linker flags: add `wx-config --libs`
This worked for me, sorry for the "spam" - writing down the issue at
hand helped me solving it myself. HTH someone else as well ;)
Best Regards,
Lars
-Guru Kathiresan
Cross platform Form Designer for C++ Builder http://www.twinforms.com/
> -----Original Message-----
> From: Lars Uffmann [mailto:ar...@nurfuerspam.de]
> Sent: Thursday, January 24, 2008 7:36 AM
> To: wx-u...@lists.wxwidgets.org
> Subject: Integrating wxWidgets in Eclipse
>
>
> Hi everyone!
>
> I've managed to successfully build wxwidgets 2.8.7 libraries under
---------------------------------------------------------------------
To unsubscribe, e-mail: wx-users-u...@lists.wxwidgets.org
For additional commands, e-mail: wx-use...@lists.wxwidgets.org
Thank you for that link - I'm impressed - that's how tutorials should
always be - and considering it's only Desktop frames, the looong and
extensive tutorial has this awesomely small filesize.
The only downside to this one being that the creator chose a Kyrillic
Windows Installation ^^
Also good for a sneak peek at Code::Blocks and Visual Studio, in my
case. However, his version of the Eclipse Setup seems much more
complicated than mine was - and he's doing it for MinGW, while I did it
for Cygwin.
What I'm not sure about - I was still "tuning" my settings - right now,
the static linkage causes my executable to be ~22MB for a Hello-World
application - seems a bit much overhead for a mainframe, a menubar, an
about window and some buttons... His executable was only 2-3MB - I'd
like to know if that was because he's including libraries dynamically,
or if he managed to only link the stuff that's actually needed with his
settings... In case you happen to know this, I'd appreciate a comment.
But I'll post a different thread for the linkage.
Best Regards,
Lars
LU> Hmm... this seems to be related to setup.h - Building wxwidgets put a
LU> setup.h in my
LU> /usr/local/lib/wx/include/msw-ansi-debug-static-2.8/wx/
LU> folder. Why on earth ever.
To allow using different setup.h for different builds.
LU> And it didn't copy the setup.h to /usr/local/include/wx - Copying it
LU> there manually just doesn't solve the problem.
But it would create many new and strange ones. Please don't do it.
Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Thanks, I solved the problem earlier - I didn't have a path to wx-config
set, that's all.
Best Regards,
Lars