Author Topic: Can`t build C::B IDE from latest svn revision 12240  (Read 2657 times)

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 45
Can`t build C::B IDE from latest svn revision 12240
« on: December 19, 2020, 05:08:02 pm »
OS: Windows 7 64bit

1) install MSYS2 https://www.msys2.org/
   - run msys2-terminal and run for update all packages (if need)
   
Code: [Select]
      $pacman -Syu
   
   - run msys2-terminal and run to install packages:
   
Code: [Select]
      $pacman -S mingw-w64-x86_64-gdb mingw-w64-x86_64-gcc mingw-w64-x86_64-boost zip svn
   
2) download latest wxWidgets-3.1.4 from https://www.wxwidgets.org/downloads/
   - if use wget.exe
   
Code: [Select]
      wget.exe -P "h:\i\CB_src\s\" "https://github.com/wxWidgets/wxWidgets/releases/download/v3.1.4/wxWidgets-3.1.4.zip" -N --compression=auto -l 16 -t 0 --retry-connrefused -e robots=off -np -x --max-redirect=60 --no-if-modified-since -o "wget_wx.log"
   
     
3) download latest C::B IDE src from https://svn.code.sf.net/p/codeblocks/code/trunk/
   - if use wget.exe [more bad idea for more download files]
   
Code: [Select]
      wget.exe -P "h:\i\CB_src\s\" "http://svn.code.sf.net/p/codeblocks/code/trunk/" -N -r --compression=auto -l 16 -t 0 --retry-connrefused -e robots=off -np -x --max-redirect=60 --no-if-modified-since -o "wget_cb.log"
   
   - use svn.exe, before start need open in your system firewall ports only svn.exe uotput rules TCP 80,443,3690
   
Code: [Select]
      svn.exe co --username you svn://svn.code.sf.net/p/codeblocks/code/trunk
   
4) compile wxWidgets
   4.1) create powershell file: I.ps1
     
Code: [Select]
        chcp 65001
       
        #$path_msys32 = "H:/I/msys32" ## <== change whereis MSYS2 save files
        $path_msys64 = "H:/I/msys64" ## <== change whereis MSYS2 save files

        $path_wx = "H:/I/CB_src/wxgtk" ## <== change whereis saved latest unpacked wxWidgets files
        cd ($path_wx + "/build/msw")

##-- 32 bit
#        $path_mingw32="$path_msys32/mingw32"
#        $env:path +=";" + $path_mingw32
#        $env:path +=";$path_mingw32\bin"
#        $env:path +=";$path_mingw32\include"       

##-- 64 bit       
        $path_mingw64="$path_msys64/mingw64"
        $env:path +=";" + $path_mingw64
        $env:path +=";$path_mingw64\bin"
        $env:path +=";$path_mingw64\include"

        #-- Before compile I change params in $path_wx/build/msw/config.gcc
        #-- add _MSC_VER=1928 for enable direct2D but this not work

        #-- need run if rebuild
        mingw32-make -f makefile.gcc clean
        if(Test-Path -PathType Container "$path_wx\lib\gcc_dll") {
            #del "$path_wx\lib\gcc_dll"
            rm -r -fo "$path_wx\lib\gcc_dll"
        }
        echo "`n-----------------------------------------------`n"

        #-- need run once before compile
        mingw32-make -f makefile.gcc setup_h
        echo "`n-----------------------------------------------`n"

        #-- build all wxWidgets
        #-- recommends for arg -j#:
        #--     -j(cores in CPU / 2)    if cores >= 4
        #--       not use this arg        if cores >= 2
        #mingw32-make -j4 -f makefile.gcc
        mingw32-make -j2 -f makefile.gcc
        echo "`n-----------------------------------------------`n"
       
        #-- need if not found zip.exe in Windows
        #$path_system32 = $env:ComSpec
        #$path_system32 = $path_system32.SubString(0, $path_system32.Length-7)
        #cd $path_system32
        #$creds = Get-Credential

        $arg = "/c" +
                "mklink zip.exe $path_msys64\usr\bin\zip.exe" +
                "& mklink msys-2.0.dll $path_msys64\usr\bin\msys-2.0.dll" +
                "& mklink msys-bz2-1.dll $path_msys64\usr\bin\msys-bz2-1.dll"
               
        Start-Process cmd -ArgumentList $arg -Verb runas
        echo "`n-----------------------------------------------`n"
     
   4.2) Need change file: H:\I\CB_src\wxgtk\include\wx\msw\setup.h
      from
      #define wxUSE_GRAPHICS_DIRECT2D 0

      to in the #else case as well.
      #define wxUSE_GRAPHICS_DIRECT2D 1
   4.3) run compile:
      click double on I.ps1
     
5) run current C::B IDE
   5.1) Open workspace file
      ## 32 bit
      #- open file in C::B IDE: "H:\I\CB_src\s\svn.code.sf.net\p\codeblocks\code\trunk\src\CodeBlocks_wx31.workspace"
     
      ## OR
     
      ## 64 bit
      - open file in C::B IDE: "H:\I\CB_src\s\svn.code.sf.net\p\codeblocks\code\trunk\src\CodeBlocks_wx31_64.workspace"
   
   5.2) take button build or rebuild
   
      and look this ERRORS :)

     
https://ibb.co/Xz44qHc
https://ibb.co/bLLtpcj
https://ibb.co/MhxWvrn
https://ibb.co/4pDmnDy
https://ibb.co/xgzdR0k

expired 30 days https://easyupload.io/m/m3o8cv
« Last Edit: December 25, 2020, 12:05:23 am by omlk »

Offline sodev

  • Regular
  • ***
  • Posts: 417
Re: Can`t buid C::B IDE from latest svn revision 12240
« Reply #1 on: December 19, 2020, 06:02:09 pm »
CodeBlocks requires a monolithic DLL version of wxWidgets, not sure what the Makefile compiles by default with no parameters specified, since your errors are linker errors it most probably builds another variant.

Adding _MSC_VER as parameter to Make does NOT pass this as define to the compiler but just sets this as environment variable, thats why it doesn't have any effect. A better way is really to modify setup.h to get the required settings.

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #2 on: December 19, 2020, 06:06:14 pm »
my config.gcc containe:
Code: [Select]
# =========================================================================
#     This configuration file was generated by
#     Bakefile 0.2.12 (http://www.bakefile.org)
#     Beware that all changes made to this file will be overwritten next
#     time you run Bakefile!
# =========================================================================


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

_MSC_VER = 1928

# 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 ?= 1

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

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

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

# 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 ?= 1

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

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

# Set DPI Awareness (win32) to none, system or per-monitor. [0,1,2]
USE_DPI_AWARE_MANIFEST ?= 2

# 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 ?= omlk


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 ?=

# 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


« Last Edit: December 22, 2020, 09:46:54 pm by omlk »

Offline sodev

  • Regular
  • ***
  • Posts: 417
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #3 on: December 19, 2020, 06:22:56 pm »
Great, now all you have to do is to reverse engineer all these generated Makefiles to figure out how to actually pass this definition to all required compiler calls as define.

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #4 on: December 19, 2020, 06:34:26 pm »
Great, now all you have to do is to reverse engineer all these generated Makefiles to figure out how to actually pass this definition to all required compiler calls as define.

? mingw32-make -j2 -f makefile.gcc  in file #include config.gcc

Offline sodev

  • Regular
  • ***
  • Posts: 417
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #5 on: December 19, 2020, 06:43:30 pm »
Not sure what you are trying to tell us with that, but before this gets out of hand, my last post was a joke.

Actually, it is a very bad idea to define this symbol yourself, this is a compiler internal symbol and code usually uses this to detect the current compiler. If you define this symbol yourself, the code might think it is getting compiled with MSVC although it gets compiled with GCC, this will break your whole build.

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #6 on: December 19, 2020, 09:41:45 pm »
I compare two .dll, orig and my and I cant't found
_z10wxOnAssertPKciS0_S0_
_z10wxOnAssert*


FIX: need change in config.gcc: DEBUG_FLAG ?= 0  to DEBUG_FLAG ?= 1

so, how disable use wxAsserts() when compile src C::B? I want to get the release version without debug info in wx*.dll
   
« Last Edit: December 22, 2020, 09:42:44 pm by omlk »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7054
    • My Best Post
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #7 on: December 20, 2020, 05:01:13 am »
Do you wish to learn how to do it, correctly?
Or do you wish to continue on your path of editing "config.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

Offline gh_origin

  • Multiple posting newcomer
  • *
  • Posts: 48
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #8 on: December 20, 2020, 08:58:41 am »
Your method is hackish. There is indeed a detailed wiki page about how to build CodeBlocks from source. It's easy to search for it on Google.

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #9 on: December 20, 2020, 06:34:33 pm »
Why do you consider this method hacking  :)? I do not break anything and use information from files that are in the codeblocks repository.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13001
    • Travis build status
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #10 on: December 20, 2020, 07:45:54 pm »
Trolling continues... and it is quite successful given the number of replies you're getting... Kudos for that  ;D
(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 omlk

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #11 on: December 20, 2020, 08:18:39 pm »
C::B rev12187 can`t correct run pre/post cmd commadns, look in attached screenshot
and I replace all backslashes '\' to forward '/' becouse zip 3.0.0 bug with '\'

« Last Edit: December 22, 2020, 09:40:38 pm by omlk »

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7054
    • My Best Post
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #12 on: December 20, 2020, 08:32:13 pm »
Since, you do not want help why are you still posting on this website?

You either need to have a Windows zip command first in the path or edit the CB project to use the MSys2 zip command.
This is NOT a CB problem!

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

Offline omlk

  • Multiple posting newcomer
  • *
  • Posts: 45
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #13 on: December 20, 2020, 08:48:48 pm »
Since, you do not want help why are you still posting on this website?

You either need to have a Windows zip command first in the path or edit the CB project to use the MSys2 zip command.
This is NOT a CB problem!

Tim S.

So I want codeblocks to work correctly, and I show that there are bugs in codeblocks, and you claim that this is not a problem - and what do you think it is then?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7054
    • My Best Post
Re: Can`t build C::B IDE from latest svn revision 12240
« Reply #14 on: December 20, 2020, 08:59:28 pm »
Since, you do not want help why are you still posting on this website?

You either need to have a Windows zip command first in the path or edit the CB project to use the MSys2 zip command.
This is NOT a CB problem!

Tim S.

So I want codeblocks to work correctly, and I show that there are bugs in codeblocks, and you claim that this is not a problem - and what do you think it is then?

I can not help you! If you can not read and understand what you quoted then no one can help you on this website!

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