News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

building wxWidget on Kubuntu

Started by devguy, April 17, 2011, 05:00:41 AM

Previous topic - Next topic

devguy

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

devguy

Quote from: jens 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.

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

devguy

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

MortenMacFly

Quote from: jens on April 17, 2011, 08:31:43 PM

  • Create an empty project with the wizard,
  • [...]
Quote from: devguy on April 18, 2011, 05:27:05 AM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

Jenna

Quote from: MortenMacFly on April 18, 2011, 07:03:05 AM
Quote from: jens on April 17, 2011, 08:31:43 PM

  • Create an empty project with the wizard,
  • [...]
Quote from: devguy on April 18, 2011, 05:27:05 AM
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).

devguy

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

MortenMacFly

Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

devguy

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

Boleczek

Quote from: jens 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.

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]

jarod42

Quote from: BoleczekI 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.

Jenna

Quote from: Boleczek on September 26, 2012, 11:21:41 PM
[...]
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.

Quote from: Boleczek on September 26, 2012, 11:21:41 PM
  • 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.
Quote from: Boleczek on September 26, 2012, 11:21:41 PM
  • 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.

Quote from: Boleczek on September 26, 2012, 11:21:41 PM
  • 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.