Author Topic: Newbie question: Trying to build a win32 application  (Read 1567 times)

Offline paul_king

  • Single posting newcomer
  • *
  • Posts: 9
Newbie question: Trying to build a win32 application
« on: August 23, 2019, 04:38:45 am »
I am new to CB, and new to programming in a Windows environment generally.

I am currently using MS Visual Studio 2019 (Community Edition), and it is working quite well, except that it is not going to be the IDE where I teach: Code Blocks will be one of the IDEs.

I was hoping to use CB to create windowed applications under Windows 10. The closest thing you offer is the Win32 libraries. This is fine, but will this work with the UNIX-based GNU-C++ compiler, which is default? They sound strange together. Would it be better to use wxWidgets?

Which would offer the better IDE, wxWidgets/wxSmith or Win32?

Paul

Offline paul_king

  • Single posting newcomer
  • *
  • Posts: 9
Re: Newbie question: Trying to build a win32 application
« Reply #1 on: August 23, 2019, 04:51:32 am »
Replying to my own thread, it appears as if they do in fact work together. I tested it.

I would have liked to see what they have in Visual Studio -- a way to visually place widgets together on a windows form using drag-and-drop. Is there a way to do this? It's pretty hard doing this in the abstract.

Also, is there an equivalent to an object inspector, where you can adjust widget properties and placement manually?

Paul
« Last Edit: August 23, 2019, 04:55:50 am by paul_king »

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2566
Re: Newbie question: Trying to build a win32 application
« Reply #2 on: August 23, 2019, 08:20:43 am »
Codeblocks supports wxWidgets with an visual editor. wxWidgets is a cross platform window frame work, that uses the native controls on every platform, so it looks like a native application on every platform...

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 381
Re: Newbie question: Trying to build a win32 application
« Reply #3 on: August 23, 2019, 02:04:12 pm »
Also, is there an equivalent to an object inspector, where you can adjust widget properties and placement manually?

You can use wxSmith or wxFormBuilder.

Offline paul_king

  • Single posting newcomer
  • *
  • Posts: 9
Re: Newbie question: Trying to build a win32 application
« Reply #4 on: August 23, 2019, 04:26:05 pm »
I am glad to hear that a visual editor is supported. But is this visual editor coming from wxSmith? When I use it, I can't seem to locate the form editor. It is doesn't appear to be in the menus, toolbar, or any tabs I can find. Do I need to install both wxWidgets and wxSmith?

For the record, when I run the skeleton code from using wxSmith, I get a console which launches a blank window (telling me that wxSmith was at least doing something).

Paul

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 381
Re: Newbie question: Trying to build a win32 application
« Reply #5 on: August 23, 2019, 11:28:47 pm »
wxSmith is integrated in Code::Blocks as a plugin (and is enabled by default).

You must install wxWidgets (a precompiled version if available for your compiler or one compiled by yourself from sources).
Then you can select File -> New -> Project -> wxWidgets Project and use the resources panel on the left side to select the frame created by the wizard and edit it.

Later, the wxSmith menu entry allows creation of new frames or dialogs.
« Last Edit: August 23, 2019, 11:30:42 pm by Miguel Gimenez »

Offline paul_king

  • Single posting newcomer
  • *
  • Posts: 9
Re: Newbie question: Trying to build a win32 application
« Reply #6 on: August 24, 2019, 01:47:34 pm »
I see from the 7z binary I chose for wxWidgets (the one for Visual C++ 10), that everything is dumped into a library called lib/, and according to the Code::Blocks page here (at https://wiki.wxwidgets.org/Using_wxWidgets_Pre-Built_Binary_in_CodeBlocks), having an include/ directory seems important. I don't have one, unless I download the source for wxWidgets, which I didn't see mentioned in that page. Is this what they intended?

Paul

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 381
Re: Newbie question: Trying to build a win32 application
« Reply #7 on: August 24, 2019, 02:43:56 pm »
There are three 7z files, you must use at least the first two.
« Last Edit: August 24, 2019, 02:46:10 pm by Miguel Gimenez »

Offline paul_king

  • Single posting newcomer
  • *
  • Posts: 9
Re: Newbie question: Trying to build a win32 application
« Reply #8 on: August 24, 2019, 03:10:10 pm »
I'm not sure what you mean by "the first two". I see only one chicklet to click on: "Download windows Binaries". THis is on the page https://www.wxwidgets.org/downloads/, to be clear. Do you mean the first two versions?

Paul

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 381
Re: Newbie question: Trying to build a win32 application
« Reply #9 on: August 24, 2019, 03:30:19 pm »
I am referring to the link you posted in reply #6. In the link in reply #8 you have a link to the header files just at the top of the page.

Offline paul_king

  • Single posting newcomer
  • *
  • Posts: 9
Re: Newbie question: Trying to build a win32 application
« Reply #10 on: August 24, 2019, 05:14:25 pm »
In reply #6, the link is to the wxWidgets wiki, which links to the download page in #8. I know I also downloaded binaries frm SourceForge, but there are no separate header file archives there either (this is at https://sourceforge.net/projects/wxwindows/files/3.0.2/binaries/). If there is yet a third place the binaries and headers could be downloaded from which provide the correct binaries and headers understood by Code::Blocks, could you please provide a link specifically to that page, to make our discussion less confusing?

None of the libraries I have downloaded appear to be understood by Code::Blocks. These ones were specific to Visual C++ 2010, which is installed.

Offline Miguel Gimenez

  • Regular
  • ***
  • Posts: 381
Re: Newbie question: Trying to build a win32 application
« Reply #11 on: August 24, 2019, 05:54:09 pm »
Under Download Windows Binaries you have all versions, not too difficult:

https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxWidgets-3.1.2-headers.7z
https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.2/wxMSW-3.1.2_vc100_Dev.7z

Code::Blocks don't need to understand that files, it is your compiler who must understand them.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6671
    • My Best Post
Re: Newbie question: Trying to build a win32 application
« Reply #12 on: August 25, 2019, 02:04:55 am »
I am currently using MS Visual Studio 2019 (Community Edition), and it is working quite well, except that it is not going to be the IDE where I teach: Code Blocks will be one of the IDEs.

Paul

What compiler(s) are you going to be using?

Edit: Your post implied a version of GCC; which version of GCC?
Is it mingw.org or mingw64 based?
What GCC version number?


Tim S.
« Last Edit: August 25, 2019, 02:09:52 am by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline paul_king

  • Single posting newcomer
  • *
  • Posts: 9
Re: Newbie question: Trying to build a win32 application
« Reply #13 on: August 26, 2019, 02:36:32 am »
Hard to say at this point, since the school board's IT team hasn't properly configured Code::Blocks either. I am trying to get this working on my laptop.

I installed Code::Blocks on two computers. Most of my postings concerned the PC, where DevC++ is not installed but Cygwin and VS2010 are. The only C++ compiler CB detected was from VS2010. I had too much course planning to do, so I abandoned that installation rather than reckon with what appears to be an unwieldy situation, after way too many error messages, hours and days spent, and postings about it.

For the record, the version of G++ that it appears to be using (version number doesn't appear in CB) according to DevC++: TDM-GCC 4.9.2 (64 bit). I don't know what "TDM" stands for, but it is GPL 3. For completeness, the version of GCC on Cygwin is 7.4.0, with no funny acronyms.

The laptop still has CB, VC++2019 and DevC++ on it, and I checked, and GNU C++ is the default compiler (probably inherited from DevC++). The latter two work perfectly. As you may know, DevC++ comes with its own GNU C/C++ compiler. I am imagining that I will end up using DevC++, even though it does not appear to have a way to make windowed apps in a RAD environment. I can still teach using the console, and use Java or Python for windowed apps if needed.

Paul
« Last Edit: August 26, 2019, 02:42:01 am by paul_king »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6671
    • My Best Post
Re: Newbie question: Trying to build a win32 application
« Reply #14 on: August 26, 2019, 02:45:31 am »
Hard to say at this point, since the school board's IT team hasn't properly configured Code::Blocks either. I am trying to get this working on my laptop.

If the school board IT team refuses to tell you what compilers there is to use; then, it is unlikely we can help you very much.

Quote
DevC++: TDM-GCC 4.9.2

Is even older than the GCC shipped with some Code::Blocks windows installs.
But, I think you said it was 64 bit which is better the Code::Blocks newer 32 bit GCC.

Tim S.

C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org