News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

[resolved] No targets in New Project wizard

Started by MasterAlexei, October 18, 2013, 07:06:40 AM

Previous topic - Next topic

stahta01

#15
Quote from: stahta01 on October 18, 2013, 02:22:10 PM
Quote from: ollydbg on October 18, 2013, 11:26:07 AM
Quote from: ollydbg on October 18, 2013, 11:17:23 AM
I'm building C::B now, I have deleted the folder: cb_trunk\src\.objs, where the gch files locates.
Let me wait for the result.
Bad news: the result is that I still have this issue.
I'm using wxWidgets 2.8.12, WinXP, MinGW-build-dwarf2-4.8.1-compiler-suite.


I had the issue using wx 2.8 branch, Win7 SP1 32-bit, TDM SJLJ 4.8.1 compiler.

Now trying 4.7.1 compiler.

Special steps taken:
Deleted objects folder before build
Deleted devel/share Folder before build
Deleted output Folder after build before update.bat

Tim S.

Repeated steps except using 4.7.1 compiler; and, I did NOT see the problem.

Edit: Changed back to using 4.8.1 Compiler (but added the compiler option -Wno-unused-local-typedefs to reduce warnings)
The problem did NOT show back up.

Edit2: I realized I built the bad version using CB svn 9156; trying again using that CB version to see if problem happens again.
Edit3: Found no problem using CB svn 9156 to build; no idea why the first time had a problem.

Tim S.
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

ollydbg

#16
I debugged this bug for a while, and I found a strange problem:
In the function:

NewFromTemplateDlg::NewFromTemplateDlg(TemplateOutputType initial, const wxArrayString& user_templates)
   : m_Template(0L),
   m_pWizard(0L),
   m_WizardIndex(-1)
{
   //ctor
   wxXmlResource::Get()->LoadObject(this, 0L, _T("dlgNewFromTemplate"),_T("wxScrollingDialog"));
   m_Wizards = Manager::Get()->GetPluginManager()->GetOffersFor(ptWizard);

   wxListbook* lb = XRCCTRL(*this, "nbMain", wxListbook);
   SetSettingsIconsStyle(lb->GetListView(), sisNoIcons);
/*
   // create image lists
   XRCCTRL(*this, "listProjects", wxListCtrl)->SetImageList(new wxImageList(32, 32), wxIMAGE_LIST_NORMAL);
   XRCCTRL(*this, "listProjects", wxListCtrl)->SetImageList(new wxImageList(32, 32), wxIMAGE_LIST_SMALL);
   XRCCTRL(*this, "listTargets", wxListCtrl)->SetImageList(new wxImageList(32, 32), wxIMAGE_LIST_NORMAL);
   XRCCTRL(*this, "listTargets", wxListCtrl)->SetImageList(new wxImageList(32, 32), wxIMAGE_LIST_SMALL);
   XRCCTRL(*this, "listFiles", wxListCtrl)->SetImageList(new wxImageList(32, 32), wxIMAGE_LIST_NORMAL);
   XRCCTRL(*this, "listFiles", wxListCtrl)->SetImageList(new wxImageList(32, 32), wxIMAGE_LIST_SMALL);
   XRCCTRL(*this, "listCustoms", wxListCtrl)->SetImageList(new wxImageList(32, 32), wxIMAGE_LIST_NORMAL);
   XRCCTRL(*this, "listCustoms", wxListCtrl)->SetImageList(new wxImageList(32, 32), wxIMAGE_LIST_SMALL);

   // load view prefs
   XRCCTRL(*this, "rbView", wxRadioBox)->SetSelection(Manager::Get()->GetConfigManager(_T("new_from_template"))->ReadInt(_T("/view"), 0));
   ChangeView();

   BuildCategories();
   BuildList();

   // fill user templates list
   XRCCTRL(*this, "lstUser", wxListBox)->Clear();
   for (unsigned int i = 0; i < user_templates.GetCount(); ++i)
   {
       XRCCTRL(*this, "lstUser", wxListBox)->Append(user_templates[i]);
   }

   lb->SetSelection((int)initial);*/
}

You see, I have comment out all the operations on the dialog, but the wxListBook control still not shown correctly.

When I open the xrc in the wxsmith editor, I can see the default dialog should be like this (see the image shot below)


EDIT:
It looks like the option: Resize border should be enabled compared with other xrc, but when I enabled this, I still have this issue.

EDIT2
I can easily add a new button, but the wxListBook still not shown, I'm no idea how to fix it. (see the screen shot below)



If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

I will try to get a deeper look into it, but I need to install C::B, C::B sources, wxWidgets and MinGW to test.
This will probably need some time.

ollydbg

I think it is better we can have a Codeblocks_debugwx.cbp file which link to the debug version of wx library, so that catch bugs in wx is quite easy. :)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

It looks like wxLC_LIST is broken on WinXP, so my changes in svn r9390 to SetSettingsIconStyle break the NewFromTemplateDllg on Windows XP (not win7 !).
Using wxLC_SMALL_ICON instead of wxLC_LIST work non XP. If it does work on win7 (wx2.8 and wx2.9+) I commit this fix, otherwise, I will find another solution.

Jenna

Could you please check, whether the issue is fixed in svn r9405 ?

ollydbg

Quote from: jens on October 19, 2013, 02:17:37 PM
Could you please check, whether the issue is fixed in svn r9405 ?
Thanks. It works fine now! Great work.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

cacb

I have just installed Kubuntu 13.10 and compiled C::B using Jens' tarball codeblocks_12.11svn9393.orig.tar.gz against wx 2.8.12 as provided by Kubuntu 13.10. The C::B start screen shows
svn build rev 9393 (2013-10-08 09:17:30) gcc 4.8.1 Linux/unicode - 32 bit

If I try the project wizard, there are no targets as mentioned in this thread.

Another issue that I noticed, was that the compilation was unusually slow. I didn't time it or watch it, but it seemed to take forever.

For my own projects, I also use wx 2.8.12, but compile and link it statically. As I compiled wx, I noticed there was a huge number of warnings being issued about "unused local typedefs" in wx/defs.h and perhaps other places. Writing all these warnings took a loooong time. This appears to be a side effect of gcc 4.8.1, but so far I have not found any way to switch those warnings off. Suggestions welcome.

ollydbg

Quote from: cacb on October 20, 2013, 10:37:06 AM
For my own projects, I also use wx 2.8.12, but compile and link it statically. As I compiled wx, I noticed there was a huge number of warnings being issued about "unused local typedefs" in wx/defs.h and perhaps other places. Writing all these warnings took a loooong time. This appears to be a side effect of gcc 4.8.1, but so far I have not found any way to switch those warnings off. Suggestions welcome.

add the compiler option -Wno-unused-local-typedefs to reduce warnings. Or manually remove this dummy typedef in the wx source.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Jenna

Before running the configure-script just do a export CXXFLAGS="-Wno-unused-local-typedefs" in the console.
The other issue is fixed later and there are more fixes to the settings-dialogs I am working on.
I will commit them most likely this afternoon/evening/night, but it's always much to test (WinXP, Win7, Liinux and wx2.8 and wxtrunk).

cacb

Quote from: jens on October 20, 2013, 11:05:08 AM
Before running the configure-script just do a export CXXFLAGS="-Wno-unused-local-typedefs" in the console.
The other issue is fixed later and there are more fixes to the settings-dialogs I am working on.
I will commit them most likely this afternoon/evening/night, but it's always much to test (WinXP, Win7, Liinux and wx2.8 and wxtrunk).

Thanks a lot, but I believe that option (-Wno-unused-local-typedefs) is removed in gcc 4.8.1. I tried, and it doesn't work. I believe the opposite (-Wunused-local-typedef) is now implicit in -Wall, without any way of turning it off. A last resort solution is to start fiddling with wx 2.8.12 source, but it isn't ideal.

I shall watch your C::B folder and try again when I see the update. Your work is much appreciated!

Jenna

I use it here and it works with gcc4.8 on Fedora.

cacb

Quote from: jens on October 20, 2013, 11:26:59 AM
I use it here and it works with gcc4.8 on Fedora.

Ok, i will double check. Thanks again.

cacb

Quote from: cacb on October 20, 2013, 11:30:38 AM
Quote from: jens on October 20, 2013, 11:26:59 AM
I use it here and it works with gcc4.8 on Fedora.

Ok, i will double check. Thanks again.

I have double checked now, and you are correct again  :) Somehow, I messed up the first time.

To suppress all wx 2.8 warnings (rightly or wrongly), I found I had to use these two options:
-Wno-unused-local-typedefs
-Wno-literal-suffix


As I have many code::blocks projects with several targets in each, it isn't straghtforward to update them all. As a temporary solution I have therefore enabled the two options above as global C::B compiler settings for gcc. A better solution would be to use some tool to add them to my project files, I guess.

Jenna

If you just build C::B, you can add them to the  cb_release_type global-variable. That covers most (not all) C::B projects.