Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / using cygwin, how?

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. using cygwin, how?
#3407
Posted by: laura_glow 2004-02-25 05:33:07 Last edited by: laura_glow 2007-12-05 15:06:53 (Total edited 1 time)
Hi

Im trying to compile minimal.cpp but: i dont want to use MingW, I want to use cygwin. im a newbie with dev-c++ and wxWidgets (wxWindows) i would need clear step by step instructions on how to configure everything to work.

I have Dev-c++ 4.9.8.0 and i have installed wxWindows Devpak, i compiled and run minimal.cpp succesfully with mingW, i cant manage to do the same changing compiler.


here is what i have:

Compiler: cygwin
Building Makefile: "C:Dev-CppprojectscygwintestMakefile.win"
Executing  make clean
rm -f main.o Project1_private.res Project1.exe
g++.exe -c main.cpp -o main.o -I"C:/Dev-Cpp/include/c++"  -I"C:/Dev-Cpp/include/c++/backward"  -I"C:/Dev-Cpp/include"  -I"C:/00work/prj/common/contrib/wxWindows-2.4.0/include" -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -D__WIN32__ -DHAVE_W32API_H  -D__WXMSW__ -D__WINDOWS__ -Wall -fno-pcc-struct-return -O2 -Os -fno-rtti -fno-exceptions 
windres.exe -i Project1_private.rc -I rc -o Project1_private.res -O coff
Option -I is deprecated for setting the input format, please use -J instead.
g++.exe main.o Project1_private.res -o "Project1.exe" -L"C:/wxWindows-2.4.2/lib" -L"C:/cygwin/lib" -L"C:/Dev-Cpp/lib" -L"C:/cygwin/lib/gcc-lib/i686-pc-cygwin/3.3.1" -L"C:/cygwin/lib/w32api" -mwindows -Wl,--subsystem,windows -mwindows -lwxmsw -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid  
C:/Dev-Cpp/lib/libwxmsw.a(mdi.o)(.data$_ZTV14wxMenuItemList+0x0):mdi.cpp: multiple definition of `vtable for wxMenuItemList'
main.o(.rdata$_ZTV14wxMenuItemList+0x0):main.cpp: first defined here
/usr/lib/gcc-lib/i686-pc-cygwin/3.3.1/../../../../i686-pc-cygwin/bin/ld: warning: cannot find entry symbol _WinMainCRTStartup; defaulting to 00401000
C:/Dev-Cpp/lib/libwxmsw.a(string.o)(.text+0xd5e):string.cpp: undefined reference to `__isctype'
C:/Dev-Cpp/lib/libwxmsw.a(string.o)(.text+0xd7d):string.cpp: undefined reference to `__imp___pctype'
C:/Dev-Cpp/lib/libwxmsw.a(string.o)(.text+0xdd1):string.cpp: undefined reference to `__isctype'
C:/Dev-Cpp/lib/libwxmsw.a(string.o)(.text+0xdf2):string.cpp: undefined reference to `__imp___pctype'
C:/Dev-Cpp/lib/libwxmsw.a(string.o)(.text+0xf1c):string.cpp: undefined reference to `__isctype'

[...]
etc etc...

I would need instructions on how to configure everything under tools->compiler options and environment variables, etc...

help me please... thanks...
Message2. Re: using cygwin, how?
#3408
Posted by: 2004-02-25 09:08:50
I have been using wxWindows 2.4.2 with cygwin 1.5.5 (both win2k and xp), gcc 3.X compiler.  I have no compilation problem so far.
What I did was just followed the installation instruction:

set WXWIN environment variable, pointing to your wxwindows directory.
(for me, it's c:cygwinuserlocalwxwindows),
then, on cygwin shell,

  cd $WXWIN
  mkdir build-debug
  cd build-debug
  ../configure --with-msw --enable-debug --enable-debug_gdb --disable-shared
  make
  make install
  cd samples/minimal
  make
  ./minimal.exe

That's all I did.   Good luck!
Message3. Re: using cygwin, how?
#3409
Posted by: upCASE 2004-02-25 23:02:41
Hi!
You can't use the devpacks with cygwin since they where compiled using mingw.
Since cygwin uses an unix like emulation layer, compilation an installation should be as easy as lok described it.

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message4. Re: using cygwin, how?
#3412
Posted by: laura_glow 2004-02-26 05:13:39 Last edited by: laura_glow 2007-12-05 15:07:33 (Total edited 1 time)
this is great! it worked really fine, i had no idea of that "configure" command and everything else. I still cant achieve same results from within Dev-c++, i have no idea of how to configure the project, or the compiler options. is there any working project (sample) of this kind available anywhere?

I tried the following:

Run Dev-Cpp.
Open a wxWindows project, and open the project options dialog.
On the Parameters tab, enter the following for your c++ compiler options. ( -D__WXDEBUG__ -D__WXMSW__ -g -O0 -mthreads -Wall )
On the Parameters tab, enter the following for your linker options. ( -mthreads -Wl,--subsystem,windows -mwindows -lwx_mswd-2.5 -lwxjpegd -lwxpngd -lwxzlibd -mthreads -lrpcrt4 -loleaut32 -lole32 -luuid -lwinspool -lwinmm -lshell32 -lcomctl32 -lcomdlg32 -lctl3d32 -ladvapi32 -lwsock32 -lgdi32 -ltiff ) Note the library lwx_mswd-2.5. That will likely change depending on how your configure your build, and which version you are building, so just find it in the build lib folder, and grab the right name. ( libwx_mswd-2.5.a --> lwx_msw-2.5 )
On the DirectoriesLibrary tab, enter the lib directory for your special build. ( mine is C:wxmsw-debuglib )
On the DirectoriesInclude tab, enter at least the following, per your own build :
( C:wxmsw-debuglibwxincludemswd-2.5 )
( C:wxinclude ) Note this is the MAIN include for your distribution, and not your special build.

(all this at: http://wiki.wxwindows.org/wiki.pl?Dev-CPP_Setup_Guide)

but im getting errors about wxjpegd not foud, wxpngd not found, etc.

thanks!! =)
Message5. Re: using cygwin, how?
#3415
Posted by: upCASE 2004-02-26 15:01:24
Hi!
What version of wxWidgets are you using? Version 2.4.2 is slightly different from 2.5.1. Maybe you'll have to compile the image libs separate.

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message6. Re: using cygwin, how?
#3419
Posted by: laura_glow 2004-02-26 22:13:40
yes, im using 2.4.2
i'd like to know the "configure" options available
i'd like to know the compiler options available
i'd like to know the linker options available

and its meanings.

I dont understand what "configure" and "make" did to my wxWidgets installation in that new folder "build-debug".

i'd like to create a "mybuild" directory and try different options.
I cant find any clear documentation at all.

its all very confusing for a non unix user.
Message7. Re: using cygwin, how?
#3420
Posted by: upCASE 2004-02-27 00:52:19
Hi!
If you downloaded the source release of wxWidgets, you should have a file called install.txt somewhere in the doc dir. It explains how to compile the lib and mentions some of the options for configure.
You can also do a "./configure --help" to see the options available.
Basically "configure" is a script that will check your system, the available compiler, linker and libs, and then generate a makefile for the wxWidgets library depending on your system and the options you used.
"make" is a tool that reads a makefile (e.g. generated by configure) and does the actual compile process. A typical makefile consist of some variables (compiler name, paths, etc.), rules and targets. Normally you use "make" like this:
make
or
make [specific target]
or
make -f [custom makefile]

A normal compile cycle for a lib would be
configure
make
make install

About the compiler/linker options I can only say: Go to gcc.gnu.org and read the manuals for them. I'd say there are about 250 options...
The linker and compiler options you need for wxWidgets can be found on the website. Since cygwin emulates a Unix layer, I'm pretty sure you could also use "wx-config" from the prompt. wx-config "knows" about the options. Try wx-config --CXXFLAGS or such and copy them to the IDE you use.

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message8. Re: using cygwin, how?
#3421
Posted by: upCASE 2004-02-27 00:53:47
Oh, I almost forgot:
You don't really have to use configure. You can use the makefiles for mingw if you like. Look at my site
http://upcase.malteser-gl.de
and you'll find a tutorial about that topic.

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message9. Re: using cygwin, how?
#3422
Posted by: laura_glow 2004-02-27 01:30:04 Last edited by: laura_glow 2007-12-05 15:08:22 (Total edited 1 time)
thanks a lot, I FINALLY run minimal.exe from Dev-c++ using only cygwin, I'll write a step by step tutorial soon, with my findings =P

cheers
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0