Author Topic: build codeblocks src  (Read 5193 times)

Offline Brentoids

  • Single posting newcomer
  • *
  • Posts: 3
build codeblocks src
« on: April 19, 2008, 07:41:57 pm »
okay I'm new to codeblocks and I thought that the first project I should build would be the code::Blocks src.
I am getting the following error when I try and run a build.

-------------- Build: tinyXML in Code::Blocks ---------------

mingw32-g++.exe -Wall -g -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE  -DEXPORT_LIB    -IE:\Coding\Lib\wxWidgets-2.8.7\include -IE:\Coding\Lib\wxWidgets-2.8.7\lib\gcc_dll\mswu -Iinclude\wxscintilla\include -Iinclude\tinyxml -Iinclude\tinyxml -I"C:\Program Files\CodeBlocks\MinGW\"  -c F:\Coding\CodeBlocks\src\base\tinyxml\tinyxml.cpp -o .objs\base\tinyxml\tinyxml.o
mingw32-g++.exe: no input files
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings
 

I notice that -Iinclude\tinyxml is included twice (though I'm not sure where I'd go to change this). I'm pretty sure this is not my problem.  I have setup the global variable base directory for wx to be E:\Coding\Lib\wxWidgets-2.8.7 and cb to be F:\Coding\CodeBlocks.  the first directory is where i installed wxWidgets-2.8.7, the second is where I unpacked the Code::Blocks source.  I am using windows and C::B 8.02.  I installed with MinGW.  And I have made sure the Settings\Compiler and debugger...\Toolchain executables[tab]\Compiler's installation directory is set correctly.  I am trying this on a Windows system.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5495
Re: build codeblocks src
« Reply #1 on: April 19, 2008, 08:06:19 pm »
how did you get hold of the CB sources ?, from svn ??

Did you already build wx widgets ?

Have a look here : http://wiki.codeblocks.org/index.php?title=Nightly_Cookbook

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: build codeblocks src
« Reply #2 on: April 20, 2008, 01:48:50 pm »
Funny, this looks perfectly ok.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: build codeblocks src
« Reply #3 on: April 20, 2008, 02:24:51 pm »
The only difference to my commandline (inspite of different paths, of course), when compiling C::B from source on Windows (2k) is the additional
Code
-I"C:\Program Files\CodeBlocks\MinGW\"

If I include my MinGW-base dir with a trailing backslash I get the same error then you.
If I include it without the trailing backslash everything works as expected.

But it also works without the additional include.

If you have added this include-dir somewhere try to remove it, at least remove the trailing backslash.

EDIT:
The error only happens if the include-path with the trailing backslash is quoted if it's unquoted the trailing backslash does not cause an error ( I don't have any spaces in my MinGW basepath).

second EDIT:
I forgot: the quotes are set automatically by C::B if there are spaces in the path, that means an additional search directory entry can be without the quotes (but with the backslash).
« Last Edit: April 20, 2008, 02:44:01 pm by jens »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: build codeblocks src
« Reply #4 on: April 20, 2008, 08:04:07 pm »
Hmm... and I can even reproduce it manually on the commandline.

So it seems that getopt (or whatever parses gcc's command line) interpretes the \" as an escaped quote. :(

That's unfortunate, because it imposes a serious limit on what constitutes a valid pathname, and we cannot do without the quotes.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: build codeblocks src
« Reply #5 on: April 20, 2008, 09:14:08 pm »
Hmm... and I can even reproduce it manually on the commandline.

So it seems that getopt (or whatever parses gcc's command line) interpretes the \" as an escaped quote. :(

That's unfortunate, because it imposes a serious limit on what constitutes a valid pathname, and we cannot do without the quotes.

Isn't it possible to remove a trailing backslash if C::B adds the quotes ?
Or to add a space before the quote?

All that will of course only work if the user does not add the quotes manually.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: build codeblocks src
« Reply #6 on: April 20, 2008, 09:34:06 pm »
Hmm yes, that would of course work, but it's not really good either :(

I hate it when a program tries to be smarter than me and modifies the paths or names that I enter, that's no good thing. For example, someone might have all paths end in a backslash on purpose because he wants to concatenate them... or whatever (something like $path$file).
The problem with computers being "smart" and tampering with the things you enter is that computers are never really smart, so for every case you fix, there's one case where it breaks something else.
I'm not sure what is best to do :(

It's like when I come from the supermarket and drive up the little hill in front of my house. As there is a gentle slope going down for about 1.5 kilometers followed by a 100 m steep hill, the hybrid engine will have collected enough energy so I can drive the entire distance without spending a single drop of fuel. However, if I only push the accelerator a bit too strong, the computer in all its smartness figures that I'm going on a mountain rallye, so it fires up the combustion engine for "max power". If the computer was really smart, it would realize that I'm 100 meters from home, and that it really doesn't matter whether I get there 0.75 seconds earlier or not.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: build codeblocks src
« Reply #7 on: April 20, 2008, 09:47:40 pm »
Maybe we could double trailing backslashes...?
Only Windows uses backslashes, and runs of backslashes are treated as one, by definition.

If some program does not interprete quoted chars, it will be ok.
If \\ is interpreted as a quoted char, it translates to \, and won't touch the quote char... which again, is ok.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: build codeblocks src
« Reply #8 on: April 20, 2008, 10:31:32 pm »
Good idea !

I just tried the following patch on my W2K kvm-box and it seems to work:

Code
Index: src/sdk/globals.cpp
===================================================================
--- src/sdk/globals.cpp (revision 5010)
+++ src/sdk/globals.cpp (working copy)
@@ -184,7 +184,11 @@
  bool hasSpace = str.Find(_T(' ')) != -1;
  bool hasParen = !platform::windows && (str.Find(_T('(')) != -1 || str.Find(_T(')')) != -1);
     if (!str.IsEmpty() && str.GetChar(0) != _T('"') && (hasSpace || hasParen))
+    {
+        if (str.Last() == _T('\\'))
+            str+=_T('\\');
         str = wxString(_T("\"")) + str + _T("\"");
+    }
 }
 
 wxString EscapeSpaces(const wxString& str)

I only compiled a smalll test project with one additional include dir that includes spaces, but everything works fine.

Offline Brentoids

  • Single posting newcomer
  • *
  • Posts: 3
Re: build codeblocks src
« Reply #9 on: April 21, 2008, 04:40:13 am »
It is definitely because of the backslashes.  i moved MinGW to a path without spaces and changed the references in:

Settings\Compiler and debugger\ [tab] Search directories\ [tab] Compiler
Settings\Compiler and debugger\ [tab] Search directories\ [tab] Linker
Settings\Compiler and debugger\ [tab] Search directories\ [tab] Resource compiler
Settings\Compiler and debugger\ [tab] Toolchain executables\ Compiler's installation directory

and then the build proceeded as normal.  I then hit,

E:/Coding/Lib/wxWidgets-2.8.7/include/wx/platform.h:196:22: wx/setup.h: No such file or directory

errors, but I believe I can fix these after I read http://wiki.codeblocks.org/index.php?title=Nightly_Cookbook.  I didn't have the time to work on this today, but thought I'd drop an update.

Offline Brentoids

  • Single posting newcomer
  • *
  • Posts: 3
Re: build codeblocks src
« Reply #10 on: April 21, 2008, 02:09:11 pm »
yep just needed to build wxWidgets.  Thanks for the help.