Author Topic: Compiling CB against wx 2.6.0 gives error (probably simple  (Read 13231 times)

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Compiling CB against wx 2.6.0 gives error (probably simple
« on: April 25, 2005, 08:38:06 pm »
I wanted to compile CodeBlocks 1.0beta 7 against wxWidgets 2.6.0.
I get an error in sdk\cbeditor.cpp
Quote
sdk/cbeditor.cpp: In member function `bool cbEditor::SaveAs()':
sdk/cbeditor.cpp:503: `wxHIDE_READONLY' undeclared (first use this function)
sdk/cbeditor.cpp:503: (Each undeclared identifier is reported only once for each function it appears in.)

Any ideas how to solve this?
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #1 on: April 25, 2005, 08:48:12 pm »
Beta 7 isn't wx2.6 ready. The CVS version has changes that allow you to compile successfully with it, butsome libraries need to be changed in the project file, too.

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #2 on: April 25, 2005, 10:54:00 pm »
I've got the same problem with the CVS version... but know I see the reade :) I'll try that first...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #3 on: April 25, 2005, 11:02:42 pm »
From the wxWidgets 2.5 change log:
- The wxHIDE_READONLY flag for wxFileDialog was not implemented
  and has now been removed

Comment that line then :-P or put it in these lines:
#if defined(wxHIDE_READONLY)
 ...
#else
...
#endif

BTW, if your change compiles, mind adding it to "patch requests"?

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #4 on: April 25, 2005, 11:27:27 pm »
hmm. thanks for the tip, but I will compile it first before I make a nice and clean patch/fix :D... when looking into the docs I can still find the wxHIDE_READONLY flag :?
After deleting the flag, i get more errors (the flag excists in three files. All in the SaveAs function: cbeditor.cpp, cbproject.cpp, cbworkspace.cpp)
Quote
In file included from sdk/compileoptionsbase.cpp:26:
sdk/compileoptionsbase.h:66: field `m_LinkerOptions' has incomplete type
sdk/compileoptionsbase.h:67: field `m_LinkLibs' has incomplete type
sdk/compileoptionsbase.h:68: field `m_CompilerOptions' has incomplete type
sdk/compileoptionsbase.h:69: field `m_IncludeDirs' has incomplete type
sdk/compileoptionsbase.h:70: field `m_ResIncludeDirs' has incomplete type
sdk/compileoptionsbase.h:71: field `m_LibDirs' has incomplete type
sdk/compileoptionsbase.h:72: field `m_CmdsBefore' has incomplete type
sdk/compileoptionsbase.h:73: field `m_CmdsAfter' has incomplete type

I don't get it. it looks normal to me... :roll:
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #5 on: April 26, 2005, 04:20:31 am »
Hmmmm try compiling with the *NEW* instructions that I just posted on the sticky 2.6 thread (I copied them from the cvs README).

Oh, try deleting your whole codeblocks directory (note: i mean the one you're trying to compile, not the one you're using :-P )

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #6 on: April 26, 2005, 08:07:58 am »
Quote from: rickg22
Hmmmm try compiling with the *NEW* instructions that I just posted on the sticky 2.6 thread (I copied them from the cvs README).

hmm. strange... I don't see what I am missing in my own compilation... but this seems to work. the compiler is further than it was before...
There two warnings, but I will try to make a patch for it... (two functions are deprecated.)
There is also a warning which looks very strang to me. I just show it :) perhaps you could do something with it later...
And Finaly there is an error given by windres.exe I don't know if this is a problem I only have, a whell, just look at it, perhaps you know it, and know how to solve it.
Quote from: compiler

src/main.cpp: In member function `void MainFrame::CreateMenubar()':
src/main.cpp:459: warning: suggest parentheses around assignment used as truth value
src/main.cpp:461: warning: suggest parentheses around assignment used as truth value
Compiling "src\printdlg.cpp"...
Compiling resources...
windres.exe: invalid option -- J
Usage: windres.exe [option(s)] [input-file] [output-file]
 The options are:
  -i --input=<file>            Name input file
  -o --output=<file>           Name output file
  -I --input-format=<format>   Specify input format
Process terminated with status 1 (4 minutes, 39 seconds)


And here is my windres version:
Quote from: windres -V

GNU windres 2.13.90 20030111

I've got mingw-3.1.0-1 installed...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #7 on: April 26, 2005, 09:06:11 am »
Quote
And Finaly there is an error given by windres.exe I don't know if this is a problem I only have, a whell, just look at it, perhaps you know it, and know how to solve it.
compiler wrote:

Code
src/main.cpp: In member function `void MainFrame::CreateMenubar()':
src/main.cpp:459: warning: suggest parentheses around assignment used as truth value
src/main.cpp:461: warning: suggest parentheses around assignment used as truth value
Compiling "src\printdlg.cpp"...
Compiling resources...
windres.exe: invalid option -- J
Usage: windres.exe [option(s)] [input-file] [output-file]
The options are:
-i --input=<file> Name input file
-o --output=<file> Name output file
-I --input-format=<format> Specify input format
Process terminated with status 1 (4 minutes, 39 seconds)


Hmm, the windres.exe I have is "GNU windres 2.15.91 20040904". Anyway, no big deal. Go to "Compile->Compiler options->Other->Advanced options->Commands->Compile Win32 resource file" and in the command line macro box change -J to -I, i.e. change it to
Code
$rescomp -i $file -I rc -o $resource_output -O coff $res_includes


Yiannis.
Be patient!
This bug will be fixed soon...

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #8 on: April 26, 2005, 09:21:21 am »
Thanks Yiannis, it workt a bit... now I get the following error :(
Quote
windres.exe: unknown format type `C:/Development/MinGW/include'
windres.exe: supported formats: rc res coff
mingw32-make.exe: *** [src_private.res] Error 1

I am trying to get the new version of mingw (3.2.0-rc3) perhaps that will solve it...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4315
    • Code::Blocks IDE
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #9 on: April 26, 2005, 09:37:31 am »
I see...
The problem lies in that "-I" is now used for adding search dirs, while your windres.exe expects it to define the resource format. I 'll see if I can deal with this in CVS...

Yiannis.
Be patient!
This bug will be fixed soon...

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #10 on: April 26, 2005, 10:29:29 am »
With the new version of mingw it works...
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #11 on: April 26, 2005, 02:56:43 pm »
mispunt: You might try downloading the separate mingw modules. the mingw "full package" does not have the latest versions of the modules. Here are mine:

gcc version 3.4.2 (mingw-special)
GNU ld version 2.15.94 20050118
GNU windres 2.15.94 20050118

Anonymous

  • Guest
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #12 on: April 27, 2005, 04:02:46 pm »
Hi all I got code block to compile with wxwidgets 2.60 here are some of the problems i had and hopefully there fix.

I also got this error

sdk/cbeditor.cpp: In member function `bool cbEditor::SaveAs()':
sdk/cbeditor.cpp:503: `wxHIDE_READONLY' undeclared (first use this function)
sdk/cbeditor.cpp:503: (Each undeclared identifier is reported only once for each function it appears in.)

I gid of some of  my error buy  tracking down the defines needed in source could here what i have for defines

__GNUWIN32__
__WXMSW__
WXUSINGDLL
wxUSE_EXCEPTIONS
wxUSE_STDPATHS
wxUSE_XML
wxUSE_CHOICEBOOK
wxUSE_DATEPICKCTRL
wxUSE_XRC
wxUSE_LISTBOOK
wxUSE_MDI
wxUSE_SOUND
wxUSE_ARCHIVE_STREAMS

I might have a few not need but hay it worked  and as far as i know haveing lot of defines not use don't hurt.

 I copied setup.h in lib\gcc_dll\msw\wx  to include\wx

I found that I useing alot of my dev-cpp Include for wxwidget libbarry so i removed the dev-cpp package for it. (you probbly could move the dir its in if you don't want to do this but why when you have it setup to use wxwidget in code::blocks with a new one.)

The stang :P e thing about this is that i don't tell it to seach the dev-cpp dir anyware in code::block setup.  I don't know why it is doing this. I even check the compiler plugin option it is not there. any have any idea what i might have forgot?.

I also change the name of many of the lib  to point to of the correct lib for the wxwidgets 2.6.0 stable realse. I add WX_VER Varibale and put it to 2.6.0 or something simelere check the lib.
i had to delete all the libbary that ask to load the wxxrc libbary because i buit wxwidget all as one libbarry.

I got an error on wxarraystring was parrtaly define so I look at wxwidgets 2.6.0 doc and and it to the top of the file wich gave me an error

It gave me anther error about can't convert (int to void* or something simmaler) for tree control so I again went to doc to fix this i had to replace int with one of there class name.

The last thing i did was to temprally rename dev-cpp\ lib and include for some reson it was still useing some file from dev-cpp insted of the ones in with wxwidgets 2.6.0

I hope I did not forget anything good luck.
ps I doing all this buy memmory

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Compiling CB against wx 2.6.0 gives error (probably simple
« Reply #13 on: April 27, 2005, 09:24:40 pm »
Thanks for the tips. We're already working on some of these compilation errors. The major drawback with wx2.6 is the MDI implementation. For some reason the MDI windows don't work as they should, so we're planning to switch to tabbed editors (Probably that'll be after 1.0). Then we'll switch to wx2.6 by default.