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

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #15 on: April 18, 2011, 01:28:33 am »
yes I am going to give jens step a go, i just need to step away from the PC and relax my mind! currently i am all over the place with wxWidgets, CB, NB, KDbg and wx-config  :P
Kind Regards,
Rajinder Yadav

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #16 on: April 18, 2011, 04:36:28 am »
  • 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.

Jens I followed these steps and was able to get something to build, however when I try to run the app from CB I keep getting an error box that says, "It seems this Project has not been built yet? Do you want to build it now?"

if I look in the folder the binary is there, if i delete it, it does get rebuilt also.
Kind Regards,
Rajinder Yadav

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
[SOLVED] Re: building wxWidget on Kubuntu
« Reply #17 on: April 18, 2011, 05:27:05 am »
ok following Jens steps I was able to get things going, however I need to also do the following steps:

right click on project properties
select "Build targets" tab
1) correct execution working folder to point to location of binary
2) correct output filename field to contain either a relative path or absolute path with filename

i can now build, run and debug the sample apps using CB, thanks everyone for you help!  :P
Kind Regards,
Rajinder Yadav

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: building wxWidget on Kubuntu
« Reply #18 on: April 18, 2011, 07:03:05 am »
  • Create an empty project with the wizard,
  • [...]
right click on project properties
select "Build targets" tab
1) correct execution working folder to point to location of binary
2) correct output filename field to contain either a relative path or absolute path with filename
Jens/devguy, might that be something to put into the WiKi?!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: building wxWidget on Kubuntu
« Reply #19 on: April 18, 2011, 08:04:43 am »
  • Create an empty project with the wizard,
  • [...]
right click on project properties
select "Build targets" tab
1) correct execution working folder to point to location of binary
2) correct output filename field to contain either a relative path or absolute path with filename
Jens/devguy, might that be something to put into the WiKi?!
Surely yes.

@devguy:
sorry I forgot, that you have to fix the filename and execution working directory accordingly (I often also forget it, if I use a custom makefile project for wxWidgets sample also).

And it can make sense to import win32 projects, because they can (in many cases) be build on linux with a cross-compiler for windows (I do it sometimes).

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #20 on: April 18, 2011, 08:34:59 am »
Jens, MortenMacFly:

I took what I was able to collect here and since I am ramping up to help on the wxWidgets projects, I added an entry on the wxWiki site in case anyone else wants to use C::B for some hacking :P

http://wiki.wxwidgets.org/Code::Blocks

Thank again to everyone for all the help!
Kind Regards,
Rajinder Yadav

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: building wxWidget on Kubuntu
« Reply #21 on: April 18, 2011, 08:45:51 am »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline devguy

  • Multiple posting newcomer
  • *
  • Posts: 20
    • DevMentor
Re: building wxWidget on Kubuntu
« Reply #22 on: April 19, 2011, 02:09:59 am »
i know what you meant =) .... i captured it for developers who in the future might want to help out wxWidgets and need an IDE to build and debug code, think of it as a way to champion CB
Kind Regards,
Rajinder Yadav

Offline Boleczek

  • Single posting newcomer
  • *
  • Posts: 3
Re: building wxWidget on Kubuntu
« Reply #23 on: September 26, 2012, 11:21:41 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.

I spent a whole day trying to open and build a wxWidgets sample project using the above steps and finally gave up. I have wxWidgets 2.8.12 and Code Blocks 10.05 (came with mingw32 gcc compiler). A description of the sample project which I would like to run is found here:
http://docs.wxwidgets.org/trunk/page_samples.html#page_samples_sockets
The project files can be found online here: http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/samples/sockets/
These files were installed on my windows machine with wxWidgets and are placed in this directory: C:\wxWidgets-2.8.12\samples\sockets
I usually create projects here: C:\Program Files\Code Blocks\projects

Can you please explain some of your steps:

  • Create an empty project with the wizard,
If the sample project uses frames shouldn't I create an "wxWidgets project" and use wxSmith? I called the project "My" since the cpp files use "MyFrame". Should I copy the sample project files into the same directory as the newly created "My" CB project?

  • adjust the makefiles-name and probably its path (if needed, default path is the projects bas path),
Can you please check the attached screen shots and if wrong let me know what they should be?

  • fix the make commands (most likely needed),
How do I fix them and what do I set them to?

  • click "Add files" or "Add files recursively",
Which files need to be added to the CB project? Is it enough with the .cpp files?

Would much appreciate your help - thank you!



[attachment deleted by admin]

[attachment deleted by admin]

Offline jarod42

  • Multiple posting newcomer
  • *
  • Posts: 87
Re: building wxWidget on Kubuntu
« Reply #24 on: September 27, 2012, 10:05:30 am »
Quote from: Boleczek
I usually create projects here: C:\Program Files\Code Blocks\projects

I would suggest to create project in a directory
- not under 'c:\Program Files\' (where permission is special).
- without space in it path.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: building wxWidget on Kubuntu
« Reply #25 on: September 27, 2012, 10:33:21 am »
[...]
Can you please explain some of your steps:

  • Create an empty project with the wizard,
If the sample project uses frames shouldn't I create an "wxWidgets project" and use wxSmith? I called the project "My" since the cpp files use "MyFrame". Should I copy the sample project files into the same directory as the newly created "My" CB project?
Not if it is an existing project.
The template creates a new project from our wxwidgets template.

  • adjust the makefiles-name and probably its path (if needed, default path is the projects bas path),
Can you please check the attached screen shots and if wrong let me know what they should be?
On linux the makefile name is makefile.unx and the execution-dir for it is the directory it is locate in.
  • fix the make commands (most likely needed),
How do I fix them and what do I set them to?

At least remove the references to $(target) or make sure they point to valid targets inthe makefile.

  • click "Add files" or "Add files recursively",
Which files need to be added to the CB project? Is it enough with the .cpp files?

All you need, at least all sources and headers.
I suggest to add also the makefile.

But even in this case, it will not work as easy as you might think with the sockets sample.
You get four executables here and at least two have to be started by you (client and server) and if you want to debug both at the same time, you (obviously) need two running instances of C:B, one for the client and one for the server.

If you get problems compiling the sample with C::B try it from commandline first.
The sockets sample from trunk (some weeks old) is not compilable, it bails out with multiple undefined references, even if I try to cmpile it in a console.
Either I miss something or it is broken.
But it might work in 2.8.