Building BAH modules

Started by _PJ_, February 14, 2021, 02:11:17

Previous topic - Next topic

_PJ_

Quote
[  3%] Processing:source.bmx
"C:/Program Files/BlitzMax/bin/bcc.exe"  -g x64 -m bah.taglib -v -h -d -s -p win32 -o "C:/Program Files/BlitzMax/mod/bah.mod/taglib.mod/.bmx/source.bmx.debug.win32.x64.s" "C:/Program Files/BlitzMax/mod/bah.mod/taglib.mod/source.bmx"
Parsing...
Compile Error: File 'C:/Program Files/BlitzMax/mod/bah.mod/sstream.mod/common_ng.bmx' not found.
[C:/Program Files/BlitzMax/mod/bah.mod/sstream.mod/sstream.bmx;21;0]
Build Error: failed to compile (-1) C:/Program Files/BlitzMax/mod/bah.mod/sstream.mod/sstream.bmx
Process complete

I've looked everywhere and indeed "common_ng.bmx" just doesn't seem to exist. Where can this source be obtained?





Derron

#2
Ok ... so I blamed that a while ago - right?
... and the issue was closed ... right?


Now we check the content of the bah.mod/sstream.mod folder:
https://github.com/maxmods/bah.mod/tree/master/sstream.mod



It seems ... it is there.



Might it be that you run a lot of outdated files? maybe newer NG + "copied from my backup folder" bah.mod ?  and all this stuff?
Download "bah.mod" , extract it and _replace_ your old bah.mod stuff.

Another option is to use GIT to keep in sync with local changes (which you might have done) and changes in the upstream repository.


Edit: Small hint: do not enforce compilation of all the bah.mod stuff - only compile what is needed (let bmk decide that for you). Else you will always run into an outdated submodule and then the whole module compilation stops at this point - leavin all the "yet to be compiled" modules uncompiled.


bye
Ron

_PJ_


I took the "version 1.01" of BaH.mod/Registry.mod
Copied this to a newly created and otherwise empty "bah.mod" folder within BlitzMax install location

I then opened BlitzMax NG IDE and ran "Build Modules" which reported that "bah.registry" compiled correctly

However, when trying to compile/run the "Example" sources, I am presented with the following errors at the linking stage::

______________________________________________

[ 90%] Compiling:untitled1.bmx.console.debug.win32.x64.c
C:/Program Files/BlitzMax/MinGW32x64/bin/gcc.exe -I"C:/Program Files/BlitzMax/mod" -I"C:/Program Files/BlitzMax/mod/brl.mod/standardio.mod" -I"C:/Program Files/BlitzMax/mod/brl.mod/blitz.mod" -I"C:/Program Files/BlitzMax/mod/brl.mod/appstub.mod" -I"C:/Program Files/BlitzMax/mod/bah.mod/registry.mod"  -g  -w -DBMX_NG -m64 -ffast-math -fno-exceptions -c -O3 -msse3  -g -o "C:/Program Files/BlitzMax/tmp/.bmx/untitled1.bmx.console.debug.win32.x64.o" "C:/Program Files/BlitzMax/tmp/.bmx/untitled1.bmx.console.debug.win32.x64.c"
[100%] Linking:untitled1.debug.exe
"C:/Program Files/BlitzMax/MinGW32x64/bin/g++.exe" -Wl,--stack,4194304 -s  -mconsole -mthreads -static -o "C:/Program Files/BlitzMax/tmp/untitled1.debug.exe" "C:/Program Files/BlitzMax/tmp/ld.tmp"
C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/registry.debug.win32.x64.a(mbr_glue.c.debug.win32.x64.o): In function `bmx_reg_RegEnumValue':
C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:277: undefined reference to `bah_registry_TRegistryValue__setName'
C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:278: undefined reference to `bah_registry_TRegistryValue__setValueType'
C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:299: undefined reference to `bah_registry_TRegistryValue__setLong'
C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:288: undefined reference to `bah_registry_TRegistryValue__setInteger'
C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:314: undefined reference to `bah_registry_TRegistryValue__setString'
collect2.exe: error: ld returned 1 exit status

____________________________________


Note, this is targeting 64-bit architecture, might this be relevant?

markcwm

Undefined references errors usually means the module wasn't built.

_PJ_

#5
I have tried again with a fresh installation of the latest BMax NG and a new download of BAH modules.

registry.mod is the ONLY BaH module in the BAH.mod directory.

The same issue recurs.

Opened BlitzMax NG IDE and ran "Build Modules" which reported that "bah.registry" compiled correctly
However, when trying to compile/run the "Example" sources, I am presented with the following errors at the linking stage::


Building bmx
Loading C:/Program Files/BlitzMax/bin/custom.bmk
[100%] Linking:bmx.debug.dll
Warning: Cannot locate .def file (F:/bb/BMax64/Misc/Registry/bmx.debug.def). Exporting ALL symbols.
"C:/Program Files/BlitzMax/MinGW32x64/bin/g++.exe" -Wl,--stack,4194304 -mthreads -shared -static-libgcc -o "F:/bb/BMax64/Misc/Registry/bmx.debug.dll" -Wl,--out-implib,"F:/bb/BMax64/Misc/Registry/bmx.debug.a" "C:/Program Files/BlitzMax/tmp/ld.tmp"
C:/Program Files/BlitzMax/MinGW32x64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/registry.debug.win32.x64.a(mbr_glue.c.debug.win32.x64.o): in function `bmx_reg_RegEnumValue':
C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:277: undefined reference to `bah_registry_TRegistryValue__setName'
C:/Program Files/BlitzMax/MinGW32x64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:278: undefined reference to `bah_registry_TRegistryValue__setValueType'
C:/Program Files/BlitzMax/MinGW32x64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:288: undefined reference to `bah_registry_TRegistryValue__setInteger'
C:/Program Files/BlitzMax/MinGW32x64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:299: undefined reference to `bah_registry_TRegistryValue__setLong'
C:/Program Files/BlitzMax/MinGW32x64/bin/../lib/gcc/x86_64-w64-mingw32/12.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: C:/Program Files/BlitzMax/mod/bah.mod/registry.mod/glue.c:314: undefined reference to `bah_registry_TRegistryValue__setString'
collect2.exe: error: ld returned 1 exit status
Build Error: Failed to link F:/bb/BMax64/Misc/Registry/bmx.debug.dll
Process complete

How can I tell if the module builds incorrectly if BMax IDE reports that the build was successful?


Derron

Seems you try to compile something as a shared library (dll) ?

To replicate (I just used an older NG as it was prepared in a Windows VM ...) :


SuperStrict
Framework Brl.Standardio
Import bah.registry

[100%] Linking:untitled1.dll
C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/MinGW32x86/bin/../lib/gcc/i686-w64-mingw32/12.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/mod/bah.mod/registry.mod/registry.release.win32.x86.a(mbr_glue.c.release.win32.x86.o):glue.c:(.text+0x817): undefined reference to `bah_registry_TRegistryValue__setName'
C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/MinGW32x86/bin/../lib/gcc/i686-w64-mingw32/12.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/mod/bah.mod/registry.mod/registry.release.win32.x86.a(mbr_glue.c.release.win32.x86.o):glue.c:(.text+0x82e): undefined reference to `bah_registry_TRegistryValue__setValueType'
C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/MinGW32x86/bin/../lib/gcc/i686-w64-mingw32/12.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/mod/bah.mod/registry.mod/registry.release.win32.x86.a(mbr_glue.c.release.win32.x86.o):glue.c:(.text+0x8c0): undefined reference to `bah_registry_TRegistryValue__setInteger'
C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/MinGW32x86/bin/../lib/gcc/i686-w64-mingw32/12.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/mod/bah.mod/registry.mod/registry.release.win32.x86.a(mbr_glue.c.release.win32.x86.o):glue.c:(.text+0x94d): undefined reference to `bah_registry_TRegistryValue__setLong'
C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/MinGW32x86/bin/../lib/gcc/i686-w64-mingw32/12.2.0/../../../../i686-w64-mingw32/bin/ld.exe: C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/mod/bah.mod/registry.mod/registry.release.win32.x86.a(mbr_glue.c.release.win32.x86.o):glue.c:(.text+0x9ec): undefined reference to `bah_registry_TRegistryValue__setString'
collect2.exe: error: ld returned 1 exit status
Build Error: Failed to link C:/Tools/BlitzMax_win32_mingw_0.138.3.54/BlitzMax/tmp/untitled1.dll

But happens with .exe builds too.

bye
Ron

Derron

I am not sure if this is the 100% complete way of doing it - but I raised an issue:
https://github.com/maxmods/bah.mod/issues/101

and there I proposed a change "repairing" it for now (in BlitzMax NG)


bye
Ron

_PJ_

Excellent!
Thank you, Derron! I didn't raise it as issue on GitHub myself, as I was convinced it was something I was doing wrong on my end!

I implemented the changes as described to my local version of "registry.bmx" (made sure to backup the original just in case!) and it works perfectly.