Guidance
指路人
g.yi.org
Guidance Forums / wxWidgets (wxWindows) in C++ / Error trying to make Dev c++ with WxWidgets working

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

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Error trying to make Dev c++ with WxWidgets working
#3460
Posted by: nessuno28 2004-03-05 21:53:25
Hi to everyone.

I am new to the WxWindows and Dev c++ world. I am trying to make them work together but It's not working.

I installed the Dev C++ 4.9.8.0 and I upgraded it  to the 4.9.8.7
I made up a simple program and I checked that everything was working. After that I installed the wx dev pack, the image pack and the contribs pack.

After this I created a project and I imported the file calendar.cpp of the WxWindows Samples.

I tryed to build it but I got several errors:




Compiler: Default compiler
Building Makefile: "C:wxWindows-2.4.2proveProva2Makefile.win"
Executing  make clean
rm -f ../../samples/calendar/calendar.o  Prova2.exe

g++.exe -c ../../samples/calendar/calendar.cpp -o ../../samples/calendar/calendar.o -I"C:/Dev-Cpp/include/c++"  -I"C:/Dev-Cpp/include/c++/mingw32"  -I"C:/Dev-Cpp/include/c++/backward"  -I"C:/Dev-Cpp/include"  -I"C:/wxWindows-2.4.2/include"    -ansi

In file included from C:/Dev-Cpp/include/wx/wxprec.h:13,
                 from ../../samples/calendar/calendar.cpp:26:
C:/Dev-Cpp/include/wx/defs.h:179: redeclaration of C++ built-in type `bool'

In file included from C:/Dev-Cpp/include/wx/string.h:62,
                 from C:/Dev-Cpp/include/wx/memory.h:20,
                 from C:/Dev-Cpp/include/wx/object.h:25,
                 from C:/Dev-Cpp/include/wx/event.h:20,
                 from C:/Dev-Cpp/include/wx/app.h:24,
                 from ../../samples/calendar/calendar.cpp:34:
C:/Dev-Cpp/include/wx/buffer.h: In constructor
   `wxCharBuffer::wxCharBuffer(const char*)':
C:/Dev-Cpp/include/wx/buffer.h:100: `strdup' undeclared (first use this
   function)

C:/Dev-Cpp/include/wx/buffer.h:100: (Each undeclared identifier is reported
   only once for each function it appears in.)

In file included from C:/Dev-Cpp/include/wx/memory.h:20,
                 from C:/Dev-Cpp/include/wx/object.h:25,
                 from C:/Dev-Cpp/include/wx/event.h:20,
                 from C:/Dev-Cpp/include/wx/app.h:24,
                 from ../../samples/calendar/calendar.cpp:34:
C:/Dev-Cpp/include/wx/string.h:160:4: #error "Please define string case-insensitive compare for your OS/compiler"
In file included from C:/Dev-Cpp/include/wx/memory.h:20,

                 from C:/Dev-Cpp/include/wx/object.h:25,
                 from C:/Dev-Cpp/include/wx/event.h:20,
                 from C:/Dev-Cpp/include/wx/app.h:24,
                 from ../../samples/calendar/calendar.cpp:34:
C:/Dev-Cpp/include/wx/string.h: In member function `int
   wxString::CmpNoCase(const wxChar*) const':
C:/Dev-Cpp/include/wx/string.h:640: `_stricmp' undeclared (first use this
   function)

In file included from C:/Dev-Cpp/include/wx/gdicmn.h:24,
                 from C:/Dev-Cpp/include/wx/event.h:24,
                 from C:/Dev-Cpp/include/wx/app.h:24,
                 from ../../samples/calendar/calendar.cpp:34:
C:/Dev-Cpp/include/wx/list.h: In constructor `wxListKey::wxListKey(const
   wxChar*)':
C:/Dev-Cpp/include/wx/list.h:100: `_strdup' undeclared (first use this
   function)

In file included from C:/Dev-Cpp/include/wx/utils.h:25,
                 from C:/Dev-Cpp/include/wx/cursor.h:22,
                 from C:/Dev-Cpp/include/wx/event.h:25,
                 from C:/Dev-Cpp/include/wx/app.h:24,
                 from ../../samples/calendar/calendar.cpp:34:
C:/Dev-Cpp/include/wx/filefn.h: At global scope:
C:/Dev-Cpp/include/wx/filefn.h:51: syntax error before `=' token

make.exe: *** [../../samples/calendar/calendar.o] Error 1

Execution terminated





Can anyone help me to make it work?


I thank you in advance.

AF.
Message2. Re: Error trying to make Dev c++ with WxWidgets working
#3461
Posted by: upCASE 2004-03-05 23:25:17
Hi!
Check your compiler options for that project and add the following if they are missing:
-fno-rtti
-fno-exceptions
-fno-pcc-struct-return
-fstrict-aliasing
-Wall
-D__WXMSW__
-D__GNUWIN32__
-D__WIN95__
Especially the defines (-D) are needed in order to let wxWidgets know about your setup (does the compiler already have a type called 'bool' or do we need to typedef one etc.). The rest will make your code a little bit smaller by excluding support for exceptions and rtti. Wall simply turns on all warnings.

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message3. Re: Error trying to make Dev c++ with WxWidgets working
#3475
Posted by: nessuno28 2004-03-08 18:57:00
Hi,
        I checked all the parameters you sent to me and I already had all of them in my compiler's options. I tryed all the things I found on the internet but they aren't working.
Can you help me?

Thank you.
Message4. Re: Error trying to make Dev c++ with WxWidgets working
#3476
Posted by: upCASE 2004-03-08 19:03:59
Hi!
Judging from the compiler log you gave
g++.exe -c ../../samples/calendar/calendar.cpp -o ../../samples/calendar/calendar.o -I"C:/Dev-Cpp/include/c++"  -I"C:/Dev-Cpp/include/c++/mingw32"  -I"C:/Dev-Cpp/include/c++/backward"  -I"C:/Dev-Cpp/include"  -I"C:/wxWindows-2.4.2/include"    -ansi
the defines I spoke of are missing. Espescially -D__WXMSW__ and -D__GNUWIN32__ are important when compiling with gcc. Remove the ANSI compliance option (-ansi). Check if the options maybe are entered into the C compiler options and not in then C++ compiler options.

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Message5. Re: Error trying to make Dev c++ with WxWidgets working
#3477
Posted by: 2004-03-08 19:22:37
Ciao nessuno28, penso che tu sia italiano quindi dovresti comprendermi...
Anchio sto imparando adesso l'uso di Devc++ e volevo compilarlo con wxwidgets, potresti dirmi dove hai scaricato i vari package per la compilazione e le istruzioni per compilarlo grazie...
Message6. Re: Error trying to make Dev c++ with WxWidgets working
#3505
Posted by: nessuno28 2004-03-13 06:10:58
Scusami per il ritardo.

Per scaricare i package puoi andare sul sito www.bloodshed.com e andarti a vedere le "Resources". Li troverai tutti i pacchetti di cui necessiti.

Ciao ciao.
Message7. Re: Error trying to make Dev c++ with WxWidgets working
#3506
Posted by: nessuno28 2004-03-14 04:08:40
Hello, now I just have one error left but I can't solva it. When I build the application (I created a new app. with the wizard installed form the dev c++ packages) I get this error:


33 C:Dev-Cppincludec++backwardiostream.h:31,               from C:Dev-Cppincludewxmemory.h
In file included from C:/Dev-Cpp/include/c++/backward/iostream.h:31,               from C:/Dev-Cpp/include/wx/memory.h
20 C:Dev-Cppincludewxmemory.h:33,               from C:Dev-Cppincludewxobject.h
                 from C:/Dev-Cpp/include/wx/memory.h:33,               from C:/Dev-Cpp/include/wx/object.h
16 C:Dev-Cppincludewxobject.h:20,               from C:Dev-Cppincludewxwx.h
                 from C:/Dev-Cpp/include/wx/object.h:20,               from C:/Dev-Cpp/include/wx/wx.h
5 C:Dev-Cppincludewxwx.h:16,               from main.cpp
                 from C:/Dev-Cpp/include/wx/wx.h:16,               from main.cpp
5 D:PersonaliProgettiWxWindowsProva1main.cpp
                 from main.cpp
2 C:Dev-Cppincludec++backwardbackward_warning.h:32
#warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the <X> header for the <X.h> header for C++ includes, or <sstream> instead of the deprecated header <strstream.h>. To disable this warning use -Wno-deprecated.
6 D:PersonaliProgettiWxWindowsProva1main.cpp
In file included from main.cpp
8 D:PersonaliProgettiWxWindowsProva1main.h:63
[Warning] extra tokens at end of #endif directive
Dev-CppBin..libgcc-libmingw323.2........mingw32binld.exe D:PersonaliProgettiWxWindowsProva1C
cannot find -libwx
 D:PersonaliProgettiWxWindowsProva1Makefile.win
[Build Error]  [Project1.exe] Error 1



I tried to change the name of the library as I saw in the examples to put  -lwxmsw in the linker parameters. But it wasn't working so I went to the lib directory of Devc++ and I saw a libwx.a. so I thought it was the correct library and I changed the one of the sample with the new one but nothing changed.

The parameters of my c++ compiler are:

-fno-rtti
-fno-exceptions
-fno-pcc-struct-return
-fstrict-aliasing
-Wall
-D__WXMSW__
-D__GNUWIN32__
-D__WIN95__



And of the linker:

-mwindows -Wl,--subsystem,windows -mwindows -libwx -lstdc++ -lgcc -lodbc32 -lwsock32 -lwinspool -lwinmm -lshell32 -lcomctl32 -lctl3d32 -ladvapi32 -lopengl32 -lglu32 -lole32 -loleaut32 -luuid


The directory Include of devc++ is in the include directories of the project and the lib directory is in the Libraries Directory of the project.


Can you please help me?

Thank you in advance for being patient.

A.F.
Message8. Re: Error trying to make Dev c++ with WxWidgets working
#3507
Posted by: guidance 2004-03-14 09:50:18
Try to remove or comment out everything after #endif in that line.
Message9. Re: Error trying to make Dev c++ with WxWidgets working
#3515
Posted by: nessuno28 2004-03-16 16:30:30
I checked the code and there is nothing after the #endif.
Then I tryed to install it on another computer and I got the same problem. I thought something was wrong. So I installed it on another clean pc, I installed the imagelib devpack and the WxWindows-2.2.9 dev pack. Nothing.

What can I do to make it work?

Thank you again.

A.F.
Message10. Re: Error trying to make Dev c++ with WxWidgets working
#3516
Posted by: upCASE 2004-03-16 18:02:03
Hi!
" I saw a libwx.a..."
If the name is libblabla.a use -lblabla, not -libblabla in your linker settings.

"#warning This file includes at least one deprecated or antiquated header."
This warning should not be there if wxWidgets was configured correctly. Have you edited setup.h before compiling the lib? There's a setting somehwere like wxUSE_IOSTREAMH (don't remember exactly). Since gcc uses the standard header form for C++ it exspects a <iostream>, not <iostream.h> and gives a warning. Be sure to set the correct version of gcc and check the other settings in setup.h.

" WxWindows-2.2.9 dev pack" - please: What version ARE you using??
wxWidgets 2.4.2 is the latest stable one, 2.5.1 is the development version. 2.2.9 is completely outdated and the devpak won't even work with the new gcc 3.x compiler, since the ABI changed. Use the 2.2.9 devpak for gcc 2.95 if you have to...

upCASE
-----------------------------------
If it was hard to write, it should be hard to read!- Do. Or do not. There is no try!
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Fri 2024-3-29  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0