Code::Blocks Forums

User forums => Help => Topic started by: bnilsson on September 24, 2006, 10:45:31 am

Title: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 24, 2006, 10:45:31 am
I have problems following the wiki instructions on building CB for OSX.

I do
./configure --enable-contrib

and get (in make src/plugins/contrib)

ar cru .libs/libwxPdfDocument.a .libs/pdfannotation.o .libs/pdfbarcode.o .libs/pdfcolor.o .libs/pdfdoc.o .libs/pdfencrypt.o .libs/pdffont.o .libs/pdfform.o .libs/pdfgraphics.o .libs/pdfimage.o .libs/pdfkernel.o .libs/pdfxml.o~ranlib .libs/libwxPdfDocument.a
ar: .libs/pdfxml.o~ranlib: No such file or directory

What is ".libs/pdfxml.o~ranlib"?

Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 24, 2006, 12:52:59 pm
Platform:
PowerMac dual G5 2.3GHz
OSX 10.4.7
wxwidgets 2.6.3
codeblocks from http://www.codeblocks.org/source_code.shtml

I applied the patches as indicated by the wiki page, there were many FAILED chunks but anyway, now it built after editing menuutils.cpp and dragscroll.cpp. Some functions TODO had been implemented (by the patches?) without removing the empty TODO declarations.

(I had the naive assumption that patches of some age would go into the fresh distribution, but this was obviously wrong.)

This version of CB does not load the plugins. It is looking for the wrong plugins, or the wrong plugins (names?) are installed.
CB says it wants .zip plugins, but there are only .la and .so files in the plugins folder.
But this would go into another thread.

Title: Re: Problems making CB for OSX from wiki instructions
Post by: Pecan on September 24, 2006, 01:57:31 pm
Platform:
PowerMac dual G5 2.3GHz
OSX 10.4.7
wxwidgets 2.6.3
codeblocks from http://www.codeblocks.org/source_code.shtml

I applied the patches as indicated by the wiki page, there were many FAILED chunks but anyway, now it built after editing menuutils.cpp and dragscroll.cpp. Some functions TODO had been implemented (by the patches?) without removing the empty TODO declarations.

(I had the naive assumption that patches of some age would go into the fresh distribution, but this was obviously wrong.)

This version of CB does not load the plugins. It is looking for the wrong plugins, or the wrong plugins (names?) are installed.
CB says it wants .zip plugins, but there are only .la and .so files in the plugins folder.
But this would go into another thread.



PluginManager.cpp is looking for name.zip for it manifest.xml file, while MAC plugin names are libname.so etc. So the ziped manifest file name should be libname.zip, not name.zip in .../share/codeblocks.

So if the plugin is named DragScroll.so, the manifest.xml should be ziped into .../share/codeblocks/libDragScroll.zip

Also,
DragScroll and Keybinder have been fixed in SVN and tested on the MAC as of 2006/09/23 SVN 2993
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 24, 2006, 08:20:03 pm
Also,
DragScroll and Keybinder have been fixed in SVN and tested on the MAC as of 2006/09/23 SVN 2993

I've updated the Wiki and removed the workaround patch.
Will update the Portfile when I have built rev 2994 locally.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 24, 2006, 08:41:56 pm
Two things:

1) There is no libdebuggergdb plugin, and CB complains that it cannot load it.
2) There are some failures when applying the plugin patch:

patch -p0 -i codeblocks-rev2890_pluginslib.patch
patching file src/plugins/contrib/codesnippets/Makefile.am
Hunk #1 FAILED at 10.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/contrib/codesnippets/Makefile.am.rej
patching file src/plugins/contrib/profiler/Makefile.am
patching file src/plugins/contrib/wxSmith/defwidgets/Makefile.am
patching file src/plugins/contrib/wxSmith/properties/Makefile.am
patching file src/plugins/contrib/wxSmith/Makefile.am
patching file src/plugins/contrib/wxSmith/resources/Makefile.am
patching file src/plugins/contrib/envvars/Makefile.am
Hunk #1 FAILED at 9.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/contrib/envvars/Makefile.am.rej
patching file src/plugins/contrib/codestat/Makefile.am
patching file src/plugins/contrib/help_plugin/Makefile.am
patching file src/plugins/contrib/byogames/Makefile.am
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/contrib/byogames/Makefile.am.rej
patching file src/plugins/contrib/source_exporter/Makefile.am
patching file src/plugins/contrib/cb_koders/Makefile.am
patching file src/plugins/contrib/keybinder/Makefile.am
patching file src/plugins/contrib/dragscroll/Makefile.am
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/contrib/dragscroll/Makefile.am.rej
patching file src/plugins/astyle/Makefile.am
patching file src/plugins/debuggergdb/Makefile.am
Hunk #1 FAILED at 13.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/debuggergdb/Makefile.am.rej
patching file src/plugins/codecompletion/Makefile.am
patching file src/plugins/todo/Makefile.am
patching file src/plugins/classwizard/Makefile.am
patching file src/plugins/compilergcc/Makefile.am
patching file src/plugins/autosave/Makefile.am
Hunk #1 FAILED at 8.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/autosave/Makefile.am.rej
patching file src/plugins/defaultmimehandler/Makefile.am
patching file src/plugins/xpmanifest/Makefile.am
patching file src/plugins/scriptedwizard/Makefile.am
Hunk #1 FAILED at 12.
1 out of 1 hunk FAILED -- saving rejects to file src/plugins/scriptedwizard/Makefile.am.rej


Is this something to worry about?


Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 24, 2006, 09:12:58 pm
And a third:

contrib does not build byogames:

/usr/bin/ld: Undefined symbols:
byoGameBase::BackToWorkTimer()
byoGameBase::ReloadFromConfig()
byoGameSelect::byoGameSelect(wxWindow*, int)
byoGameSelect::~byoGameSelect()
byoGameLauncher::GetGames()
byoConf::byoConf(wxWindow*, int)
collect2: ld returned 1 exit status
make[4]: *** [libbyogames.la] Error 1
make[3]: *** [all-recursive] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all-recursive] Error 1


If I temporarly disable it by editing the contrib/Makefile and revmove it from SUBDIRS, I can build ok.
make and make install are ok.
After bundling CodeBlocks.app and starting it I notice that there is no complaints about libdebuggergdb.zip anymore.
I have not yet created the contrib .zip files from the manifest.xml files, I hope it will complete the installation.

Is there any chance that all this will be automated in a future ./configure and make process?


Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 24, 2006, 10:12:47 pm
Platform:
PowerMac dual G5 2.3GHz
OSX 10.4.7
wxwidgets 2.6.3
CodeBlocks from svn checkout svn://svn.berlios.de/codeblocks/trunk

All manually created plugins.zip now loads except libwxsmith.zip, which crasches CB at startup.
Is this known?
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 24, 2006, 10:45:16 pm
2) There are some failures when applying the plugin patch:

patch -p0 -i codeblocks-rev2890_pluginslib.patch

Is this something to worry about?

I made an updated patch, codeblocks-rev2994_pluginslib.patch

Some plugins had moved/arrived, since the previous patch was made...
Basically all it is supposed to do is to add $(WX_LIBS) before libcodeblocks
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 24, 2006, 10:50:10 pm
Is there any chance that all this will be automated in a future ./configure and make process?

That is definitely the goal, yes...

The GNU libtool bugs on Mac OS X 10.4 might be hard to "fix" in the autoconf files,
but everything else should be doable like making it compile and link out of the box ?

You will find that the "steps" needed to process are in the DarwinPorts "Portfile (http://www.algonet.se/~afb/wx/codeblocks.Portfile)", even
though it is a machine-readable format it should describe the various commands it does.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 24, 2006, 11:08:26 pm
This version of CB does not load the plugins. It is looking for the wrong plugins, or the wrong plugins (names?) are installed.
CB says it wants .zip plugins, but there are only .la and .so files in the plugins folder.
But this would go into another thread.

PluginManager.cpp is looking for name.zip for it manifest.xml file, while MAC plugin names are libname.so etc. So the ziped manifest file name should be libname.zip, not name.zip in .../share/codeblocks.

So if the plugin is named DragScroll.so, the manifest.xml should be ziped into .../share/codeblocks/libDragScroll.zip

Hmm, wonder when this change happened ?

It used to load happily from the share/codeblocks/dragscroll.zip file just like it does on Linux...
Now it creates the files as "dragscroll.zip", but then tries to load them as "libdragscroll.zip". :-(

Code
Plugin resource not found: libdragscroll.zip

Suggested change:
Code
--- src/sdk/pluginmanager.cpp	(revision 2994)
+++ src/sdk/pluginmanager.cpp (arbetskopia)
@@ -144,7 +144,7 @@
         wxFileName fname(pluginFilename);
         fname.SetExt(_T("zip"));
         wxString actual = fname.GetFullName();
-        #ifdef __WXGTK__
+        #if defined(__WXGTK__) || defined(__WXMAC__)
         // remove 'lib' prefix from plugin name (if any)
         if (actual.StartsWith(_T("lib")))
             actual.Remove(0, 3);
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 25, 2006, 07:50:53 am

Just curious: If CB usually loads the plugins from share/codeblocks, what then is the purpouse of share/codeblocs/plugins?
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 25, 2006, 08:24:43 am
Just curious: If CB usually loads the plugins from share/codeblocks, what then is the purpouse of share/codeblocs/plugins?

It loads the code from codeblocks/plugins/libplugin.so, but
loads the resources from codeblocks/plugin.zip (no idea why)
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 25, 2006, 10:23:00 am
Just to clarify:
For me, plugins only loads if I manually create the libpluginname.zip resources from the manifest.xml in the src/plugins/... and put them in share/codeblocks/plugins together with the lib*.so and lib*.la.
Pluginnames.zip plus some other .zip files already exists in share/codeblocks. If I remove or move pluginnames.zip I get error messages "resource not found", and if I remove the other .zip files I get a crasch.
I tested this because I wanted to see if the .zip files were just in the wrong place. This of course was not the case.


Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 25, 2006, 11:08:53 am
To clarify, I patched my Code::Blocks to look in "pluginname.zip" instead of in "libpluginname.zip". Just like it used to do on Mac, and like it does on Linux...

http://developer.berlios.de/patch/?func=detailpatch&patch_id=1524&group_id=5358

With "no idea why" I meant why the library is in "plugins" and not the resources.
(i.e. not why they are named like they are, but why they are in separate dirs...)
Title: Re: Problems making CB for OSX from wiki instructions
Post by: Pecan on September 25, 2006, 02:44:25 pm
To clarify, I patched my Code::Blocks to look in "pluginname.zip" instead of in "libpluginname.zip". Just like it used to do on Mac, and like it does on Linux...

http://developer.berlios.de/patch/?func=detailpatch&patch_id=1524&group_id=5358

With "no idea why" I meant why the library is in "plugins" and not the resources.
(i.e. not why they are named like they are, but why they are in separate dirs...)

A change was made to the way plugins are loaded.
PluginManager.cpp finds the pluginname.so file in .../share/codeblocks/plugin, but does not load it yet.

It then looks in .../share/codeblocks for a file named pluginname.zip which is supposed to contain a manifest file named manifest.xml . The manifest contains the plugin name, version, UI interface version, author, etc. If all this matches the pluginname.so that was found, the pluginname.so is then loaded.

The devs thought it to be much faster to open a manifest file and validate the plugin, then to load all the pluginname.so files to validate them.



Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 25, 2006, 02:53:49 pm
So, where does this take us?
Assuming that the load process is the way it is for a good reason, what's missing is the generation of the proper files with the proper names in the proper places?
Title: Re: Problems making CB for OSX from wiki instructions
Post by: Pecan on September 25, 2006, 03:07:55 pm
So, where does this take us?
Assuming that the load process is the way it is for a good reason, what's missing is the generation of the proper files with the proper names in the proper places?


The manifest files are delivered in SVN. And with the usual SVN build, the manifest is ziped into pluginname.zip by update.bat or ./update .

What the MAC build needs to do is: zip the manifest.xml that accompanies all plugins into a pluginname.zip and place it into .../share/codeblocks .

On my OSX10.3, the names in .../share/codeblocks/plugins end up being pluginname.so . So I changed ./update to simply zip the manifest from .../trunk/src/plugins/pluginname/manifest.xml to .../trunk/src/devel/share/codeblocks .

Dont forget the contribs if you use any. I ziped the ones I use by hand.


Code
echo Compressing plugins lib resources //(pecan 2006/9/23)
${ZIPCMD} -j9 ${RESDIR}/libastyle.zip plugins/astyle/resources/manifest.xml  > /dev/null
${ZIPCMD} -j9 ${RESDIR}/libautosave.zip plugins/autosave/manifest.xml  > /dev/null
${ZIPCMD} -j9 ${RESDIR}/libclasswizard.zip plugins/classwizard/resources/manifest.xml  > /dev/null
${ZIPCMD} -j9 ${RESDIR}/libcodecompletion.zip plugins/codecompletion/resources/manifest.xml  > /dev/null
${ZIPCMD} -j9 ${RESDIR}/libcompiler.zip plugins/compilergcc/resources/manifest.xml  > /dev/null
${ZIPCMD} -j9 ${RESDIR}/libdefaultmimehandler.zip plugins/defaultmimehandler/resources/manifest.xml  > /dev/null
${ZIPCMD} -j9 ${RESDIR}/libdebugger.zip plugins/debuggergdb/resources/manifest.xml  > /dev/null
${ZIPCMD} -j9 ${RESDIR}/libscriptedwizard.zip plugins/scriptedwizard/resources/manifest.xml > /dev/null
${ZIPCMD} -j9 ${RESDIR}/libtodo.zip plugins/todo/resources/manifest.xml  > /dev/null
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 25, 2006, 04:07:43 pm
I still don't see why the zip names can't be the same on Linux and Macintosh,
i.e. why we shouldn't strip the "lib" prefix from the so before looking for a zip...
Title: Re: Problems making CB for OSX from wiki instructions
Post by: Pecan on September 25, 2006, 04:42:22 pm
I still don't see why the zip names can't be the same on Linux and Macintosh,
i.e. why we shouldn't strip the "lib" prefix from the so before looking for a zip...

I think you can. Then you don't have to mess with the ./update.
But you'd have to do a rename of plugins or some such.

Wait. Doesn't MAC memorize the .so libname in the lib somehow? I seem to remember getting into trouble doing a lib rename. But maybe that was just on a .dylib.

If the rename works on MAC, the the search for the manifest will work the same for Linux and MAC.

For me (I use a home grown Codeblocks-unixMac.cbp), I can simply change the project file to output the libname without the lib. Then it'll all works as delivered.

Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 25, 2006, 04:56:24 pm
Ehrm, I did not suggest replacing the bundle name (libplugin.so)
all I suggested was to make it look for a "plugin.zip" instead...

Did you look at the patch ? I just changed "GTK" to "GTK || Mac"
and it works just like before, when using the regular autoconf.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: Pecan on September 25, 2006, 05:33:01 pm
Ehrm, I did not suggest replacing the bundle name (libplugin.so)
all I suggested was to make it look for a "plugin.zip" instead...

Did you look at the patch ? I just changed "GTK" to "GTK || Mac"
and it works just like before, when using the regular autoconf.
Excellent !!
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 25, 2006, 05:44:31 pm
I think that someone just "forgot" to add a wxMac codepath
when the logic was rewritten with the new manifest search...

The good ole "if (Windows) else (Linux)" logic strikes again ;-)
Title: Re: Problems making CB for OSX from wiki instructions
Post by: mandrav on September 25, 2006, 06:08:45 pm
Quote
Ehrm, I did not suggest replacing the bundle name (libplugin.so)
all I suggested was to make it look for a "plugin.zip" instead...

That's how it works.

Quote
think that someone just "forgot" to add a wxMac codepath
when the logic was rewritten with the new manifest search...

No, I did not "forget" it. I just don't have any experience whatsoever with Macs. So sue me...
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 25, 2006, 06:10:46 pm
No, I did not "forget" it. I just don't have any experience whatsoever with Macs. So sue me...

Sorry, it wasn't meant as critique... We're happy to patch.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: mandrav on September 25, 2006, 06:26:30 pm
No, I did not "forget" it. I just don't have any experience whatsoever with Macs. So sue me...

Sorry, it wasn't meant as critique... We're happy to patch.

That, I know ;).
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 25, 2006, 10:18:38 pm
I built CB with the adviced patches,

./configure --enable-contrib --prefix=$HOME
make
make install

I bundled using the shell script and moving all installation to Contents, nothing except icon in Resources.
CB crashed at startup.
I removed all plugins from share/codeblocks and CB started but complained about plugins failed to load.

I moved plugins back one by one, and found that the any of these plugins made CB crash:

codecompletion.zip
scriptedwizard.zip
todo.zip
wxsmith.zip

However, I did not need to do any manual zipping of manifests, so this seems to work.

One observation was that it complains about "not found" in two passes, first pass on libcodecompletion.zip, second pass on libprofiler.zip, libscriptedwizard.zip, libtodo.zip, libwxsmith.zip.

profiler.zip was actually missing from the set.



 

Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 25, 2006, 11:18:36 pm
profiler.zip was actually missing from the set.

src/plugins/contrib/profiler builds its resources as CBProfiler.zip, not profiler.zip
I believe it (CBProfiler) is also the name of the plugin, from the manifest.xml file.

Code
lib_LTLIBRARIES = libprofiler.la
pkgdata_DATA = CBProfiler.zip

Exception to prove the rule, I suppose...
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 25, 2006, 11:49:24 pm
CBProfiler.zip was there alright, but it was apparently missed by the loader.
If I manually create profiler.zip from its manifest and put it in share/codeblocks, I do not get the load fail on libprofiler.zip.

I also found that the keybinder.zip plugin makes CB crash at quit.

Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 25, 2006, 11:52:46 pm
Would it be of any interest if I posted some (parts of) crash reports?
The report shows rather clearly the chain of events and where the crash occurs.
Or maybe some of you already have reproduced the crashes?
Title: Re: Problems making CB for OSX from wiki instructions
Post by: takeshimiya on September 25, 2006, 11:57:03 pm
afb: could you release a new universal .dmg? I'm getting in the C::B Debug pane lots of "Start here link not found" all the time. Also I can't compile even the most basic program with C::B, it seems to hang while launching gcc.

Also, I've tried to use your macport from the wiki, unfortunately it fails when applying the patches, seems they're outdated (or already applied?).

My platform is MacOS X 10.4.6 Intel (dual core), and I have the Xcode dev. tools 2.4 installed, plus all C::B dependencies installed from straight MacPorts (wxWidgets, etc).

Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 25, 2006, 11:58:14 pm
Would it be of any interest if I posted some (parts of) crash reports?
The report shows rather clearly the chain of events and where the crash occurs.
Or maybe some of you already have reproduced the crashes?

Post somewhere on a web page, and post the URLs ?
I get hangs and lockups, but not too many crashes...

BTW:
There should be a new zip file (rev2994) up shortly.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 26, 2006, 12:00:16 am
afb: could you release a new universal .dmg? I'm getting in the C::B Debug pane lots of "Start here link not found" all the time. Also I can't compile even the most basic program with C::B, it seems to hang while launching gcc.

Yeah, sorry about that debugging gunk - I was trying (unsuccessfully) to fix the links.

New zip file is at BerliOS/incoming, probably posted soon...

Quote
Also, I've tried to use your macport from the wiki, unfortunately it fails when applying the patches, seems they're outdated (or already applied?).

They applied to rev2994, I usually try to specify the revision
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 26, 2006, 12:01:14 am
The scriptedwizard.zip should be removed from the crasher list, sorry about that.
Plugins codecompletion, keybinder, todo, and wzsmith remains.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 26, 2006, 12:23:24 am
See http://medlem.spray.se/bengtnilsson11/plugincrashes.html for crash reports.
Revision is 2995.
I see above that the patches should be applied to 2994. Could this be a problem?
Title: Re: Problems making CB for OSX from wiki instructions
Post by: Pecan on September 26, 2006, 02:16:49 am
See http://medlem.spray.se/bengtnilsson11/plugincrashes.html for crash reports.
Revision is 2995.
I see above that the patches should be applied to 2994. Could this be a problem?


I may be thick, but I dont see where in that crash report that says keybinder crashed.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 26, 2006, 07:44:07 am
I don't say that the keybinder crashed.
I just say that when keybinder.zip is present in share/condeblocks CB crashes at quit, and quits ok when it isn't.

But actually, "not crashing at start or quit" is apparently not a critereia of success. I tried to load a project with my "working" set of plugins, and then it crashed anyway.

But it is difficult for me who has never used CB for real to sy what is working or not.
Maybe some other Mac-owner with more experience should do this.
I think I will take a break for a while and wait for better stability.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 26, 2006, 08:55:41 am
But it is difficult for me who has never used CB for real to sy what is working or not.
Maybe some other Mac-owner with more experience should do this.
I think I will take a break for a while and wait for better stability.

Yeah, it isn't really ready for prime-time just yet - but your help is appreciated!

If you just want to use Code::Blocks on the Mac, would an X11/GTK version help?
(it's possible to build such a version with DarwinPorts, with: +puredarwin-macosx)
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 26, 2006, 09:07:58 am
An X11 version of CB would be useful, absolutely.
Do you have one?
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 26, 2006, 09:26:33 am
An X11 version of CB would be useful, absolutely.

I don't have a standalone version, mainly because I didn't feel like
compiling GTK+ and all of the requirements. However, it is possibly
to build one using DarwinPorts, and a local Portfile repository...

On the Wiki are the files you need, first you build "wxGTK" in
graphics/wxGTK (you need to uninstall the usual "wxWidgets")
and then you build C::B in devel/codeblocks, without wxMac.

Once set up, it's something like:
Code
sudo port install wxGTK
sudo port install codeblocks +puredarwin-macosx
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 26, 2006, 10:30:31 pm
I have a problem getting the parts for this port install:

port install graphics/wxGTK
--->  Fetching wxGTK
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-od.opendarwin.org/wxGTK/2.6.3
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-msn.opendarwin.org/wxGTK/2.6.3
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-bay13.opendarwin.org/wxGTK/2.6.3
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-od.opendarwin.org/
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-msn.opendarwin.org/
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-bay13.opendarwin.org/
Error: Target com.apple.fetch returned: fetch failed
Any suggestions?

port install wxgtk
is not behaving the same way as
cd /opt/local/var/db/dports
port install graphics/wxGTK
although I did /opt/local/bin/portindex, detecting the 3 new ports.
So am a little confused.

Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 26, 2006, 10:31:58 pm
Or maybe it is because of the transition from darwinports to macports?
All f the distfiles sites in this list seems to be own.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 26, 2006, 11:43:17 pm
I have a problem getting the parts for this port install:

port install graphics/wxGTK
--->  Fetching wxGTK
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-od.opendarwin.org/wxGTK/2.6.3
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-msn.opendarwin.org/wxGTK/2.6.3
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-bay13.opendarwin.org/wxGTK/2.6.3
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-od.opendarwin.org/
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-msn.opendarwin.org/
--->  Attempting to fetch patch-soundsdl.diff from http://distfiles-bay13.opendarwin.org/
Error: Target com.apple.fetch returned: fetch failed
Any suggestions?

Sorry, that one is mine:
http://www.algonet.se/~afb/wx/patch-soundsdl.diff

Put it in a directory "files", next to your Portfile:
Code
dports/graphics/wxGTK/Portfile
dports/graphics/wxGTK/files/patch-soundsdl.diff
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 27, 2006, 11:08:13 am
Installation of wxGTK and codeblocks went without errors, but /Applications/CodeBlocks.app does not start.
Any suggestions?
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 27, 2006, 12:16:35 pm
Installation of wxGTK and codeblocks went without errors, but /Applications/CodeBlocks.app does not start.
Any suggestions?

Code
/opt/local/bin/codeblocks --prefix=/opt/local
Perhaps over-explicit, but just making sure...

The bundle is only used for the wxMac version,
maybe I should explain this better on the Wiki.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 27, 2006, 03:43:23 pm
The path seems to be ok.
At normal (double click on CodeBlocks.app) the console log it says:
Error: Unable to initialize gtk, is DISPLAY set properly?

Opening a Terminal window and issuing the command 'codeblocks' at prompt gives the same answer:
mc2-p039:~ bnilsson$ codeblocks
Error: Unable to initialize gtk, is DISPLAY set properly?

Opening a X11 terminal window and issuing the command 'codeblocks' at prompt gives the usual error (X11)dialog window saying resources cannot be found, and the following is displayed repeatedly in the terminal:

(codeblocks:3581): GLib-WARNING **: poll(2) failed due to: Invalid argument.

as long as the error dialog window is open.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 27, 2006, 04:08:19 pm
Just tested /opt/local/bin/gtk-demo, works fine.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 27, 2006, 05:16:47 pm
Opening a X11 terminal window and issuing the command 'codeblocks' at prompt gives the usual error (X11)dialog window saying resources cannot be found, ...

Open a xterm window, and run: /opt/local/bin/codeblocks --prefix /opt/local

Currently prefix detection is a bit rough in the non-bundled version, which is why I want you to run the program with the full path and even the explicit --prefix argument...
I will probably clean it up a bit later, once the other Darwin/GTK patches are accepted.

You do need to start X11 yourself, and set the DISPLAY variable (or run with xterm)
Title: Re: Problems making CB for OSX from wiki instructions
Post by: takeshimiya on September 30, 2006, 08:49:17 am
afb, have you solved the issue of "Code::Blocks can't execute anything" here (http://developer.berlios.de/bugs/?func=detailbug&bug_id=8881&group_id=5358)?

I've been using Intel Mac exclusively lately and this is becoming very annoying, I could build C::B from source, using macports method, and ./configure && make method, however it worked the first time I've done a "make install" but not subsequent times (undefined errors, could be that I'm using the MacOS Rez method, I don't know ...).

I thought it could be a wxExecute bug in wxWidgets 2.6.3 on Intel, so I created a little app to test various of the wxExecute calls and they work right... I'm also using DialogBlocks which is an Intel app and seems to work right too, for calling commands (gcc, make, etc).

So it seems a bug in C::B code.


Let's see if we can solve it first in sdk/toolsmanager.cpp for example.

Have you tried to compile wxWidgets and C::B in debug mode, to see if a debug-mode assert can help?
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 30, 2006, 09:10:21 am
afb, have you solved the issue of "Code::Blocks can't execute anything" here (http://developer.berlios.de/bugs/?func=detailbug&bug_id=8881&group_id=5358)?

Nope, but it's not really a build problem so it isn't listed in this thread.

Works fine on PowerPC, so I will wait with until I have switched to Intel.

Quote
I've been using Intel Mac exclusively lately and this is becoming very annoying, I could build C::B from source, using macports method, and ./configure && make method, however it worked the first time I've done a "make install" but not subsequent times (undefined errors, could be that I'm using the MacOS Rez method, I don't know ...).

I'm not sure what those "undefined errors" are, but I got a lot of problems with DP trying to install old builds of packages that linked to libraries no longer present. Only way to solve that was to rebuild all those from scratch, manually.

So it seems that it has problems tracking dependencies, but that's off-topic too.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: bnilsson on September 30, 2006, 10:41:46 am
A final call to afb on this thread:
I got your codeblocks/wxGTK working but had som keyboard problems in X11, so I put it aside.
I tried the normal darwinport codeblocks/wxWidgets instead and found that rev 3001 worked just as well.
Now to my question:
When I try to debug a wx template project I cannot watch any local variables, instead I get things like this:

Debugger name and version: GNU gdb 6.3.50-20050815 (Apple version gdb-563) (Wed Jul 19 05:17:43 GMT 2006)
No source file named /Users/bnilsson/Documents/Programming/Active/CB projects/wxCB/"app.cpp.
Breakpoint 1 ("/Users/bnilsson/Documents/Programming/Active/CB projects/wxCB/"app.cpp:8) pending.
No source file named /Users/bnilsson/Documents/Programming/Active/CB projects/wxCB/"app.cpp.
Breakpoint 2 ("/Users/bnilsson/Documents/Programming/Active/CB projects/wxCB/"app.cpp:9) pending.
Program exited normally.

I just added some breakpoints and started the debugger. It did not stop at the breakpoints.
Did I miss something or should I report this as a bug?

 
Title: Re: Problems making CB for OSX from wiki instructions
Post by: afb on September 30, 2006, 12:46:54 pm
I think that GDB not finding the source file might be a universal problem,
at least I seem to recall seeing a thread about it on another platform ?

But you might want to report a bug to BerliOS, if there isn't one already.
Title: Re: Problems making CB for OSX from wiki instructions
Post by: Pecan on September 30, 2006, 02:00:15 pm
I just added some breakpoints and started the debugger. It did not stop at the breakpoints.
Did I miss something or should I report this as a bug?

Breakpoint are not honored in constructors or destructors.
You'll have to put the breakpoints in a "dummy" routine called by the constructor.
Thus:
Code
myCtor::myCtor() {myInit();}
myCtor::myInit() {// put breakpoint here; int myint=0;}