Author Topic: building wxWidget on Kubuntu  (Read 10602 times)

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
building wxWidget on Kubuntu
« on: April 17, 2011, 05:00:41 am »
hello in my effort to learn how to use wxWidgets, i've downloaded the wxwidgets code from svn head and was able to build it to install at /var/local

i would like to know how i can use import the wxwidget sample code into codeblocks and start to build it, also how can i setup codeblocks so that it will allow me to view the UI resource with wxSmith

Thanks!
Kind Regards,
Rajinder Yadav

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: building wxWidget on Kubuntu
« Reply #1 on: April 17, 2011, 09:51:40 am »
i would like to know how i can use import the wxwidget sample code into codeblocks and start to build it, also how can i setup codeblocks so that it will allow me to view the UI resource with wxSmith
Use the associated project wizard for this purpose. File -> New -> Project... -> Pich "wxWidgets" and follow the instructions.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline cacb

  • Regular
  • ***
  • Posts: 399
Re: building wxWidget on Kubuntu
« Reply #2 on: April 17, 2011, 04:26:18 pm »
hello in my effort to learn how to use wxWidgets, i've downloaded the wxwidgets code from svn head and was able to build it to install at /var/local

i would like to know how i can use import the wxwidget sample code into codeblocks and start to build it, also how can i setup codeblocks so that it will allow me to view the UI resource with wxSmith

Thanks!

Hi, you may find http://arnholm.org/cpde/cpde_20101120.pdf to be of some help.

Among other things, it describes a script for building wxWidgets on Linux. If you have installed a special version of wxWidgets, in my experience you need to take special care in using the correct "wx-config" when compiling and linking, or else you can get the wrong public one. I have wxwidgets installed under /usr/local, and the way I have been able to make 100% sure I am using the right one, is with the follwing compiler setting (notice the backticks)

Code: [Select]
´/usr/local/bin/wx-config --version=2.8 --toolkit=gtk2 --cxxflags´
and in linker options
Code: [Select]
´/usr/local/bin/wx-config --version=2.8 --toolkit=gtk2 --static=yes --libs´

(In the future, I am hoping to be able to use a global variable instead of the hard coded path to wx-config). As you can see, I am using static libs for wxWidgets. YMMV.

wxSmith should be included in Code::Blocks. At least it is in the nightlies I use.

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #3 on: April 17, 2011, 07:35:52 pm »

Use the associated project wizard for this purpose. File -> New -> Project... -> Pich "wxWidgets" and follow the instructions.
[/quote]

I think this is for new project, what I need to do is import an existing project. I was able to use netbeans to import the project by pointing to the makefile and it was painless to setup. Can I do the samething with CodeBlocks?
Kind Regards,
Rajinder Yadav

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: building wxWidget on Kubuntu
« Reply #4 on: April 17, 2011, 07:55:31 pm »
Yes, you can create "Custom makefile projects".
Search the forum, wiki and docs for details...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #5 on: April 17, 2011, 08:18:43 pm »
Yes, you can create "Custom makefile projects".
Search the forum, wiki and docs for details...

i googled, 'site:forums.codeblocks.org importing makefile'

i am not finding a solution? i am seeing posts that claim it is not possible??

i am talking about importing a makefile project, not creating one? netbeans does this effortlessly, no settings to tweaks, or going into project settings and adding variables, etc.

this is pretty much what I am expecting from C::B, it would be nice to if there is a simple way to set up a makefile project so i can build and step through the code
« Last Edit: April 17, 2011, 08:21:20 pm by devguy »
Kind Regards,
Rajinder Yadav

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #6 on: April 17, 2011, 08:30:15 pm »
Quote
Hi, you may find http://arnholm.org/cpde/cpde_20101120.pdf to be of some help.

Thanks for the document, I'll have to read through it, as well as google  on wx-config.

Quote
If you have installed a special version of wxWidgets, in my experience you need to take special care in using the correct "wx-config" when compiling and linking, or else you can get the wrong public one. I have wxwidgets installed under /usr/local, and the way I have been able to make 100% sure I am using the right one, is with the follwing compiler setting (notice the backticks)

Code: [Select]
´/usr/local/bin/wx-config --version=2.8 --toolkit=gtk2 --cxxflags´
and in linker options
Code: [Select]
´/usr/local/bin/wx-config --version=2.8 --toolkit=gtk2 --static=yes --libs´

As for the placement of the wx-config command, where would I put it in C::B ? Is that outlined in the document, thanks!
Kind Regards,
Rajinder Yadav

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: building wxWidget on Kubuntu
« Reply #7 on: April 17, 2011, 08:31:43 pm »
  • Create an empty project with the wizard,
  • right click the project in the management pane,
  • chose "Properties",
  • check "This is a custom makefile",
  • adjust the makefiles-name and probably its path (if needed, default path is the projects bas path),
  • close the "Properties" dialog,
  • right click the project in the management pane,
  • chose "Build options"
  • open the "Make commands" tab (rightmost),
  • fix the make commands (most likely needed),
  • close the dialog
  • right click the project in the management pane,
  • click "Add files" or "Add files recursively",
  • add the files you want to your project,
  • save your project (via menu, context menu or ALT+SHIFT+S)
This works flawlessly for the wxWidgets samples on linux, on windows, I sometimes (always?, do not remember exactly, I use linux almost every time) have to add the options used to build wxWidgets to the makefile-call.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7265
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: building wxWidget on Kubuntu
« Reply #8 on: April 17, 2011, 08:35:31 pm »
As for the placement of the wx-config command, where would I put it in C::B ? Is that outlined in the document, thanks!

If you use existing makefiles, you don't use C::B's build-system (obviously) and the call to wx-config has to be inside the makefile, you might need to fix it manually if you are forced to use special wx-config versions, or link the default wx-config to the one you want to use (either manually or with "update-alternatives").

For other cases, it's the easiest way to create a wizard-based wxWidgets-project and look how it is done there.

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #9 on: April 17, 2011, 09:45:52 pm »
Jens, it's seems a lot involved than it needs to be vs NB IDE. For someone new to the Linux open source world, there is just too much to learn just to get going with a simple project imho!

Jens for someone like yourself it might not seem like a big deal to go through the steps you outlined, but where I stand now, it just too much tinkering which I am trying to make sense of.

CodeBlocks needs a painless makefile project importer, I think I am going to stick with NB where I need to import a project using only a makefile. C::B could learn something from NB!
« Last Edit: April 17, 2011, 09:52:06 pm by devguy »
Kind Regards,
Rajinder Yadav

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: building wxWidget on Kubuntu
« Reply #10 on: April 17, 2011, 10:09:44 pm »
CodeBlocks needs a painless makefile project importer, I think I am going to stick with NB where I need to import a project using only a makefile. C::B could learn something from NB!
Yes, someone should write a project template for custom makefiles, simple as that...

The thing is that C::B assumes that you know what you're doing when dealing with custom makefile projects and so the steps are no problem for you.

Importing makefile projects (turning them in C::B native projects) is pretty much impossible, one should write a make implementation to do it right.
Won't happen in C::B, 99%...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #11 on: April 17, 2011, 11:05:09 pm »
CodeBlocks needs a painless makefile project importer, I think I am going to stick with NB where I need to import a project using only a makefile. C::B could learn something from NB!
Yes, someone should write a project template for custom makefiles, simple as that...

The thing is that C::B assumes that you know what you're doing when dealing with custom makefile projects and so the steps are no problem for you.

Importing makefile projects (turning them in C::B native projects) is pretty much impossible, one should write a make implementation to do it right.
Won't happen in C::B, 99%...

well being a Windows software developer, I could also say C::B could assume that I knows what I'm doing with Visual Studio projects, but today there is a importer to make things easy.

I don't know why I need to import a Win32 DLL project so I can work on it from Linux, with all the Win32 compiler pre-processor that don't make sense on Linux, but CB blindly & happily sets up a CB projects anyway.

the "custom" makefile is not something I created, but something someone else created, for CB to assume I know what I am doing is false

I guess what I am getting at, is when the folks at C:B change their language and possibly mindset towards creating a makefile importer, nothing will ever get done and it will always seem impossible, but it's not, unless core knowledge left CB with developers who are no longer a part of this project?

is it possible to have CB just work with a makefile project, i really don't care about having a CB project created, I just want to load said project, build it and then be able to debug the source, the makefile could be left as is.
« Last Edit: April 17, 2011, 11:34:05 pm by devguy »
Kind Regards,
Rajinder Yadav

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: building wxWidget on Kubuntu
« Reply #12 on: April 17, 2011, 11:32:18 pm »
well being a Windows software developer, I could also say C::B could assume that I knows what I'm doing with Visual Studio projects, but today there is a importer to make things easy.
VS projects are easier to parse, way easier, than Makefiles, that is why there is such a feature. (Someone needed it and have contributed the code to C::B)
Makefiles on the other hand are a set of rules and each rule can be arbitrary command, there are variables that can be expanded, also you could have nested Makefiles, pretty complex.
C::B gives you the possibility to use the Makefile unaltered. It is a bit complex to setup at the moment, but it could be simplified with a project template (simple script).
I don't understand what is your problem  :lol:

I don't know why I need to import a Win32 DLL project so I can work on it from Linux, with all the Win32 compiler pre-processor that don't make sense on Linux, but CB blindly & happily sets up a CB projects anyway.
And the imported project compiles without modifications? I doubt...

the "custom" makefile is not something I created, but something someone else created, for CB to assume I know what I am doing is false
I meant that this option is for the people who know what a makefile is and how to write one, so they are comfortable with it and want to use it instead of C::B's native build system.

I guess what I am getting at, is when the folks at C:B change their language and possibly mindset towards creating a makefile importer, nothing will ever get done and it will always seem impossible, but it's not, unless core knowledge left CB with developers who are no longer a part of this project?
Hm, it you so desperately need this feature provide a patch?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #13 on: April 17, 2011, 11:59:36 pm »
all i wanted to do was be able to build a open source project like wxWidgets and be able to walk through the code, since I am new too all this (on Linux) asking me to provide a patch is kind of pushing it :P ...i'm trying my best just to get started to make contributions to wxWidget project.

also since NB already lets me load up a project from a "custom" makefile, build and debug from it's IDE, its easier to use another tool, it doesn't make sense for me to provide a patch. however if I was a CB developer, i'd worry about making the project more attractive as the go-to IDE  8)
Kind Regards,
Rajinder Yadav

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 12122
    • Travis build status
Re: building wxWidget on Kubuntu
« Reply #14 on: April 18, 2011, 12:14:29 am »
all i wanted to do was be able to build a open source project like wxWidgets and be able to walk through the code, since I am new too all this (on Linux) asking me to provide a patch is kind of pushing it :P ...i'm trying my best just to get started to make contributions to wxWidget project.
But you can do it, see the Jens post...
It is not one click job, but 20 clicks, big deal.

p.s. there isn't one IDE to rule them all, unfortunately :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]