for the memory exhausted problem you can pass the compiler -fno-keep-inline-dllexport
on the command line when building wxWidgets. I think you need the build wxWidgets as
monolithic since project for mingw CB link to that one.
Something like this;
mingw32-make -f makefile.gcc BUILD=release UNICODE=1 SHARED=1 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport"
This builds wxwidgets fine on my 4gb rig.
(invalid) usually means that some global variable expanded to an invalid value.You know you need to set
cb global variable also, right? if you haven't, set it to (assuming you checked out the CB to c:\codeblocks_svn)
base = c:\codeblocks_svn\src\
lib = c:\codeblocks_svn\src\devel
After this you should be able to compile CB with no problems.
P.S : for cb_release_type you can use -g for debug builds or any optimization flags for release builds (usually-O2)
I followed the instructions word for word and picture for picture as outlined here (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows). Since the repository location is out of date in that article (I found the new one referenced somewhere else; I think in a thread here), is it possible some other elements of the build process outlined there are out of date as well?
I did try adding these two lines:
CFLAGS ?= -fno-keep-inline-dllexport
CXXFLAGS ?= -fno-keep-inline-dllexport
to the config.gcc file as the page outlined last night. I am retrying with the "-fno-keep-inline-dllexport" part added to the command line instead, like you posted here. I'll post back when it's done.
I'll have to wait for this to finish before getting to that error for the actual CodeBlocks build attempt.
I also already did the global variable part as outlined on the page. If wx build successfully this time around, I'll recheck everything, including the global variable.
wxWidgets seems to have built successfully this time.
Building codeblocks failed again. The error is the same as before. The page says just open codeblocks.cbp and hit compile, so I did that. The error is:
-------------- Build: tinyXML in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall (invalid) -pipe -mthreads -fmessage-length=0 -fexceptions -Winvalid-pch -DHAVE_W32API_H -D__WXMSW__ -DWXUSINGDLL -DcbDEBUG -DCB_PRECOMP -DWX_PRECOMP -DwxUSE_UNICODE -Wall -fno-strict-aliasing -Wno-write-strings -iquote.objs\include -I.objs\include -I. -IC:\Users\Sorinev\Desktop\wxMSW-2.8.12\include -IC:\Users\Sorinev\Desktop\wxMSW-2.8.12\lib\gcc_dll\mswu -Isdk\wxscintilla\include -Isdk\wxpropgrid\include -Iinclude\tinyxml -Iinclude\tinyxml -c C:\CodeBlocksSVNSource\src\base\tinyxml\tinystr.cpp -o .objs\base\tinyxml\tinystr.o
mingw32-g++.exe: error: (invalid): No such file or directory
Process terminated with status 1 (0 minutes, 0 seconds)
1 errors, 0 warnings (0 minutes, 0 seconds)
Every build target fails instantly. This is the error when having "all" selected. Other build targets fail immediately with different specific, but generally similar errors.
Is there more to it than just hitting build, as the page says to do?
Jesus, I've never seen such fast replies to my forum posts in all of the years I've been tooling around on the internet. Haha. Thanks for the very fast and very helpful replies.
My command line for the [successful] wxWidgets build this time was exactly as in golgepapaz's post:
mingw32-make -f makefile.gcc BUILD=release UNICODE=1 SHARED=1 MONOLITHIC=1 CXXFLAGS="-fno-keep-inline-dllexport"
I seem to have mingw 4.6.2. It uses the same one for both the command line wxwidgets build and the codeblocks ide [attempted] build.
It seems like it's obviously more than just a
Open the project file CodeBlocks.cbp. You will be prompted to define the global variable $(#wx). Enter the location where you unpacked wxWidgets. Hit the blue gear and lean back.
needing to go on here. So how about we just skip that wiki page altogether and just start me fresh here with an idiots guide, from steps 0 to n. Every detail, no matter how small and trivial. I have mingw installed, it's in C:\MinGW. Is my repository right? TortoiseSVN shows that I'm at 9214. And what's the most recent download for the wxWidgets material? Any other materials I need to download?
Again, I really appreciate the speedy and helpful replies. I'll update to the latest nightly in the meantime. Currently running 12.11.
I just looked over http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows#Compile_Code::Blocks (http://wiki.codeblocks.org/index.php?title=Installing_Code::Blocks_from_source_on_Windows#Compile_Code::Blocks)
And, it is out of date.
I will try to give you the basic info needed. Feel free to update the Wiki page.
I will add notes to this post as I go over what I do to build CB.
Please read Wiki Pages linked below
http://wiki.codeblocks.org/index.php?title=Global_compiler_variables (http://wiki.codeblocks.org/index.php?title=Global_compiler_variables)
You Need to correct the Global Variable called "cb_release_type"; something MUST be entered in the base field.
I use "-g" without the quotes.
Attached image; please download image and tell me you got it.
Your copy should say default where mine says test_cb_build.
I need to delete the image as soon as possible because this sites has very little space for images.
The warning shown below can be ignore the first time you build CB; it should not happen after the pre-compiled header is created during the SDK build.
cc1plus.exe: warning: .objs\include: No such file or directory [enabled by default]
Tim S.
I've now gotten as far as actually being able to build something this time. I set the cb_release_type (first to -g, then to -O2). I made a cb variable and set it to c:\cb_svn. I'm assuming that's what's meant by root folder. Or should it be c:\cb_svn\src? (well technically it's CodeBlocksSVNSource and not cb_svn).
I did not get the above warning. My build messages are the following:
||=== Build: tinyXML in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: AutoRevision in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: ConsoleRunner in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Squirrel in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: Squirrel std lib in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: SqPlus in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: scintilla in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: wxpropgrid in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
||=== Build: sdk in Code::Blocks wx2.8.x (compiler: GNU GCC Compiler) ===|
C:\CodeBlocksSVNSource\src\sdk\globals.cpp||In function 'void PlaceWindow(wxTopLevelWindow*, cbPlaceDialogMode, bool)':|
C:\CodeBlocksSVNSource\src\sdk\globals.cpp|1050|warning: 'r.tagRECT::bottom' may be used uninitialized in this function [-Wuninitialized]|
C:\CodeBlocksSVNSource\src\sdk\globals.cpp|1050|warning: 'r.tagRECT::right' may be used uninitialized in this function [-Wuninitialized]|
||Execution of 'zip -jq9 devel\share\CodeBlocks\manager_resources.zip sdk\resources\*.xrc' in 'C:\CodeBlocksSVNSource\src' failed.|
and my build log is this:
...
tons and tons of stuff
...
Creating library file: devel\libcodeblocks.a
Output file is devel\codeblocks.dll with size 7.57 MB
Running target post-build steps
cmd /c if not exist devel\share\CodeBlocks mkdir devel\share\CodeBlocks
zip -jq9 devel\share\CodeBlocks\manager_resources.zip sdk\resources\*.xrc
Execution of 'zip -jq9 devel\share\CodeBlocks\manager_resources.zip sdk\resources\*.xrc' in 'C:\CodeBlocksSVNSource\src' failed.
The contents of src\output are:
share folder, with various subfolders and files
cb_console_runner.exe
codeblocks.dll
wxmsw28u_gcc_custom.dll
wxpropgrid.dll
And the contents of src\devel are:
share folder, with various subfolders and files
cb_console_runner.exe
cb_share_config.exe
codeblocks.dll
libcodeblocks.a
libwxpropgrid.a
libwxscintilla_cb.a
wxmsw28u_gcc_custom.dll
wxpropgrid.dll
Clearly, I'm missing a few things. I ran update.bat anyway, but it didn't do anything, since I think I need to set up the whole zip windows path variable thing (I need info on that).
I downloaded the zip 2.3.3 linked on that page. I tried settings the environment variable in codeblocks to ZIPCMD with value of C:\zip-2.3.3 and also tried changing ZIPCMD to just zip instead. That didn't work.
I also added C:\zip-2.3.3 to the windows "Path" area under advanced system properties -> environment variables, still no go.
Finally I just edited update.bat to change
to
set ZIPCMD="C:\zip-2.3.3\bin\zip.exe"
and now I no longer get "zip" not recognized, etc. messages spammed in the console window if I run update.bat myself; it actually does a few things now. But if I try to build codeblocks again, it still gives me the zip error.
If I'm doing something wrong, I'm not kidding when I say I need an idiot's guide. "Right click this, select this, type this exact thing, press ok. Now do this next thing by opening this menu, then..." etc. I've never built such a complicated application before. Everything I've done to date has ranged from single source file compiles, to projects with at most a couple dozen source files, with no extra settings, dependencies, dlls, etc. This whole thing is very new to me, so remember that what you take for granted is currently rocket science to me and akin to playing darts blindfolded and facing the wrong direction. Or like trying to hit a bullet with a smaller bullet while riding a horse, blindfolded. :)
@BlueHazzard
Okay, very good job.
Maybe we could replace
CFLAGS ?= -fno-keep-inline-dllexport
CXXFLAGS ?= -fno-keep-inline-dllexport
by
CPPFLAGS ?= -fno-keep-inline-dllexport
I checked the Makefile, but we still control ...
and add after
or
mingw32-make -fmakefile.gcc SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=1 CPPFLAGS=-fno-keep-inline-dllexport
Thank you again
Well, I've got the Windows + TDM-GCC build process for Code::Blocks down to three easy steps. SVN Update; Build; Update.bat; done.
But now I've got a new problem! I've got another system that I'm running Kubuntu 12.10 64-bit on (it's actually a VMware guest on my Windows system), and I'm trying to build from source. I've got it to the point where it starts compiling, but partway through, it stops. The error is:
notebookstyles.h:13:25: fatal error: gtk/gtk.h: No such file or directory
I do have GTK install. I've never really gotten familiar with Linux, just tooled around a bit here and there, so I'm not sure what steps to take to resolve it. I googled around and found this issue as it relates to building gtk projects from within codeblocks, but I couldn't find anything involving the gtk header error for building codeblocks itself.
Did you suceed in compiling cb?
Compiling cb from the commandline works on Ubuntu 12.10, once the ./configure script ran sucessfully
(see wiki or file BUILD). It then shows:
*************************************************
* Code::Blocks source tree has been configured. *
*************************************************
If you do not want do install boost and can live without the NassiShneiderman-plugin,
then change the configure to:
./configure --with-contrib-plugins=all,-NassiShneiderman
If memory serves me, to satisfy configure I had to install:
libgtk2-common
libgtk2.0-dev
wx-common
wx2.8-headers
libwxbase2.8-0
libwxbase2.8-dev
libwxgtk2.8-0
libwxgtk2.8-dev
It's libhunspell-dev on debian-based systems.
That did the trick, thank you for the assist. I also needed libgamin-dev and libboost-dev. However, after I did make && make install, this happened.
make[6]: Nothing to be done for `install-exec-am'.
/bin/mkdir -p '/usr/local/include/codeblocks/scripting/sqplus'
/usr/bin/install -c -m 644 SqPlusConst.h SquirrelBindingsUtils.h SquirrelVM.h sqplus.h SquirrelObject.h '/usr/local/include/codeblocks/scripting/sqplus'
/usr/bin/install: cannot remove ‘/usr/local/include/codeblocks/scripting/sqplus/SqPlusConst.h’: Permission denied
/usr/bin/install: cannot remove ‘/usr/local/include/codeblocks/scripting/sqplus/SquirrelBindingsUtils.h’: Permission denied
/usr/bin/install: cannot remove ‘/usr/local/include/codeblocks/scripting/sqplus/SquirrelVM.h’: Permission denied
/usr/bin/install: cannot remove ‘/usr/local/include/codeblocks/scripting/sqplus/sqplus.h’: Permission denied
/usr/bin/install: cannot remove ‘/usr/local/include/codeblocks/scripting/sqplus/SquirrelObject.h’: Permission denied
make[6]: *** [install-sdkHEADERS] Error 1
make[6]: Leaving directory `/home/sorinev/devel/trunk/src/include/scripting/sqplus'
make[5]: *** [install-am] Error 2
make[5]: Leaving directory `/home/sorinev/devel/trunk/src/include/scripting/sqplus'
make[4]: *** [install-recursive] Error 1
make[4]: Leaving directory `/home/sorinev/devel/trunk/src/include/scripting'
make[3]: *** [install-recursive] Error 1
make[3]: Leaving directory `/home/sorinev/devel/trunk/src/include'
make[2]: *** [install] Error 2
make[2]: Leaving directory `/home/sorinev/devel/trunk/src/include'
make[1]: *** [install-recursive] Error 1
make[1]: Leaving directory `/home/sorinev/devel/trunk/src'
make: *** [install-recursive] Error 1
Is this something that I need to address, or have I reached the end and am good to go?
If you see only the ubuntu-version, your compiled programm is either not installed or not started.
I have even uninstalled the ubuntu version of codeblocks to avoid conflicts. But before you start
uninstalling that, at least you can see, if you can start /usr/local/bin/codeblocks from the commandline.
If you still lack a sucessful installation, try only:
watch the result. And only when it looks ok (no error visible, instead: "Nothing to be done for `all-am'."), then enter:
If that does not work, check if you can write (as sudoer) to that directory at all. e.g.
sudo install --directory /usr/local/include/codeblocks/scripting/sqplus
sudo touch /usr/local/include/codeblocks/scripting/sqplus/mytouchtest.txt
I must have missed some part of the process somewhere then. The contrib plugins were successfully built, so I think there's some step I haven't done. I assumed I was supposed to run the ./update file? (which I did).
output/share/codeblocks is full of all of the individual contrib zip files.
output/share/codeblocks/plugins is full of all the matching contrib .so files.
Do you use C::B to build C::B or do you use the automake-system ?
You wrote about both, if I remember correctly.
Yeah, I tried both. First, I tried the command line method. ./boostrap, ./configure, etc. But I had so-so luck with that.
Second, I tried the 'use C::B to build C::B' route, and it went fantastically and without a hitch, aside from the contrib plugins not loading. My process was:
- apt-get install codeblocks - I end up with 12.11
- Go to ~/devel/trunk/src/ and open codeblocks-unix.cbp
- Build - success
- Now, while still in ~/devel/trunk/src/ open ContribPlugins-unix.workspace
- Build Workspace - success
- Still in ~/devel/trunk/src/ and do ./update
- Output folder is generated, just like on Windows, with following contents as pictured:
(http://imageshack.us/a/img534/392/9a3n.png)
(http://imageshack.us/a/img69/8681/5ss.png)
(http://imageshack.us/a/img41/3521/0tno.png)
The -v parameter is not needed for normal use, but it gives more debug-messages if something went wrong, as it seems to be in your case.
i tried that, from the output folder pictured above, and nothing in the console seemed to indicate any problems. But in the IDE, going to Plugins -> Manage Plugins pops up the plugins management window with the following message box popped up on top of it (does not happen when starting codeblocks normally):
Failed to create a temporary file name
(error 13: Permission denied)
In the list of plugins on that Manage Plugins dialog, the contrib plugins are not listed. Install New only looks for .cbplugin filenames, but the contribs exist as .zip and/or .so.