Author Topic: Global Variable Use  (Read 5280 times)

Offline Waingrove

  • Single posting newcomer
  • *
  • Posts: 7
Global Variable Use
« on: March 29, 2020, 10:37:23 pm »
Installed Code::Blocks 17.12
Installed wxWidgets-3.0.4: Successfully ran the minimal project with mingw32-make.exe .
I created two builds of wxWidgets, wxBuild_debug  and wxBuild_release. Both are in the wxWidgets/lib folder.
../wxWidgets-3.0.4/lib/wxBuild_debug/
../wxWidgets-3.0.4/lib/wxBuild_release/

Before starting my test project in Code::Blocks clik Settings/Global Variables...
Current Set == default
Current variable == wx

Built-in fields:
base == ..\wxWidgets-3.0.4
include == ..\wxWidgets-3.0.4\include
lib == ..\wxWidgets-3.0.4\lib

Start Project:
New -> Project -> wxWidgets project
Welcome -> next
Select the wxWidgets version -> wxWidgets 3.0.x -> next
Select folder for project -> Title -> name
                                           Folder -> ..\Codeblocks\name
                                           Project Filename == name.cpb
                                           Resulting filename == ..\Code Blocks\name\name.cbp
next
Author -> next
Select GUI Builder
Preferred GUI Builder -> wxSmith
Application Type -> Frame Based
next
Location of wxWidgets
    I have tried ..\wxWidgets
    I am trying $(#wx)
next
Select Compiler to use
Compiler == GNU GCC Compiler (x64)
Create "Debug" configuration [Debug] ==  true
Output dir.: [bin\Debug\]
Objects output dir.: [obj\Debug\]

Create "Release" configuration [release] == true
Output dir.: [bin\Release\]
Objects output dir.: [obj\Release\]
next

Please select various configuration options
Use wxWidgets DLL == true
wxWidgets is build as monolithic library == true  : I did set MONOLITHIC ?=1 in my config.gcc
Enable unicode == false  : I did set UNICODE ?=0 in my config.gcc
Miscellaneous Settings
Create Empy Project == false
Create and use precompiled header (PCH) == true
Configuration [blank]
Configure Advanced Options == false
next

I got these settings from http://wiki.codeblocks.org/index.php/WxSmith_tutorial:_Hello_world

Warning: A matching Debug configuration cannot be found in the wx Widgets directory you specified.
continue -> yes
Warning: A matching Release configuration cannot be found in the wxWidgets directory you specified.
coninue -> no

End attempt to create project.

If I browse for the directory that the wxWidgets base is I get the same results.

I know it is something stupid, that's coding/learning. Any help would be appreciated.






                                           

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Global Variable Use
« Reply #1 on: March 30, 2020, 09:26:29 am »
How did you isntalled wxWidgets?
How exactly is your folder structure (until the dll of wxWidgets)?

Offline Waingrove

  • Single posting newcomer
  • *
  • Posts: 7
Re: Global Variable Use
« Reply #2 on: March 30, 2020, 01:05:40 pm »
I installed wxWidgets-3.0.4 from both the installation executable and with the zip file. Both installations were installed in the main drive directory. Drive:\wxWidgets\..  is correct.

I built the libraries using mysys2 and mingw64.

This is my config file:

# =========================================================================
#     This configuration file was generated by
#     Bakefile 0.2.9 (http://www.bakefile.org)
#     Beware that all changes made to this file will be overwritten next
#     time you run Bakefile!
# =========================================================================


# -------------------------------------------------------------------------
# These are configurable options:
# -------------------------------------------------------------------------

# Compiler flags to link shared library
LINK_DLL_FLAGS ?= -shared

# Compiler flags to link loadable module
LINK_MODULE_FLAGS ?= -shared

# C compiler
CC = gcc

# C++ compiler
CXX = g++

# Standard flags for CC
CFLAGS ?=

# Standard flags for C++
CXXFLAGS ?=

# Standard preprocessor flags (common for CC and CXX)
CPPFLAGS ?=

# Standard linker flags
LDFLAGS ?=

# The C preprocessor
CPP ?= $(CC) -E

# What type of library to build? [0,1]
SHARED ?= 0

# GTK+ toolkit version [,2]
TOOLKIT_VERSION ?= 

# Build wxUniversal instead of native port? [0,1]
WXUNIV ?= 0

# Compile Unicode build of wxWidgets? [0,1]
UNICODE ?= 0

# Use MSLU library when building Unicode version. [0,1]
MSLU ?= 0

# Type of compiled binaries [debug,release]
BUILD ?= release

# Should debugging info be included in the executables? The default value
# "default" means that debug info will be included if BUILD=debug
# and not included if BUILD=release. [0,1,default]
DEBUG_INFO ?= default

# Value of wxDEBUG_LEVEL. The default value is the same as 1 and means that all
# but expensive assert checks are enabled, use 0 to completely remove debugging
# code. [0,1,default]
DEBUG_FLAG ?= 1

# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 1

# Build GUI libraries? [0,1]
USE_GUI ?= 1

# Build wxHTML library (USE_GUI must be 1)? [0,1]
USE_HTML ?= 1

# Build wxWebView library (USE_GUI must be 1)? [0,1]
USE_WEBVIEW ?= 1

# Build multimedia library (USE_GUI must be 1)? [0,1]
USE_MEDIA ?= 1

# Build wxXRC library (USE_GUI must be 1)? [0,1]
USE_XRC ?= 1

# Build wxAUI library (USE_GUI must be 1)? [0,1]
USE_AUI ?= 1

# Build wxRibbon library (USE_GUI must be 1)? [0,1]
USE_RIBBON ?= 1

# Build wxPropertyGrid library (USE_GUI must be 1)? [0,1]
USE_PROPGRID ?= 1

# Build wxRichTextCtrl library (USE_GUI must be 1)? [0,1]
USE_RICHTEXT ?= 1

# Build wxStyledTextCtrl library (USE_GUI must be 1)? [0,1]
USE_STC ?= 1

# Build OpenGL canvas library (USE_GUI must be 1)? [0,1]
USE_OPENGL ?= 1

# Build quality assurance classes library (USE_GUI must be 1)? [0,1]
USE_QA ?= 0

# Enable exceptions in compiled code. [0,1]
USE_EXCEPTIONS ?= 1

# Enable run-time type information (RTTI) in compiled code. [0,1]
USE_RTTI ?= 1

# Enable threading in compiled code. [0,1]
USE_THREADS ?= 1

# Enable wxCairoContext for platforms other than Linux/GTK. [0,1]
USE_CAIRO ?= 0

# Is this official build by wxWidgets developers? [0,1]
OFFICIAL_BUILD ?= 0

# Use this to name your customized DLLs differently
VENDOR ?= custom


WX_FLAVOUR ?=


WX_LIB_FLAVOUR ?=

# Name of your custom configuration. This affects directory
# where object files are stored as well as the location of
# compiled .lib files and setup.h under the lib/ toplevel directory.
CFG ?=

# Compiler flags needed to compile test suite in tests directory. If you want
# to run the tests, set it so that the compiler can find CppUnit headers.
CPPUNIT_CFLAGS ?=

# Linker flags needed to link test suite in tests directory. If you want
# to run the tests, include CppUnit library here.
CPPUNIT_LIBS ?=

# Version of C runtime library to use. You can change this to
# static if SHARED=0, but it is highly recommended to not do
# it if SHARED=1 unless you know what you are doing. [dynamic,static]
RUNTIME_LIBS ?= dynamic

# Set the version of your Mingw installation here.
#     "3" ...... this is for Mingw 2.0 or newer (comes with gcc3)
#     "2.95" ... for Mingw 1.1 or any of the older versions [3,2.95]
GCC_VERSION ?= 3

# Windows resource compiler to use, possibly including extra options.
# For example, add "-F pe-i386" here if using 64 bit windres for 32 bit build.
WINDRES ?= windres --use-temp-file

//----------------------------------------------------------------------------------------

I built one debug and one release. I moved the folder from wxWidgets-3.0.4\build\msw\gcc_lib\
to wxWidgets-3.0.4\lib\ and renamed it to wxBuild_debug. And one called wxBuild_release.

As a test, just now I again built /samples/minimal/ successfully. 

So, that part seems to be working.

Offline Waingrove

  • Single posting newcomer
  • *
  • Posts: 7
Re: Global Variable Use
« Reply #3 on: March 30, 2020, 07:57:53 pm »
I may have figured it out. I selected "Use wxWidgets DLL" and "wxWidgets is built as a monolithis library" .
Unchecking "Use wxWidgets DLL" allowed me to proceed.

Thx

Offline Waingrove

  • Single posting newcomer
  • *
  • Posts: 7
Re: Global Variable Use
« Reply #4 on: March 31, 2020, 02:39:20 pm »
So what I think I know at this time is :
1) wxWidgets-3.0.4 is giving me a problem building the dll. It will build the library.
   And, I can create a project in C::B 17.12, using the monolithic library option.
2) I cannot build wxWidgets-3.0.4 with configure. It unexpected finds Borland Builder 6.
3) I'm running win7 x64 on a i5-2500k processor.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Global Variable Use
« Reply #5 on: March 31, 2020, 02:47:25 pm »
OK so this is a wxWidgets problem for you?
The next time you post some information like build logs, or configuration files, please use code tags (the # symbol in the forum editor) This will make reading your post a LOT easier...

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Global Variable Use
« Reply #6 on: March 31, 2020, 02:53:26 pm »
Quote
I built one debug and one release. I moved the folder from wxWidgets-3.0.4\build\msw\gcc_lib\
to wxWidgets-3.0.4\lib\ and renamed it to wxBuild_debug. And one called wxBuild_release.
This will not work...

Codeblocks needs the default folder structure to work properly...
So If you want to copy the things to different folders for the library, you have to move the whole lib folder with all its sub structures...
lets say the original path is like this
Code
\wxWidgets-3.1.3\lib\gcc_dll\wxmsw313u_gcc_custom.dll
then your new folder should be like this
Code
\wxWidgets-3.1.3\MYOWNFOLDERNAME\lib\gcc_dll\wxmsw313u_gcc_custom.dll
and then point the global variable for library to
Code
\wxWidgets-3.1.3\MYOWNFOLDERNAME\lib
so the
Code
gcc_dll\
part is needed

Online stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
Re: Global Variable Use
« Reply #7 on: March 31, 2020, 02:55:52 pm »
FYI: This user is editing config.gcc instead of passing different option when doing make.

And, they refuse to not do it that way on the wxForum website.
I have no idea what problems this will create using the CB wxWidgets wizard.

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

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3353
Re: Global Variable Use
« Reply #8 on: March 31, 2020, 02:56:20 pm »
Also on windows the build process with the normal mingw makefile is quite painless and for me worked better than the configure process...
i use
Code
wxWidgets-3.1.3\build\msw\mingw32-make.exe -f makefile.gcc BUILD=debug MONOLITHIC=1 SHARED=1

@stahta01: i was wondering what configure file this is :)

Online stahta01

  • Lives here!
  • ****
  • Posts: 7678
    • My Best Post
Re: Global Variable Use
« Reply #9 on: March 31, 2020, 03:04:14 pm »
They think editing build/msw/config.gcc is correct.

I have seen others do it; but, they did it for only a single build type.
I am thinking trying to do two different build types must result in problems that are rarely seen.

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

Offline Waingrove

  • Single posting newcomer
  • *
  • Posts: 7
Re: Global Variable Use
« Reply #10 on: March 31, 2020, 10:48:51 pm »
Maybe editing the config.gcc is  not advisable. The issue seems to be that mixing some of the options may cause a build problem.
Better documentation of what at least the most refered to options do would be benefical. An example, mixing SHARED=1 and MONOLITHIC=1 seemed to cause a problem building for me. Not knowing this and reading some of the build commands can cause confusion.
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport
Didn't work, for me.
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1
didn't work for me.
mingw32-make -f makefile.gcc BUILD=release SHARED=1
Worked fine.

I also admit that while googling and reading different install.txt wxWidgets guides and C::B guides different suggestions come up leading to different outcomes.

Also, using ../configure , on a win7 x64 machine the option --with-msw is very important. This is overlooked in the install.txt.
So ../configure --enable-debug --with-msw       would be required. Otherwise it will not recognize the architecture of your machine.

It was an annoying several days for me but, thx to eggs dropped by those willing to help and ONEEYEDMAN I am at least ready to begin learning wxWidgets.

Thx