Author Topic: Nightly builds no longer compile  (Read 7715 times)

Offline merlin

  • Single posting newcomer
  • *
  • Posts: 8
Nightly builds no longer compile
« on: November 05, 2008, 07:16:11 am »
Hi,

I've been compiling nightly builds for a long time without a problem, until now.  About the time Codeblocks 8.02 was released I upgraded to a new computer running vista.

I installed the latest cygwin (not used for compiling wxWidgets or Codeblocks), MinGW, wxWidgets 2.8.9 (compiled with MinGW) and Codeblocks 8.02 on the machine.  After that I get the following error trying to compile codeblocks from the svn source:


-------------- Build: sdk in Code::Blocks ---------------

Running target pre-build steps
build_tools/autorevision/autorevision +wx +int +t . include/autorevision.h
'svn' is not recognized as an internal or external command,
operable program or batch file.
Precompiling header: include\sdk_precomp.h
In file included from C:/cygwin/home/paul/Workspace/wxWidgets-2.8.9/include/wx/gsocket.h:175,
                 from C:/cygwin/home/paul/Workspace/wxWidgets-2.8.9/include/wx/sckaddr.h:20,
                 from C:/cygwin/home/paul/Workspace/wxWidgets-2.8.9/include/wx/socket.h:24,
                 from C:\Users\paul\Documents\Workspace\codeblocks\trunk\src\include\sdk_common.h:82,
                 from C:\Users\paul\Documents\Workspace\codeblocks\trunk\src\include\sdk_precomp.h:13:
C:/cygwin/home/paul/Workspace/wxWidgets-2.8.9/include/wx/msw/gsockmsw.h:93: error: `SOCKET' does not name a type
C:/cygwin/home/paul/Workspace/wxWidgets-2.8.9/include/wx/msw/gsockmsw.h:104: error: field `m_timeout' has incomplete type
Process terminated with status 1 (0 minutes, 56 seconds)
2 errors, 11 warnings
 

Everything up to the sdk compiles just fine.

It looks like winsock.h needs to be included but I would have thought that the wxWidgets headers would look after that and I've never needed to change anything before this.

Wondering if anyone else has had a similar problem (and found a solution to it :-)

Windows Vista Home Premium
MinGW 5.1.4
wxWidgets 2.8.9
Codeblocks 8.02
Codeblocks source latest nightly svn

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: Nightly builds no longer compile
« Reply #1 on: November 05, 2008, 09:43:37 am »
Wondering if anyone else has had a similar problem (and found a solution to it :-)
I don't know why you need Cygwin but my 2 cents that this is the cause of the error. It seems you are trying to use Cygwin header files for compilation (even if you say you just installed it).
Please do only install the MinGW compiler suite, then don't put your project under a Cygwin "managed" folder, remove any references to Cygwin (there might be an environment variable set, for example) and try again.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline merlin

  • Single posting newcomer
  • *
  • Posts: 8
Re: Nightly builds no longer compile
« Reply #2 on: November 07, 2008, 04:23:30 am »
That had crossed my mind but since i was running much the same configuration on my old XP computer I had discounted it and a possibility.

But in desperation I figured your suggestion was worth a shot.  Since I wanted to re-install vista anyway I bit the bullet and did it yesterday.

BTW:  The reason for cygwin is that (apart from running xterms) I develop for several different compilers.  There was about 6 different toolchains on my XP box without any problems (getting paranoid enough to think that its maybe a vista thing)

Installed wxWidgets 2.8.9 for windows using the windows installer from the wx site.  Path: c:\wxWidgets-2.8.9

I installed codeblocks-8.02 + mingw.

I compiled wxWidgets using mingw that was installed with codeblocks.  Used the following command line:

mingw32-make SHARED=1 USE_OPENGL=1 BUILD=release MONOLITHIC=1 OFFICIAL_BUILD=1 UNICODE=1 -f makefile.gcc

I checked out the latest svn (about 4 hours before this post) and got the same error:


-------------- Build: sdk in Code::Blocks ---------------

Running target pre-build steps
build_tools/autorevision/autorevision +wx +int +t . include/autorevision.h
'svn' is not recognized as an internal or external command,
operable program or batch file.
Precompiling header: include\sdk_precomp.h
In file included from C:/wxWidgets-2.8.9/include/wx/gsocket.h:175,
                 from C:/wxWidgets-2.8.9/include/wx/sckaddr.h:20,
                 from C:/wxWidgets-2.8.9/include/wx/socket.h:24,
                 from C:\Users\paul\Documents\Workspace\codeblocks\trunk\src\include\sdk_common.h:82,
                 from C:\Users\paul\Documents\Workspace\codeblocks\trunk\src\include\sdk_precomp.h:13:
C:/wxWidgets-2.8.9/include/wx/msw/gsockmsw.h:93: error: `SOCKET' does not name a type
C:/wxWidgets-2.8.9/include/wx/msw/gsockmsw.h:104: error: field `m_timeout' has incomplete type
Process terminated with status 1 (1 minutes, 5 seconds)
2 errors, 11 warnings

 
I'm really stumped now.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Nightly builds no longer compile
« Reply #3 on: November 07, 2008, 04:41:45 am »
The setup.h you are using should be here:
C:\wxWidgets-2.8.9\lib\gcc_dll\mswu\wx\setup.h

How did you change it, from the default settings?

Tim S

PS: You may want to read this link
http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows#Compile_wxWidgets_in_Unicode_mode
« Last Edit: November 07, 2008, 04:43:39 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline merlin

  • Single posting newcomer
  • *
  • Posts: 8
Re: Nightly builds no longer compile
« Reply #4 on: November 07, 2008, 05:55:24 am »
I compiled wx in unicode mode with:

mingw32-make SHARED=1 USE_OPENGL=1 BUILD=release MONOLITHIC=1 OFFICIAL_BUILD=1 UNICODE=1 -f makefile.gcc

I didn't see any need to change the setup.h since the only thing that I would have altered ws wxUSE_UNICODE and that does not need to be changed since it is defined in the C::B project and in setup.h it is:

#ifndef wxUSE_UNICODE
    #define wxUSE_UNICODE 0
#endif

so the #define there will never be evaluated.

I did give up on finding the cause of the problem and went for a brute force solution.  Changing sdk_common.h :

    #include <wx/process.h>
    #include <wx/radiobox.h>
    #include <wx/radiobut.h>
    #include <wx/regex.h>
    #include <wx/sizer.h>
#include <winsock.h>
    #include <wx/socket.h>
    #include <wx/spinctrl.h>
    #include <wx/splitter.h>
    #include <wx/stattext.h>
    #include <wx/string.h>

makes it all work perfectly.  As I said in my original post, it appeared as if winsock.h is not being included.  I can't find a good reason why this is so.  If anyone else was having a problem then I would put it down to a bug in the order of includes.  Since it seems to be unique to me then it must something more subtle.

Suggestions are still welcome as I would like to find a "correct" solution ot this.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7786
    • My Best Post
Re: Nightly builds no longer compile
« Reply #5 on: November 07, 2008, 06:18:32 am »
FYI: If you are still running Windows Vista upgrade MinGW to an version newer than that which came with C::B 8.02. Like "3.4.5 (mingw-vista special r3)"

I do not think your build of wxWidgets was done without errors.
Edit: Just tried it with your build command looks like it finished with no errors.
Just linked the wxWidgets built with Code::Blocks and it worked,
I have no idea what must be wrong with your setup; if it is WinXP.

IIRC, The build command you gave will not work with an unmodified setup.h
I think, the value of wxUSE_GLCANVAS must be 1 for OpenGL to work right.

But, since USE_OPENGL=1 is not needed for Code::Blocks not sure why you are setting it to 1.

Tim S

« Last Edit: November 07, 2008, 07:14:57 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline merlin

  • Single posting newcomer
  • *
  • Posts: 8
Re: Nightly builds no longer compile
« Reply #6 on: November 07, 2008, 06:47:46 am »
oops, you got me.  I did change USE_OPENGL=1.  Forgot about it since it's not C::B related.  I do a bit of opengl programming and i don't see the point in having multiple versions of WX around when i only need 2 (ansi & unicode) if I just compile everything I need into them.

I did a carefull step through the include sequence and I found that changing

#if defined(__WXWINCE__) || defined(__CYGWIN__)
#include <winsock.h>
#endif

to

#if defined(__WXWINCE__) || defined(__CYGWIN__) || defined(__MINGW__)
#include <winsock.h>
#endif

in gsockmsw.h fixes all of my problems with C::B.  (The basic socket problem also showed up in several of the contrib plugins.)

I'll take this over to one of the wx forums and see what they have to say about it.

Unfortunately that isn't the end of my woes.  The contrib plugin "Help" fails to compile with several "undefined reference to _errno" linker errors.  All the other plugins do compile fine.

I seem to recall something about this from a while back.  IIRC, MinGW redefines errno as a function and the programmer needs to either use it as a function or define something to tell MinGW to use the old int definition.

But the reason isn't as important as why it is mis-behaving on my system when everyone else can compile it ok.  Maybe this is somehow also related to the SOCKET error?

Anyway, I'll upgrade MinGW to the latest but that also has the same error as that was what I was using a couple of days ago.  I downgraded to the bundled version to try to eliminate as many variables as possible.

Offline merlin

  • Single posting newcomer
  • *
  • Posts: 8
Re: Nightly builds no longer compile
« Reply #7 on: November 07, 2008, 08:31:08 am »
Just confirming exactly the same results with the latest MinGW installed.

Offline merlin

  • Single posting newcomer
  • *
  • Posts: 8
Re: Nightly builds no longer compile
« Reply #8 on: November 09, 2008, 06:31:28 pm »
Found the solution. 

Later versions of MinGW need to have __USE_W32_SOCKETS defined.  Put that in the MinGW compiler global settings and everything works fine.

Hope this helps someone else in the future.