Talk:Cygwin

From WxWiki
Jump to: navigation, search

default wxMSW installation

Two things.

1. Can I just download wxMSW and install it?

2. The first cvs command has "-r wxMSW" which is probably wrong.

-mno-cygwin

The -mno-cygwin option doesn't appear to work with configure using this command line:

./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared

like:

./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared -mno-cygwin

Neither does --mno-cygwin work:

./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared --mno-cygwin

The error returned is:

$ ./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared --mno-cygwin configure: error: unrecognized option: --mno-cygwin Try `./configure --help' for more information.

I have the most recent cygwin setup and use it daily for development (flightgear / jsbsim).

[solution] Set '-mno-cygwin' to the environment variables LDFLAGS, CXXFLAGS, and CFLAGS before you run configure.

$ export LDFLAGS='-mno-cygwin'
$ export CFLAGS='-mno-cygwin'
$ export CXXFLAGS='-mno-cygwin'
$ ./configure --with-msw --enable-debug --enable-debug_gdb --disable-shared

After his step, I had to fix "setup.h" to remove the definition of HAVE_LANGINFO_H

$ cd lib/wx/include/msw-ansi-debug-static-2.8/wx
$ emacs setup.h
$ cd ../../../../../
$ make

not working

i get following error:

/home/Fire/wxWidgets/bk-deps g++ -c -o baselib_appbase.o -D__WXMSW__ -I./sr c/tiff -I./src/jpeg -I./src/regex -DwxUSE_GUI=0 -DwxUSE_BASE=1 -D_FILE_OFFSE T_BITS=64 -D_LARGE_FILES -I/home/Fire/wxWidgets/lib/wx/include/msw-unicode-relea se-static-2.8 -I./include -Wall -Wundef -Wno-ctor-dtor-privacy -O2 -fno-strict-a liasing ./src/common/appbase.cpp
In file included from ./include/wx/memory.h:16,

                from ./include/wx/object.h:20,
from ./include/wx/list.h:33,
from ./src/common/appbase.cpp:31:

./include/wx/string.h:181: Fehler: expected init-declarator vor "wxStdString"
./include/wx/string.h:181: Fehler: expected `,' or `;' vor "wxStdString"
./include/wx/string.h:714: Fehler: expected `,' or `...' vor >>&<<-Zeichen
./include/wx/string.h:715: Fehler: ISO-C++ verbietet Deklaration von >>wxStdStri ng<< ohne Typ
./include/wx/string.h:715: Fehler: >>wxString::wxString(int)<< und >>wxString::w xString(int)<< k"onnen nicht "uberladen werden
./include/wx/string.h: In constructor `wxString::wxString(int)':
./include/wx/string.h:715: Fehler: >>s<< nicht deklariert (erste Verwendung dies er Funktion)
./include/wx/string.h:715: Fehler: (Jeder nicht deklarierte Bezeichner wird nur einmal f"ur jede Funktion, in der er vorkommt, gemeldet.)
make: *** [baselib_appbase.o] Fehler 1

using: ./configure --enable-unicode --disable-shared --with-msw --disable-checklst


Compiles. But the example???

After configure you need to do a make (maybe obvious to some but if you're used to MSVC it may not be). I get some warnings but no errors.

The hello world example doesn't compile for me:

 $ g++ -o hword hello_world.cpp  wxWidgets-2.8.9/wx-config --cxxflags --libs --debug=yes
 cc1plus: error: unrecognised debug output level "yes"
 cc1plus: error: unrecognized command line option "-fcxxflags"
 cc1plus: error: unrecognized command line option "-flibs"


You're missing the single quote around the config. However this isn't the end of the story as copy-pasting the g++ command

 $ g++ -o hello hello.cpp '../wxX11-2.8.10/wx-config --cxxflags --libs --debug=yes'
 g++: ../wxX11-2.8.10/wx-config --cxxflags --libs --debug=yes: No such file or directory
 ...

The file really is there:

 $ ls ../wxX11-2.8.10/wx-config
 ../wxX11-2.8.10/wx-config

The following links the example ok (I took the actual arguments used by one of the samples and removed what I could by trial and error):

 g++ -o hello.exe hello.o -L/home/<path to wx>/wxX11-2.8.10/lib -mwindows -lwx_x11univd_core-2.8 \
                          -lwx_based-2.8 -lwxpngd-2.8 -lX11 -lXext -lSM -lwxzlibd-2.8

Unfortunately it won't run. gdb returns 0377. I'm guessing it may be a dll import error (the linker gives a warning about auto import). I've tried using ld instead of gcc for linking but there's a long list of unresolved symbols.

wx 2.9 SVN

Compiling requires editing of cygwin header:

If you get error:

/src/libraries/wx29svn/output_debug

Creating library file: /src/libraries/wx29svn/output_debug/lib/libwx_mswu_core-2.9.dll.a
coredll_msw_graphics.o:graphics.cpp:(.text$_ZN7Gdiplus12StringFormat18GenericTypographicEv[Gdiplus::StringFormat::GenericTypographic()]+0x8): undefined reference to `__GdipStringFormatCachedGenericTypographic'
coredll_msw_graphics.o:graphics.cpp:(.text$_ZN7Gdiplus12StringFormat18GenericTypographicEv[Gdiplus::StringFormat::GenericTypographic()]+0x5c): undefined reference to `__GdipStringFormatCachedGenericTypographic'
coredll_msw_graphics.o:graphics.cpp:(.text$_ZN7Gdiplus12StringFormat18GenericTypographicEv[Gdiplus::StringFormat::GenericTypographic()]+0x61): undefined reference to `__GdipStringFormatCachedGenericTypographic'
collect2: ld returned 1 exit status
make: *** [/src/libraries/wx29svn/output_debug/lib/cygwxmsw292u_core_gcc_custom-2.dll] Error 1
////////////// FIX THIS:
// \cygwin\usr\include\w32api\gdiplus\gdiplusstringformat.h


// line 218-219: comment out the "extern C" directive.

/*extern "C" */void *_GdipStringFormatCachedGenericDefault;
/*extern "C" */void *_GdipStringFormatCachedGenericTypographic;

Then delete defect file and continue buliding wx:

rm coredll_msw_graphics.o
make

-- xawari