Author Topic: Squirrel 3.1 and new bindings  (Read 4453 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Squirrel 3.1 and new bindings
« on: April 16, 2021, 09:09:32 pm »
Here is a branch: https://github.com/obfuscated/codeblocks_sf/tree/scripting/update_to_31

I've spend the last months working on this, because I need it for my debugger-test-suite I want to make.
This branch updates Squirrel to the latest released version - 3.1-stable.
It removes SqPlus, because it is no longer maintained and it is buggy (this was my main motivation to do the work).
I've applied some patches to the interpreter - comparing wxStrings with == now works.
Unfortunately the Squirrel devs don't intend to review my patch, nor do they plan to give feedback on it and they/he have repeatedly mentioned that this feature won't go in to the upstream, because it can slow down the language, but they don't have a test suite and so their claims are mostly predictive and not based on actual facts. Up to now I've not seen any problems with it.
I've added tests for most of the exposed APIs. This branch passes more tests then master/trunk.

I've not tested on Windows. Linux and macOS build and work fine as far as I can test.

If you need to know how the new binding works read the comments in sc_utils.h and if something is unclear don't hesitate to ask.
I plan to fix some of the remaining TODOs (you can search them with "FIXME (squirrel)") and then push this monstrosity.

Any feedback is welcome, especially on Windows.

Note: I've not tested every single wizard, so if you have favourite wizard give it a try and tell me if something is broken, I'm sure there are such cases!
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #1 on: April 17, 2021, 08:18:11 am »
Code
From 5c8abf12484cabd79be5b2603b3043a272172fe6 Mon Sep 17 00:00:00 2001
From: Tim Stahlhut <[email protected]>
Date: Sat, 17 Apr 2021 00:52:52 -0400
Subject: Win fix

---
 src/include/scripting/include/squirrel.h | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/include/scripting/include/squirrel.h b/src/include/scripting/include/squirrel.h
index 4844317d5..a22e73081 100644
--- a/src/include/scripting/include/squirrel.h
+++ b/src/include/scripting/include/squirrel.h
@@ -27,8 +27,14 @@ extern "C" {
 #endif
 
 #ifndef SQUIRREL_API
-#define SQUIRREL_API extern
-#endif
+#ifdef _WIN32
+    // since we build the squirrel static library, and we need to export all the symbols
+    // the codeblocks.dll, we need to add the dllexport decoration
+    #define SQUIRREL_API __declspec(dllexport)
+#else
+    #define SQUIRREL_API extern
+#endif // _WIN32
+#endif // SQUIRREL_API
 
 #if (defined(_WIN64) || defined(_LP64))
 #ifndef _SQ64
--
2.31.1.windows.1
Code
From 5e68a70734e0da0495cf57cbe617071452c0c3df Mon Sep 17 00:00:00 2001
From: Tim Stahlhut <[email protected]>
Date: Sat, 17 Apr 2021 02:05:09 -0400
Subject: Add SQUIRREL_API to fix win build error

---
 src/include/scripting/bindings/sc_utils.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/include/scripting/bindings/sc_utils.h b/src/include/scripting/bindings/sc_utils.h
index 03eaf944a..838487109 100644
--- a/src/include/scripting/bindings/sc_utils.h
+++ b/src/include/scripting/bindings/sc_utils.h
@@ -183,7 +183,7 @@
 namespace ScriptBindings
 {
 
-void PrintStack(HSQUIRRELVM vm, const char *title, SQInteger oldTop = -1);
+SQUIRREL_API void PrintStack(HSQUIRRELVM vm, const char *title, SQInteger oldTop = -1);
 wxString ExtractLastSquirrelError(HSQUIRRELVM vm, bool canBeEmpty);
 
 struct PreserveTop
--
2.31.1.windows.1

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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #2 on: April 17, 2021, 05:48:35 pm »
Are you able to run the tests?
Steps:
1. Show the script console
2. Load the src/scripts/tests/script_test_plugin.script
3. Plugins -> Test scripting -> Test wx or Test sdk

Post the results here.
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #3 on: April 17, 2021, 10:15:15 pm »
Edit3: "Test wx" seems to do nothing that I can see other than a box pops up for me to click on.

I had to manually create the folder "C:\Users\stahta01\AppData\Local\Temp\sdk_tests" before the SDK tests did much.
It crash a little later; going to have to try again to see if it still crashes.

Edit2: It did not crash the second time; but, the first time I was building Code::Blocks main project and I think that might be a partial reason it crashed.

I have neither a printer setup and I have no debugger setup inside Code::Blocks.

Code
Script plugin registered: Scripting_TestPlugin
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ProjectManager::SetProject took: 0.085 seconds.
Current target 'Debug_New' doesn't have valid compiler!
ProjectManager::SetProject took: 0.119 seconds.
ProjectManager::SetProject took: 0.094 seconds.
ProjectManager::SetProject took: 0.093 seconds.
Opening C:\Users\stahta01\AppData\Local\Temp\sdk_tests\NewProject2.cbp
Done.
ProjectManager::CloseAllProjects took: 0.179 seconds.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
cbEditor::AutoComplete() is obsolete.
Use AutoComplete(cbEditor &ed) from the Abbreviations plugin instead.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ProjectManager::SetProject took: 0.086 seconds.
Current target 'Debug_New' doesn't have valid compiler!
ProjectManager::SetProject took: 0.095 seconds.
ProjectManager::SetProject took: 0.095 seconds.
ProjectManager::SetProject took: 0.112 seconds.
Opening C:\Users\stahta01\AppData\Local\Temp\sdk_tests\NewProject2.cbp
Done.
ProjectManager::CloseAllProjects took: 0.181 seconds.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
cbEditor::AutoComplete() is obsolete.
Use AutoComplete(cbEditor &ed) from the Abbreviations plugin instead.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.
ToDoList: Warning: No to-do types or comment symbols selected to search for, nothing to do.

Tim S.
« Last Edit: April 17, 2021, 10:26:05 pm 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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2974
Re: Squirrel 3.1 and new bindings
« Reply #4 on: April 18, 2021, 12:49:06 am »
Had to apply the patches of stahta01 to be able to compile

SDK test:
Code
Global executed tests: 24
Global passed tests:   24
Global failed tests:   0

wx test
Code
Global executed tests: 138
Global passed tests:   126
Global failed tests:   13

The failed tests are:
Code
[ERROR] Test: cmp string          FAILED (got false needed true)
[ERROR] Test: cmp string2         FAILED (got false needed true)
[ERROR] Test: cmp string not      FAILED (got false needed true)
[ERROR] Test: cmp string not2     FAILED (got false needed true)

[ERROR] Test: InsertDir value     FAILED (got "\newdir\share\codeblocks\" needed "newdir\\share\codeblocks\ ")
[ERROR] Test: PrependDir value    FAILED (got "\newdir\share\codeblocks\" needed "newdir\\share\codeblocks\ ")
The other failed tests are related to path handling or volume, that failed also in the old implementation...

the failed tests for paths seem to be some error with the "::wxFILE_SEP_PATH" constant

@stahta01: the output of the tests is in the scripting console
« Last Edit: April 18, 2021, 12:52:41 am by BlueHazzard »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #5 on: April 18, 2021, 01:07:48 am »
Some OS related test failures are expected. The string comparison failures aren't. :shrug:

p.s. I hate PCHs, such a stupid idea.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5345
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Squirrel 3.1 and new bindings
« Reply #6 on: April 18, 2021, 04:18:41 am »
I use Tim's patches, thanks Tim!

Are you able to run the tests?
Steps:
1. Show the script console
2. Load the src/scripts/tests/script_test_plugin.script

Here is my result:
Code
Welcome to the script console!
Plugin instance: (instance : 0x0000000005E8B190)
======= Test Test environment BEGINN =======
 this is intended to fail:
[ERROR] Test: test_string...................FAILED
[ERROR] got:    "hallo"
[ERROR] needed: "nope "

Executed tests: 1
passed tests:   0
failed tests:   1
======= Test Test environment END =======
======= Test wx String BEGINN =======
Test: tostring......................PASSED
Test: constructor(SQchar)...........PASSED
Test: cmp...........................PASSED
Test: cmp not.......................PASSED
Test: cmp string....................PASSED
Test: cmp string2...................PASSED
Test: cmp string not................PASSED
Test: cmp string not2...............PASSED
Test: Compare.......................PASSED
Test: Compare lt....................PASSED
Test: Compare gt....................PASSED
Test: Compare lt string.............PASSED
Test: Compare gt string.............PASSED
Test: _add..........................PASSED
Test: _add wxString+string..........PASSED
Test: _add string+wxString..........PASSED
Test: _add wxString+int.............PASSED
Test: _add wxString+float...........PASSED
Test: _cloned.......................PASSED
Test: IsEmpty.......................PASSED
Test: IsEmpty.......................PASSED
Test: Length........................PASSED
Test: length........................PASSED
Test: len...........................PASSED
Test: size..........................PASSED
Test: Lower.........................PASSED
Test: LowerCase.....................PASSED
Test: MakeLower.....................PASSED
Test: Upper.........................PASSED
Test: UpperCase.....................PASSED
Test: MakeUpper.....................PASSED
Test: Mid...........................PASSED
Test: Remove........................PASSED
Test: RemoveLast....................PASSED
Test: Replace ret...................PASSED
Test: Replace value.................PASSED
Test: AfterFirst....................PASSED
Test: AfterFirst str................PASSED
Test: AfterLast.....................PASSED
Test: AfterLast str.................PASSED
Test: BeforeFirst...................PASSED
Test: BeforeFirst str...............PASSED
Test: BeforeLast....................PASSED
Test: BeforeLast str................PASSED
Test: Right.........................PASSED
Test: Left..........................PASSED
Test: Matches.......................PASSED
Test: Find..........................PASSED
Test: Find not......................PASSED
Test: AddChar 'D'...................PASSED
Test: GetChar 0.....................PASSED
Test: Assignment 0..................PASSED
Test: Assignment 1..................PASSED
Test: Set 0.........................PASSED
Test: Set 1.........................PASSED
Test: ConcatNull....................PASSED
Test: wxString_ToLong good..........PASSED
Test: wxString_ToLong bad...........PASSED

Executed tests: 56
passed tests:   58
failed tests:   0
======= Test wx String END =======
======= Test wx String unicode BEGINN =======
[ERROR] Test: This implementation doesn't support UNICODE...MADE-FAILED
[ERROR] not implemented, as you can see on the wrong test string (it has to show Cyrillic  and ?Japanese? symbols

Executed tests: 0
passed tests:   0
failed tests:   1
======= Test wx String unicode END =======
======= Test wx Color BEGINN =======
Test: Set...........................PASSED
Test: tostring......................PASSED
Test: _cloned.......................PASSED
Test: Red...........................PASSED
Test: Green.........................PASSED
Test: Blue..........................PASSED
Test: IsOK..........................PASSED

Executed tests: 7
passed tests:   7
failed tests:   0
======= Test wx Color END  =======
======= Test wxArrayString BEGINN =======
Test: constructor...................PASSED
Test: Add wxString..................PASSED
Test: GetCount......................PASSED
Test: Index("String1")..............PASSED
Test: Index("String10").............PASSED
Test: Index("string1",true,false)...PASSED
Test: Index("string1",false,false)..PASSED
Test: Index("string2",false,false)..PASSED
Test: Index("string2",false,true)...PASSED
Test: Item..........................PASSED
Test: _cloned.......................PASSED
itemValue='String2 modified'; newValue='String2 modified'
Test: Item after modify.............PASSED
Test: SetItem.......................PASSED
Test: SetItem.......................PASSED
Test: SetItem old ref...............PASSED
Test: Clear.........................PASSED

Executed tests: 15
passed tests:   16
failed tests:   0
======= Test wxArrayString END  =======
======= Test wxFileName BEGINN =======
Test: constructor...................PASSED
Use path: \share\codeblocks\
Test: tostring......................PASSED
Test: _cloned.......................PASSED
Test: Assign........................PASSED
Test: GetDirCount...................PASSED
Test: GetDirs.......................PASSED
Test: Clear.........................PASSED
Test: AssignDir.....................PASSED
Test: AssignCwd = D:\code\cbsource\script31\src\output31_64\
Test: AssignCwd ????................PASSED
Test: GetCwd = D:\code\cbsource\script31\src\output31_64
Test: GetCwd ????...................PASSED
Test: AssignHomeDir = C:\Users\Administrator\
Test: AssignHomeDir ????............PASSED
Test: GetExt........................PASSED
Test: GetFullName...................PASSED
Test: GetFullPath...................PASSED
Test: GetLongPath = share\CodeBlocks\tips.txt
Test: GetLongPath ????..............PASSED
Test: GetName.......................PASSED
Test: GetPath = \share\codeblocks
Test: GetPath ????..................PASSED
Test: GetShortPath = \share\codeblocks\tips.txt
Test: GetShortPath ????.............PASSED
Test: GetVolume = 
Test: GetVolume ????................PASSED
Test: HasExt........................PASSED
Test: HasExt not (after ClearExt)...PASSED
Test: HasName.......................PASSED
[ERROR] Test: HasVolume.....................FAILED
[ERROR] got:    false
[ERROR] needed: true
Test: IsAbsolute....................PASSED
Test: IsOk..........................PASSED
Test: IsRelative....................PASSED
Test: IsDir.........................PASSED
Test: GetFullName...................PASSED
Test: GetFullPath...................PASSED
Test: InsertDir.....................PASSED
[ERROR] Test: InsertDir value...............FAILED
[ERROR] got:    "\newdir\share\codeblocks\"
[ERROR] needed: "newdir\\share\codeblocks\ "
Test: PrependDir....................PASSED
[ERROR] Test: PrependDir value..............FAILED
[ERROR] got:    "\newdir\share\codeblocks\"
[ERROR] needed: "newdir\\share\codeblocks\ "
Test: RemoveDir.....................PASSED
Test: AppendDir.....................PASSED
Test: AppendDir value...............PASSED
Test: MakeAbsolute..................PASSED
[ERROR] Test: MakeAbsolute value............FAILED
[ERROR] got:    "C:\share\codeblocks\tips.txt"
[ERROR] needed: "C:\Users\Administrator\\share\codeblocks\tips.txt "
Test: MakeRelativeTo................PASSED
[ERROR] Test: MakeRelativeTo value..........FAILED
[ERROR] got:    "..\..\share\codeblocks\tips.txt"
[ERROR] needed: "\share\codeblocks\tips.txt "
Test: Normalize.....................PASSED
[ERROR] Test: Normalize value...............FAILED
[ERROR] got:    "C:\share\codeblocks\tips.txt"
[ERROR] needed: "C:\Users\Administrator\\share\codeblocks\tips.txt "
Test: SameAs equal..................PASSED
Test: SameAs not equal..............PASSED
Test: SetExt........................PASSED
Test: SetEmptyExt...................PASSED
Test: SetEmptyExt has...............PASSED
Test: SetFullName...................PASSED
Test: SetName.......................PASSED
[ERROR] Test: SetVolume.....................FAILED
[ERROR] got:    "\\afterName\share\codeblocks\afterName.my"
[ERROR] needed: "\share\codeblocks\afterName.my "

Executed tests: 42
passed tests:   43
failed tests:   7
======= Test wxFileName END  =======
======= Test wxPoint BEGINN =======
Test: compare gt....................PASSED
Test: compare gt....................PASSED
Test: compare lt....................PASSED
Test: compare lt....................PASSED
Test: Cmp...........................PASSED
Test: Cmp not.......................PASSED
Test: _tostring.....................PASSED
Test: _cloned.......................PASSED

Executed tests: 8
passed tests:   8
failed tests:   0
======= Test wxPoint END  =======
======= Test wxSize BEGINN =======
Test: _tostring.....................PASSED
Test: _cloned.......................PASSED
Test: GetWidth......................PASSED
Test: GetHeight.....................PASSED
Test: SetWidth......................PASSED
Test: SetHeight.....................PASSED

Executed tests: 6
passed tests:   6
failed tests:   0
======= Test wxSize END  =======

Global executed tests: 146
Global passed tests:   138
Global failed tests:   9
Script loaded successfully


Quote
3. Plugins -> Test scripting -> Test wx or Test sdk

I think the "Test wx" result is the same as the step 2.

Here is the Test sdk result: when after testing, there is a warning message box:
" Couldn't save project C:\Users\ADMINI~1\AppData\Local\Temp\sdk_tests\NewProjects.cbp (Maybe the file is write-protected?)"

The log contents are too big to paste here, so I upload as attachment.

BTW: I'm using the portable mode to start the C::B,
Code
start cblauncher.exe --debug-log --no-dde --no-check-associations --multiple-instance --no-splash-screen
but it looks like it still use some global folders.

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2974
Re: Squirrel 3.1 and new bindings
« Reply #7 on: April 18, 2021, 05:28:49 pm »
I have run the wrong tests...

For wx i get the same results as ollydbg...

for sdk i got some write permission errors like ollydbg and at the end some crash:
Code
error:
error: AN ERROR HAS OCCURED [the index 'SetModified' does not exist]
error:
error: CALLSTACK
error: *FUNCTION [test_classes()] C:\Users\XXXXX\codeblocks_git_obfuscated\src\scripts\tests/sdk_test.script line [1353]
error: *FUNCTION [Run()] C:\Users\XXXXX\Documents\src\scripts\tests/sdk_test.script line [14]
error: *FUNCTION [StartSDKTest()] C:\Users\XXXXX\codeblocks_git_obfuscated\src\scripts\tests\script_test_plugin.script line [90]
error: *FUNCTION [OnMenuClicked()] C:\Users\XXXXX\codeblocks_git_obfuscated\src\scripts\tests\script_test_plugin.script line [62]
error:
error: LOCALS
error: [editor1Filename] INSTANCE
error: [editor0Filename] INSTANCE
error: [editor1] NULL
error: [editor0] INSTANCE
error: [editorMgr] INSTANCE
error: [tempFolder] INSTANCE
error: [this] INSTANCE
error: [this] INSTANCE
error: [sdk] INSTANCE
error: [this] INSTANCE
error: [index] 1
error: [this] INSTANCE

exactly as ollydbg ...

sry about the noise...

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #8 on: April 18, 2021, 05:43:17 pm »
The tests are not really windows proofed. Either I have to find a windows machine or someone else to volunteer to try and fix them.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #9 on: April 24, 2021, 01:26:34 am »
I've applied a modified version of the stahta01, please let me know if they work.
(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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5345
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Squirrel 3.1 and new bindings
« Reply #10 on: April 24, 2021, 01:49:30 am »
I've applied a modified version of the stahta01, please let me know if they work.

I got such build error:

Code
-------------- Build: sdk in Code::Blocks wx3.1.x (64 bit) (compiler: GNU GCC Compiler)---------------

[100.0%] Running target pre-build steps
.objs31_64\autorevision +wx +int +t .. include/autorevision.h
[100.0%] g++.exe -shared  -Wl,--out-implib=devel31_64\libcodeblocks.a -Wl,--dll -Ld:\code\wxWidgets-3.1.5\lib\gcc_dll -Ldevel31_64 .objs31_64\sdk\configmanager-revision.o .objs31_64\sdk\annoyingdialog.o .objs31_64\sdk\autodetectcompilers.o .objs31_64\sdk\base64.o .objs31_64\sdk\blockallocated.o .objs31_64\sdk\cbart_provider.o .objs31_64\sdk\cbauibook.o .objs31_64\sdk\cbcolourmanager.o .objs31_64\sdk\cbdebugger_interfaces.o .objs31_64\sdk\cbeditor.o .objs31_64\sdk\cbeditorprintout.o .objs31_64\sdk\cbexception.o .objs31_64\sdk\cbplugin.o .objs31_64\sdk\cbproject.o .objs31_64\sdk\cbstatusbar.o .objs31_64\sdk\cbstyledtextctrl.o .objs31_64\sdk\cbthreadpool.o .objs31_64\sdk\cbtreectrl.o .objs31_64\sdk\cbworkspace.o .objs31_64\sdk\ccmanager.o .objs31_64\sdk\compileoptionsbase.o .objs31_64\sdk\compiler.o .objs31_64\sdk\compilercommandgenerator.o .objs31_64\sdk\compilerfactory.o .objs31_64\sdk\compileroptions.o .objs31_64\sdk\compiletargetbase.o .objs31_64\sdk\configmanager.o .objs31_64\sdk\configurationpanel.o .objs31_64\sdk\configuretoolsdlg.o .objs31_64\sdk\confirmreplacedlg.o .objs31_64\sdk\crc32.o .objs31_64\sdk\debuggermanager.o .objs31_64\sdk\editarrayfiledlg.o .objs31_64\sdk\editarrayorderdlg.o .objs31_64\sdk\editarraystringdlg.o .objs31_64\sdk\editor_hooks.o .objs31_64\sdk\editor_utils.o .objs31_64\sdk\editorbase.o .objs31_64\sdk\editorcolourset.o .objs31_64\sdk\editorlexerloader.o .objs31_64\sdk\editormanager.o .objs31_64\sdk\editpairdlg.o .objs31_64\sdk\editpathdlg.o .objs31_64\sdk\edittooldlg.o .objs31_64\sdk\encodingdetector.o .objs31_64\sdk\externaldepsdlg.o .objs31_64\sdk\filefilters.o .objs31_64\sdk\filegroupsandmasks.o .objs31_64\sdk\filemanager.o .objs31_64\sdk\findreplacedlg.o .objs31_64\sdk\genericmultilinenotesdlg.o .objs31_64\sdk\globals.o .objs31_64\sdk\importers_globals.o .objs31_64\sdk\incremental_select_helper.o .objs31_64\sdk\infowindow.o .objs31_64\sdk\loggers.o .objs31_64\sdk\logmanager.o .objs31_64\sdk\macrosmanager.o .objs31_64\sdk\manager.o .objs31_64\sdk\menuitemsmanager.o .objs31_64\sdk\mozilla_chardet\src\CharDistribution.o .objs31_64\sdk\mozilla_chardet\src\JpCntx.o .objs31_64\sdk\mozilla_chardet\src\LangBulgarianModel.o .objs31_64\sdk\mozilla_chardet\src\LangCyrillicModel.o .objs31_64\sdk\mozilla_chardet\src\LangGreekModel.o .objs31_64\sdk\mozilla_chardet\src\LangHebrewModel.o .objs31_64\sdk\mozilla_chardet\src\LangHungarianModel.o .objs31_64\sdk\mozilla_chardet\src\LangThaiModel.o .objs31_64\sdk\mozilla_chardet\src\nsBig5Prober.o .objs31_64\sdk\mozilla_chardet\src\nsCharSetProber.o .objs31_64\sdk\mozilla_chardet\src\nsEscCharsetProber.o .objs31_64\sdk\mozilla_chardet\src\nsEscSM.o .objs31_64\sdk\mozilla_chardet\src\nsEUCJPProber.o .objs31_64\sdk\mozilla_chardet\src\nsEUCKRProber.o .objs31_64\sdk\mozilla_chardet\src\nsEUCTWProber.o .objs31_64\sdk\mozilla_chardet\src\nsGB2312Prober.o .objs31_64\sdk\mozilla_chardet\src\nsHebrewProber.o .objs31_64\sdk\mozilla_chardet\src\nsLatin1Prober.o .objs31_64\sdk\mozilla_chardet\src\nsMBCSGroupProber.o .objs31_64\sdk\mozilla_chardet\src\nsMBCSSM.o .objs31_64\sdk\mozilla_chardet\src\nsSBCharSetProber.o .objs31_64\sdk\mozilla_chardet\src\nsSBCSGroupProber.o .objs31_64\sdk\mozilla_chardet\src\nsSJISProber.o .objs31_64\sdk\mozilla_chardet\src\nsUniversalDetector.o .objs31_64\sdk\mozilla_chardet\src\nsUTF8Prober.o .objs31_64\sdk\multiselectdlg.o .objs31_64\sdk\newfromtemplatedlg.o .objs31_64\sdk\personalitymanager.o .objs31_64\sdk\pipedprocess.o .objs31_64\sdk\pluginmanager.o .objs31_64\sdk\pluginsconfigurationdlg.o .objs31_64\sdk\printing_types.o .objs31_64\sdk\projectbuildtarget.o .objs31_64\sdk\projectfile.o .objs31_64\sdk\projectfileoptionsdlg.o .objs31_64\sdk\projectlayoutloader.o .objs31_64\sdk\projectloader.o .objs31_64\sdk\projectloader_hooks.o .objs31_64\sdk\projectmanager.o .objs31_64\sdk\projectsfilemasksdlg.o .objs31_64\sdk\projecttemplateloader.o .objs31_64\sdk\scripting\bindings\sc_consts.o .objs31_64\sdk\scripting\bindings\sc_globals.o .objs31_64\sdk\scripting\bindings\sc_io.o .objs31_64\sdk\scripting\bindings\sc_plugin.o .objs31_64\sdk\scripting\bindings\sc_progress.o .objs31_64\sdk\scripting\bindings\sc_util_dialogs.o .objs31_64\sdk\scripting\bindings\sc_utils.o .objs31_64\sdk\scripting\bindings\sc_wxtypes.o .objs31_64\sdk\scripting\bindings\scriptbindings.o .objs31_64\sdk\scriptingmanager.o .objs31_64\sdk\scriptsecuritywarningdlg.o .objs31_64\sdk\scrollingdialog.o .objs31_64\sdk\sdk_events.o .objs31_64\sdk\searchresultslog.o .objs31_64\sdk\selecttargetdlg.o .objs31_64\sdk\templatemanager.o .objs31_64\sdk\tinywxuni.o .objs31_64\sdk\toolsmanager.o .objs31_64\sdk\uservarmanager.o .objs31_64\sdk\workspaceloader.o .objs31_64\sdk\xtra_res.o  -o devel31_64\codeblocks.dll -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined  -lshfolder -ltxml -lwxscintilla_cb -lsquirrel -lgdi32 -lwxmsw31u
devel31_64/libsquirrel.a(sqstdaux.o): In function `sqstd_printcallstack':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:8: undefined reference to `__imp_sq_geterrorfunc'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:18: undefined reference to `__imp_sq_stackinfos'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:32: undefined reference to `__imp_sq_getlocal'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:35: undefined reference to `__imp_sq_gettype'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:41: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:45: undefined reference to `__imp_sq_getfloat'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:52: undefined reference to `__imp_sq_getstring'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:87: undefined reference to `__imp_sq_getbool'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:93: undefined reference to `__imp_sq_pop'
devel31_64/libsquirrel.a(sqstdaux.o): In function `_sqstd_aux_printerror':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:101: undefined reference to `__imp_sq_geterrorfunc'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:104: undefined reference to `__imp_sq_gettop'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:105: undefined reference to `__imp_sq_getstring'
devel31_64/libsquirrel.a(sqstdaux.o): In function `_sqstd_compiler_error(SQVM*, char const*, char const*, long long, long long)':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:119: undefined reference to `__imp_sq_geterrorfunc'
devel31_64/libsquirrel.a(sqstdaux.o): In function `sqstd_seterrorhandlers':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:127: undefined reference to `__imp_sq_setcompilererrorhandler'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:128: undefined reference to `__imp_sq_newclosure'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:129: undefined reference to `__imp_sq_seterrorhandler'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob_resize':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:25: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:25: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:25: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:27: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:29: undefined reference to `__imp_sq_throwerror'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob_swap4':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:48: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:48: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:48: undefined reference to `__imp_sq_throwerror'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob_swap2':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:59: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:59: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:59: undefined reference to `__imp_sq_throwerror'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob__set':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:70: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:70: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:70: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:72: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:73: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:75: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:77: undefined reference to `__imp_sq_push'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob__get':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:83: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:83: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:83: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:85: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:87: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:88: undefined reference to `__imp_sq_pushinteger'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob__nexti':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:94: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:94: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:94: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:95: undefined reference to `__imp_sq_gettype'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:96: undefined reference to `__imp_sq_pushinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:100: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:102: undefined reference to `__imp_sq_pushinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:105: undefined reference to `__imp_sq_pushnull'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:108: undefined reference to `__imp_sq_throwerror'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob__typeof':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:113: undefined reference to `__imp_sq_pushstring'
Process terminated with status 1 (0 minute(s), 49 second(s))


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #11 on: April 24, 2021, 04:47:08 am »
I've applied a modified version of the stahta01, please let me know if they work.

I got such build error:

Code
-------------- Build: sdk in Code::Blocks wx3.1.x (64 bit) (compiler: GNU GCC Compiler)---------------

[100.0%] Running target pre-build steps
.objs31_64\autorevision +wx +int +t .. include/autorevision.h
[100.0%] g++.exe -shared  -Wl,--out-implib=devel31_64\libcodeblocks.a -Wl,--dll -Ld:\code\wxWidgets-3.1.5\lib\gcc_dll -Ldevel31_64 .objs31_64\sdk\configmanager-revision.o .objs31_64\sdk\annoyingdialog.o .objs31_64\sdk\autodetectcompilers.o .objs31_64\sdk\base64.o .objs31_64\sdk\blockallocated.o .objs31_64\sdk\cbart_provider.o .objs31_64\sdk\cbauibook.o .objs31_64\sdk\cbcolourmanager.o .objs31_64\sdk\cbdebugger_interfaces.o .objs31_64\sdk\cbeditor.o .objs31_64\sdk\cbeditorprintout.o .objs31_64\sdk\cbexception.o .objs31_64\sdk\cbplugin.o .objs31_64\sdk\cbproject.o .objs31_64\sdk\cbstatusbar.o .objs31_64\sdk\cbstyledtextctrl.o .objs31_64\sdk\cbthreadpool.o .objs31_64\sdk\cbtreectrl.o .objs31_64\sdk\cbworkspace.o .objs31_64\sdk\ccmanager.o .objs31_64\sdk\compileoptionsbase.o .objs31_64\sdk\compiler.o .objs31_64\sdk\compilercommandgenerator.o .objs31_64\sdk\compilerfactory.o .objs31_64\sdk\compileroptions.o .objs31_64\sdk\compiletargetbase.o .objs31_64\sdk\configmanager.o .objs31_64\sdk\configurationpanel.o .objs31_64\sdk\configuretoolsdlg.o .objs31_64\sdk\confirmreplacedlg.o .objs31_64\sdk\crc32.o .objs31_64\sdk\debuggermanager.o .objs31_64\sdk\editarrayfiledlg.o .objs31_64\sdk\editarrayorderdlg.o .objs31_64\sdk\editarraystringdlg.o .objs31_64\sdk\editor_hooks.o .objs31_64\sdk\editor_utils.o .objs31_64\sdk\editorbase.o .objs31_64\sdk\editorcolourset.o .objs31_64\sdk\editorlexerloader.o .objs31_64\sdk\editormanager.o .objs31_64\sdk\editpairdlg.o .objs31_64\sdk\editpathdlg.o .objs31_64\sdk\edittooldlg.o .objs31_64\sdk\encodingdetector.o .objs31_64\sdk\externaldepsdlg.o .objs31_64\sdk\filefilters.o .objs31_64\sdk\filegroupsandmasks.o .objs31_64\sdk\filemanager.o .objs31_64\sdk\findreplacedlg.o .objs31_64\sdk\genericmultilinenotesdlg.o .objs31_64\sdk\globals.o .objs31_64\sdk\importers_globals.o .objs31_64\sdk\incremental_select_helper.o .objs31_64\sdk\infowindow.o .objs31_64\sdk\loggers.o .objs31_64\sdk\logmanager.o .objs31_64\sdk\macrosmanager.o .objs31_64\sdk\manager.o .objs31_64\sdk\menuitemsmanager.o .objs31_64\sdk\mozilla_chardet\src\CharDistribution.o .objs31_64\sdk\mozilla_chardet\src\JpCntx.o .objs31_64\sdk\mozilla_chardet\src\LangBulgarianModel.o .objs31_64\sdk\mozilla_chardet\src\LangCyrillicModel.o .objs31_64\sdk\mozilla_chardet\src\LangGreekModel.o .objs31_64\sdk\mozilla_chardet\src\LangHebrewModel.o .objs31_64\sdk\mozilla_chardet\src\LangHungarianModel.o .objs31_64\sdk\mozilla_chardet\src\LangThaiModel.o .objs31_64\sdk\mozilla_chardet\src\nsBig5Prober.o .objs31_64\sdk\mozilla_chardet\src\nsCharSetProber.o .objs31_64\sdk\mozilla_chardet\src\nsEscCharsetProber.o .objs31_64\sdk\mozilla_chardet\src\nsEscSM.o .objs31_64\sdk\mozilla_chardet\src\nsEUCJPProber.o .objs31_64\sdk\mozilla_chardet\src\nsEUCKRProber.o .objs31_64\sdk\mozilla_chardet\src\nsEUCTWProber.o .objs31_64\sdk\mozilla_chardet\src\nsGB2312Prober.o .objs31_64\sdk\mozilla_chardet\src\nsHebrewProber.o .objs31_64\sdk\mozilla_chardet\src\nsLatin1Prober.o .objs31_64\sdk\mozilla_chardet\src\nsMBCSGroupProber.o .objs31_64\sdk\mozilla_chardet\src\nsMBCSSM.o .objs31_64\sdk\mozilla_chardet\src\nsSBCharSetProber.o .objs31_64\sdk\mozilla_chardet\src\nsSBCSGroupProber.o .objs31_64\sdk\mozilla_chardet\src\nsSJISProber.o .objs31_64\sdk\mozilla_chardet\src\nsUniversalDetector.o .objs31_64\sdk\mozilla_chardet\src\nsUTF8Prober.o .objs31_64\sdk\multiselectdlg.o .objs31_64\sdk\newfromtemplatedlg.o .objs31_64\sdk\personalitymanager.o .objs31_64\sdk\pipedprocess.o .objs31_64\sdk\pluginmanager.o .objs31_64\sdk\pluginsconfigurationdlg.o .objs31_64\sdk\printing_types.o .objs31_64\sdk\projectbuildtarget.o .objs31_64\sdk\projectfile.o .objs31_64\sdk\projectfileoptionsdlg.o .objs31_64\sdk\projectlayoutloader.o .objs31_64\sdk\projectloader.o .objs31_64\sdk\projectloader_hooks.o .objs31_64\sdk\projectmanager.o .objs31_64\sdk\projectsfilemasksdlg.o .objs31_64\sdk\projecttemplateloader.o .objs31_64\sdk\scripting\bindings\sc_consts.o .objs31_64\sdk\scripting\bindings\sc_globals.o .objs31_64\sdk\scripting\bindings\sc_io.o .objs31_64\sdk\scripting\bindings\sc_plugin.o .objs31_64\sdk\scripting\bindings\sc_progress.o .objs31_64\sdk\scripting\bindings\sc_util_dialogs.o .objs31_64\sdk\scripting\bindings\sc_utils.o .objs31_64\sdk\scripting\bindings\sc_wxtypes.o .objs31_64\sdk\scripting\bindings\scriptbindings.o .objs31_64\sdk\scriptingmanager.o .objs31_64\sdk\scriptsecuritywarningdlg.o .objs31_64\sdk\scrollingdialog.o .objs31_64\sdk\sdk_events.o .objs31_64\sdk\searchresultslog.o .objs31_64\sdk\selecttargetdlg.o .objs31_64\sdk\templatemanager.o .objs31_64\sdk\tinywxuni.o .objs31_64\sdk\toolsmanager.o .objs31_64\sdk\uservarmanager.o .objs31_64\sdk\workspaceloader.o .objs31_64\sdk\xtra_res.o  -o devel31_64\codeblocks.dll -Wl,--enable-auto-image-base -Wl,--add-stdcall-alias -Wl,--enable-auto-import -Wl,--no-undefined  -lshfolder -ltxml -lwxscintilla_cb -lsquirrel -lgdi32 -lwxmsw31u
devel31_64/libsquirrel.a(sqstdaux.o): In function `sqstd_printcallstack':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:8: undefined reference to `__imp_sq_geterrorfunc'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:18: undefined reference to `__imp_sq_stackinfos'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:32: undefined reference to `__imp_sq_getlocal'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:35: undefined reference to `__imp_sq_gettype'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:41: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:45: undefined reference to `__imp_sq_getfloat'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:52: undefined reference to `__imp_sq_getstring'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:87: undefined reference to `__imp_sq_getbool'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:93: undefined reference to `__imp_sq_pop'
devel31_64/libsquirrel.a(sqstdaux.o): In function `_sqstd_aux_printerror':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:101: undefined reference to `__imp_sq_geterrorfunc'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:104: undefined reference to `__imp_sq_gettop'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:105: undefined reference to `__imp_sq_getstring'
devel31_64/libsquirrel.a(sqstdaux.o): In function `_sqstd_compiler_error(SQVM*, char const*, char const*, long long, long long)':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:119: undefined reference to `__imp_sq_geterrorfunc'
devel31_64/libsquirrel.a(sqstdaux.o): In function `sqstd_seterrorhandlers':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:127: undefined reference to `__imp_sq_setcompilererrorhandler'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:128: undefined reference to `__imp_sq_newclosure'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdaux.cpp:129: undefined reference to `__imp_sq_seterrorhandler'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob_resize':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:25: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:25: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:25: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:27: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:29: undefined reference to `__imp_sq_throwerror'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob_swap4':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:48: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:48: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:48: undefined reference to `__imp_sq_throwerror'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob_swap2':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:59: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:59: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:59: undefined reference to `__imp_sq_throwerror'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob__set':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:70: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:70: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:70: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:72: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:73: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:75: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:77: undefined reference to `__imp_sq_push'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob__get':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:83: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:83: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:83: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:85: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:87: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:88: undefined reference to `__imp_sq_pushinteger'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob__nexti':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:94: undefined reference to `__imp_sq_getinstanceup'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:94: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:94: undefined reference to `__imp_sq_throwerror'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:95: undefined reference to `__imp_sq_gettype'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:96: undefined reference to `__imp_sq_pushinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:100: undefined reference to `__imp_sq_getinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:102: undefined reference to `__imp_sq_pushinteger'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:105: undefined reference to `__imp_sq_pushnull'
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:108: undefined reference to `__imp_sq_throwerror'
devel31_64/libsquirrel.a(sqstdblob.o): In function `_blob__typeof':
D:/code/cbsource/script31/src/sdk/scripting/sqstdlib/sqstdblob.cpp:113: undefined reference to `__imp_sq_pushstring'
Process terminated with status 1 (0 minute(s), 49 second(s))



I also got an build error that was like the above error.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #12 on: April 24, 2021, 05:49:58 pm »
Code
From 7c9010e20725e0e11cfc63cf7d7ee91f1f021109 Mon Sep 17 00:00:00 2001
From: Tim Stahlhut <[email protected]>
Date: Sat, 24 Apr 2021 11:47:24 -0400
Subject: Add define of EXPORT_LIB to Squirrel target

---
 src/CodeBlocks_wx31_64.cbp | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/CodeBlocks_wx31_64.cbp b/src/CodeBlocks_wx31_64.cbp
index 16c775c76..6d31ed7d5 100644
--- a/src/CodeBlocks_wx31_64.cbp
+++ b/src/CodeBlocks_wx31_64.cbp
@@ -50,6 +50,7 @@
  <Option type="2" />
  <Option compiler="gcc" />
  <Compiler>
+ <Add option="-DEXPORT_LIB" />
  <Add directory="include/scripting/include" />
  </Compiler>
  </Target>
--
2.31.1.windows.1


I am still building with the above patch; but, it appears to have fixed the above build error at least partly.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #13 on: April 24, 2021, 07:09:11 pm »
Code
From fcd586699f2330ee51d684945031252d7122c378 Mon Sep 17 00:00:00 2001
From: Tim Stahlhut <[email protected]>
Date: Sat, 24 Apr 2021 11:47:24 -0400
Subject: Add define of EXPORT_LIB to Squirrel target

---
 src/CodeBlocks_wx31.cbp    | 1 +
 src/CodeBlocks_wx31_64.cbp | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/CodeBlocks_wx31.cbp b/src/CodeBlocks_wx31.cbp
index adfafe2aa..0652f4cf4 100644
--- a/src/CodeBlocks_wx31.cbp
+++ b/src/CodeBlocks_wx31.cbp
@@ -50,6 +50,7 @@
  <Option type="2" />
  <Option compiler="gcc" />
  <Compiler>
+ <Add option="-DEXPORT_LIB" />
  <Add directory="include/scripting/include" />
  </Compiler>
  </Target>
diff --git a/src/CodeBlocks_wx31_64.cbp b/src/CodeBlocks_wx31_64.cbp
index 16c775c76..6d31ed7d5 100644
--- a/src/CodeBlocks_wx31_64.cbp
+++ b/src/CodeBlocks_wx31_64.cbp
@@ -50,6 +50,7 @@
  <Option type="2" />
  <Option compiler="gcc" />
  <Compiler>
+ <Add option="-DEXPORT_LIB" />
  <Add directory="include/scripting/include" />
  </Compiler>
  </Target>
--
2.31.1.windows.1


Updated the patch file; I have only tested the 64 bit project and it builds without error.
I have yet to run the built binaries.

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 stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #14 on: April 25, 2021, 05:59:40 am »
Code
Welcome to the script console!
Plugin instance: (instance : 0x0000000006c8a740)
======= Test Test environment BEGINN =======
 this is intended to fail:
[ERROR] Test: test_string...................FAILED
[ERROR] got:    "hallo"
[ERROR] needed: "nope "

Executed tests: 1
passed tests:   0
failed tests:   1
======= Test Test environment END =======
======= Test wx String BEGINN =======
Test: tostring......................PASSED
Test: constructor(SQchar)...........PASSED
Test: cmp...........................PASSED
Test: cmp not.......................PASSED
Test: cmp string....................PASSED
Test: cmp string2...................PASSED
Test: cmp string not................PASSED
Test: cmp string not2...............PASSED
Test: Compare.......................PASSED
Test: Compare lt....................PASSED
Test: Compare gt....................PASSED
Test: Compare lt string.............PASSED
Test: Compare gt string.............PASSED
Test: _add..........................PASSED
Test: _add wxString+string..........PASSED
Test: _add string+wxString..........PASSED
Test: _add wxString+int.............PASSED
Test: _add wxString+float...........PASSED
Test: _cloned.......................PASSED
Test: IsEmpty.......................PASSED
Test: IsEmpty.......................PASSED
Test: Length........................PASSED
Test: length........................PASSED
Test: len...........................PASSED
Test: size..........................PASSED
Test: Lower.........................PASSED
Test: LowerCase.....................PASSED
Test: MakeLower.....................PASSED
Test: Upper.........................PASSED
Test: UpperCase.....................PASSED
Test: MakeUpper.....................PASSED
Test: Mid...........................PASSED
Test: Remove........................PASSED
Test: RemoveLast....................PASSED
Test: Replace ret...................PASSED
Test: Replace value.................PASSED
Test: AfterFirst....................PASSED
Test: AfterFirst str................PASSED
Test: AfterLast.....................PASSED
Test: AfterLast str.................PASSED
Test: BeforeFirst...................PASSED
Test: BeforeFirst str...............PASSED
Test: BeforeLast....................PASSED
Test: BeforeLast str................PASSED
Test: Right.........................PASSED
Test: Left..........................PASSED
Test: Matches.......................PASSED
Test: Find..........................PASSED
Test: Find not......................PASSED
Test: AddChar 'D'...................PASSED
Test: GetChar 0.....................PASSED
Test: Assignment 0..................PASSED
Test: Assignment 1..................PASSED
Test: Set 0.........................PASSED
Test: Set 1.........................PASSED
Test: ConcatNull....................PASSED
Test: wxString_ToLong good..........PASSED
Test: wxString_ToLong bad...........PASSED

Executed tests: 56
passed tests:   58
failed tests:   0
======= Test wx String END =======
======= Test wx String unicode BEGINN =======
test string: !5Aa ЉЩщӃ ウインカリ
[ERROR] Test: This implementation doesn't support UNICODE...MADE-FAILED
[ERROR] not implemented, as you can see on the wrong test string (it has to show Cyrillic  and ?Japanese? symbols

Executed tests: 0
passed tests:   0
failed tests:   1
======= Test wx String unicode END =======
======= Test wx Color BEGINN =======
Test: Set...........................PASSED
Test: tostring......................PASSED
Test: _cloned.......................PASSED
Test: Red...........................PASSED
Test: Green.........................PASSED
Test: Blue..........................PASSED
Test: IsOK..........................PASSED

Executed tests: 7
passed tests:   7
failed tests:   0
======= Test wx Color END  =======
======= Test wxArrayString BEGINN =======
Test: constructor...................PASSED
Test: Add wxString..................PASSED
Test: GetCount......................PASSED
Test: Index("String1")..............PASSED
Test: Index("String10").............PASSED
Test: Index("string1",true,false)...PASSED
Test: Index("string1",false,false)..PASSED
Test: Index("string2",false,false)..PASSED
Test: Index("string2",false,true)...PASSED
Test: Item..........................PASSED
Test: _cloned.......................PASSED
itemValue='String2 modified'; newValue='String2 modified'
Test: Item after modify.............PASSED
Test: SetItem.......................PASSED
Test: SetItem.......................PASSED
Test: SetItem old ref...............PASSED
Test: Clear.........................PASSED

Executed tests: 15
passed tests:   16
failed tests:   0
======= Test wxArrayString END  =======
======= Test wxFileName BEGINN =======
Test: constructor...................PASSED
Use path: \share\codeblocks\
Test: tostring......................PASSED
Test: _cloned.......................PASSED
Test: Assign........................PASSED
Test: GetDirCount...................PASSED
Test: GetDirs.......................PASSED
Test: Clear.........................PASSED
Test: AssignDir.....................PASSED
Test: AssignCwd = C:\repos\git\CB_Obf_scripting\src\output31_64\
Test: AssignCwd ????................PASSED
Test: GetCwd = C:\repos\git\CB_Obf_scripting\src\output31_64
Test: GetCwd ????...................PASSED
Test: AssignHomeDir = C:\Users\stahta01\
Test: AssignHomeDir ????............PASSED
Test: GetExt........................PASSED
Test: GetFullName...................PASSED
Test: GetFullPath...................PASSED
Test: GetLongPath = share\CodeBlocks\tips.txt
Test: GetLongPath ????..............PASSED
Test: GetName.......................PASSED
Test: GetPath = \share\codeblocks
Test: GetPath ????..................PASSED
Test: GetShortPath = \share\codeblocks\tips.txt
Test: GetShortPath ????.............PASSED
Test: GetVolume = 
Test: GetVolume ????................PASSED
Test: HasExt........................PASSED
Test: HasExt not (after ClearExt)...PASSED
Test: HasName.......................PASSED
[ERROR] Test: HasVolume.....................FAILED
[ERROR] got:    false
[ERROR] needed: true
Test: IsAbsolute....................PASSED
Test: IsOk..........................PASSED
Test: IsRelative....................PASSED
Test: IsDir.........................PASSED
Test: GetFullName...................PASSED
Test: GetFullPath...................PASSED
Test: InsertDir.....................PASSED
[ERROR] Test: InsertDir value...............FAILED
[ERROR] got:    "\newdir\share\codeblocks\"
[ERROR] needed: "newdir\\share\codeblocks\ "
Test: PrependDir....................PASSED
[ERROR] Test: PrependDir value..............FAILED
[ERROR] got:    "\newdir\share\codeblocks\"
[ERROR] needed: "newdir\\share\codeblocks\ "
Test: RemoveDir.....................PASSED
Test: AppendDir.....................PASSED
Test: AppendDir value...............PASSED
Test: MakeAbsolute..................PASSED
[ERROR] Test: MakeAbsolute value............FAILED
[ERROR] got:    "C:\share\codeblocks\tips.txt"
[ERROR] needed: "C:\Users\stahta01\\share\codeblocks\tips.txt "
Test: MakeRelativeTo................PASSED
[ERROR] Test: MakeRelativeTo value..........FAILED
[ERROR] got:    "..\..\share\codeblocks\tips.txt"
[ERROR] needed: "\share\codeblocks\tips.txt "
Test: Normalize.....................PASSED
[ERROR] Test: Normalize value...............FAILED
[ERROR] got:    "C:\share\codeblocks\tips.txt"
[ERROR] needed: "C:\Users\stahta01\\share\codeblocks\tips.txt "
Test: SameAs equal..................PASSED
Test: SameAs not equal..............PASSED
Test: SetExt........................PASSED
Test: SetEmptyExt...................PASSED
Test: SetEmptyExt has...............PASSED
Test: SetFullName...................PASSED
Test: SetName.......................PASSED
[ERROR] Test: SetVolume.....................FAILED
[ERROR] got:    "\\afterName\share\codeblocks\afterName.my"
[ERROR] needed: "\share\codeblocks\afterName.my "

Executed tests: 42
passed tests:   43
failed tests:   7
======= Test wxFileName END  =======
======= Test wxPoint BEGINN =======
Test: compare gt....................PASSED
Test: compare gt....................PASSED
Test: compare lt....................PASSED
Test: compare lt....................PASSED
Test: Cmp...........................PASSED
Test: Cmp not.......................PASSED
Test: _tostring.....................PASSED
Test: _cloned.......................PASSED

Executed tests: 8
passed tests:   8
failed tests:   0
======= Test wxPoint END  =======
======= Test wxSize BEGINN =======
Test: _tostring.....................PASSED
Test: _cloned.......................PASSED
Test: GetWidth......................PASSED
Test: GetHeight.....................PASSED
Test: SetWidth......................PASSED
Test: SetHeight.....................PASSED

Executed tests: 6
passed tests:   6
failed tests:   0
======= Test wxSize END  =======

Global executed tests: 146
Global passed tests:   138
Global failed tests:   9
Script loaded successfully

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 stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #15 on: April 25, 2021, 06:08:34 am »
After manually creating "sdk_tests" sub folder these results on the third run.

Tim S.

Code
======= Test SDK function END ======= 

Global executed tests: 519
Global passed tests:   498
Global failed tests:   21
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 stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #16 on: April 25, 2021, 06:16:54 am »
Code
======= Test helpers BEGINN ======= 
Test: MakePath 0....................PASSED
[ERROR] Test: MakePath 1....................FAILED
[ERROR] got:    "path\name"
[ERROR] needed: "path/name "
[ERROR] Test: MakePath 2....................FAILED
[ERROR] got:    "path/\name"
[ERROR] needed: "path/name "
[ERROR] Test: MakeDir 0.....................FAILED
[ERROR] got:    "name\"
[ERROR] needed: "name/ "
[ERROR] Test: MakeDir 1.....................FAILED
[ERROR] got:    "name/\"
[ERROR] needed: "name/ "
[ERROR] Test: MakeDir 2.....................FAILED
[ERROR] got:    "path\name/\"
[ERROR] needed: "path/name/ "
[ERROR] Test: MakeDir 3.....................FAILED
[ERROR] got:    "path/\name/\"
[ERROR] needed: "path/name/ "

Executed tests: 7
passed tests:   1
failed tests:   6
======= Test helpers END =======

Code
[ERROR] Test: CompileTargetBase::GetOutputFilename......................................FAILED
[ERROR] got:    "NewProject.exe"
[ERROR] needed: "NewProject "
[ERROR] Test: CompileTargetBase::SuggestOutputFilename..................................FAILED
[ERROR] got:    "NewProject.exe"
[ERROR] needed: "NewProject "
[ERROR] Test: CompileTargetBase::SetOutputFilename......................................FAILED
[ERROR] got:    "debugOutput.exe"
[ERROR] needed: "debugOutput "
[ERROR] Test: CompileTargetBase::SuggestOutputFilename after set........................FAILED
[ERROR] got:    "NewProject.exe"
[ERROR] needed: "NewProject "

Code
[ERROR] Test: CompileTargetBase::GetExecutableFilename..................................FAILED
[ERROR] got:    "C:\Users\stahta01\AppData\Local\Temp\sdk_tests\NewProject.exe"
[ERROR] needed: "C:\Users\stahta01\AppData\Local\Temp\sdk_tests\NewProject "
[ERROR] Test: CompileTargetBase::GetDynamicLibFilename..................................FAILED
[ERROR] got:    "C:\Users\stahta01\AppData\Local\Temp\sdk_tests\NewProject.exe"
[ERROR] needed: "C:\Users\stahta01\AppData\Local\Temp\sdk_tests\NewProject "

Code
[ERROR] Test: cbProject::AddFile 2: weight..........FAILED
[ERROR] got:    50
[ERROR] needed: 17

Code
[ERROR] Test: cbProject::ExtensionListNodes root after 2....FAILED
[ERROR] got:    "//rootNode[0]"
[ERROR] needed: "/rootNode[0] "
[ERROR] Test: cbProject::ExtensionListNodes after addition..FAILED
[ERROR] got:    "rootNode[0]/child[0];rootNode[0]/multi[1];rootNode[0]/multi[2]"
[ERROR] needed: "rootNode[0]/child[0];rootNode[0]/multi[0];rootNode[0]/multi[1] "

Code
[ERROR] Test: cbProject::ExtensionRemoveNode multi 1....................FAILED
[ERROR] got:    "rootNode[0]/child[0];rootNode[0]/multi[1]"
[ERROR] needed: "rootNode[0]/child[0];rootNode[0]/multi[0] "

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 ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5345
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: Squirrel 3.1 and new bindings
« Reply #17 on: April 25, 2021, 06:22:58 am »
Code
From fcd586699f2330ee51d684945031252d7122c378 Mon Sep 17 00:00:00 2001
From: Tim Stahlhut <[email protected]>
Date: Sat, 24 Apr 2021 11:47:24 -0400
Subject: Add define of EXPORT_LIB to Squirrel target

---
 src/CodeBlocks_wx31.cbp    | 1 +
 src/CodeBlocks_wx31_64.cbp | 1 +
 2 files changed, 2 insertions(+)

diff --git a/src/CodeBlocks_wx31.cbp b/src/CodeBlocks_wx31.cbp
index adfafe2aa..0652f4cf4 100644
--- a/src/CodeBlocks_wx31.cbp
+++ b/src/CodeBlocks_wx31.cbp
@@ -50,6 +50,7 @@
  <Option type="2" />
  <Option compiler="gcc" />
  <Compiler>
+ <Add option="-DEXPORT_LIB" />
  <Add directory="include/scripting/include" />
  </Compiler>
  </Target>
diff --git a/src/CodeBlocks_wx31_64.cbp b/src/CodeBlocks_wx31_64.cbp
index 16c775c76..6d31ed7d5 100644
--- a/src/CodeBlocks_wx31_64.cbp
+++ b/src/CodeBlocks_wx31_64.cbp
@@ -50,6 +50,7 @@
  <Option type="2" />
  <Option compiler="gcc" />
  <Compiler>
+ <Add option="-DEXPORT_LIB" />
  <Add directory="include/scripting/include" />
  </Compiler>
  </Target>
--
2.31.1.windows.1


Updated the patch file; I have only tested the 64 bit project and it builds without error.
I have yet to run the built binaries.

Tim S.

Hi, Tim, thanks, you patch fixes the build error on my 64bit Windows. I don't have 32bit GCC system right now.
And I see that I got the same test results as posted by you.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #18 on: April 25, 2021, 05:44:42 pm »
My MinGW GCC 32 bit build fails on this line from scriptingmanager.cpp

Code
static_assert(sizeof(int64_t)==sizeof(SQInteger), "Incorrect setup of Squirrel!");

Tim S.

« Last Edit: April 25, 2021, 05:58:42 pm 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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #19 on: April 25, 2021, 06:00:08 pm »
My MinGW GCC 32 bit build fails on this line from scriptingmanager.cpp
What do you use to build project files or autotools?
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #20 on: April 25, 2021, 06:06:37 pm »
In fact it should work fine if we change the comparison to >=. This is there to make sure that int64_t could take SQInteger values without loss of precision.
(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 stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #21 on: April 25, 2021, 10:11:18 pm »
My MinGW GCC 32 bit build fails on this line from scriptingmanager.cpp
What do you use to build project files or autotools?

CB Projects and MSys2 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 stahta01

  • Lives here!
  • ****
  • Posts: 7130
    • My Best Post
Re: Squirrel 3.1 and new bindings
« Reply #22 on: April 26, 2021, 01:53:23 am »
In fact it should work fine if we change the comparison to >=. This is there to make sure that int64_t could take SQInteger values without loss of precision.

Doing that did result in the core CB project building.

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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #23 on: May 04, 2021, 07:29:12 pm »
I've pushed a new commit and the tests should behave the same as on linux (as much as it is possible).

Have anyone tried any wizard? Are there any problems to report?
I'm nearing completion of this feature and I'll push it to svn in the next weeks.
(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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2974
Re: Squirrel 3.1 and new bindings
« Reply #24 on: May 05, 2021, 01:00:23 am »
Nice work, could compile it right away on windows.

failed tests:
Code
[ERROR] Test: cbProject::AddFile 2: weight..........FAILED
[ERROR] got:    50
[ERROR] needed: 17
[ERROR] Test: cbProject::AddFile 2: weight..........FAILED
[ERROR] got:    50
[ERROR] needed: 17

[ERROR] Test: cbProject::ExtensionListNodes root after 2....FAILED
[ERROR] got:    "//rootNode[0]"
[ERROR] needed: "/rootNode[0] "
[ERROR] Test: cbProject::ExtensionListNodes after addition..FAILED
[ERROR] got:    "rootNode[0]/child[0];rootNode[0]/multi[1];rootNode[0]/multi[2]"
[ERROR] needed: "rootNode[0]/child[0];rootNode[0]/multi[0];rootNode[0]/multi[1] "
[ERROR] Test: cbProject::ExtensionRemoveNode multi 1....................FAILED
[ERROR] got:    "rootNode[0]/child[0];rootNode[0]/multi[1]"
[ERROR] needed: "rootNode[0]/child[0];rootNode[0]/multi[0] "

Also the "Allow this script for this session" permission is not working, it keeps asking for permissions (probably old bug)

I only use wxWidgets wizard and console project wizard, and both seem to work

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #25 on: May 05, 2021, 10:28:38 pm »
Thanks for testing. So next week would be push time...

The failures are expected and are bugs in the API. I'll take a look at some of them soon.
The permission/sandbox/access system is also totally broken and what you see is totally normal unfortunately. At the moment I don't intend to fix it, I've looked at this and I don't have the time required to untangle it. :(
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #26 on: May 09, 2021, 02:58:09 pm »
Pushed in both svn and git...
(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 The_GTA

  • Multiple posting newcomer
  • *
  • Posts: 17
  • Developer & Entrepreneur
    • EirDev
Re: Squirrel 3.1 and new bindings
« Reply #27 on: May 11, 2021, 07:27:16 pm »
Thank you very much for your work on the project scripting system, oBFusCATed! While I have not yet tested this special Code::Blocks version I am very inclined to do so because most of my projects use the Squirrel based scripting system for inter-project static library dependency resolution! You see, scripting is the only way to apply build-time properties - including preprocessor definitions and when-existing static library inclusion - when they truly matter. In fact, I have even grown much experience of build-scripting and a fancy to writing these!

Thus let me share some of my experience with you. Maybe it can lead to a better scripting system design:

  • The _T syntax of scripts is very annoying. In the official Code::Blocks build forgetting to use the _T could even crash the entire IDE. Since you mention that the "==" should now just work, this makes me really happy. Please make use of strings as natural as possible.
  • How about adding a script function to add C/C++ preprocessor definitions into the compilation unit? After all, there is such an option in the IDE and it would be only natural to add a direct equivalent into the build scripting system. Having a direct function does also promote the idea of build script preprocessor definitions inspection, a well-needed addition to the existing #ifdef appliance check and color-highlighting features.

Looking forward to further developments! 👍

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #28 on: May 11, 2021, 07:44:20 pm »
  • The _T syntax of scripts is very annoying. In the official Code::Blocks build forgetting to use the _T could even crash the entire IDE. Since you mention that the "==" should now just work, this makes me really happy. Please make use of strings as natural as possible.
  • How about adding a script function to add C/C++ preprocessor definitions into the compilation unit? After all, there is such an option in the IDE and it would be only natural to add a direct equivalent into the build scripting system. Having a direct function does also promote the idea of build script preprocessor definitions inspection, a well-needed addition to the existing #ifdef appliance check and color-highlighting features.
1. Try the new version and tell me if something doesn't work. Keep in mind that string <->wxString casts aren't universal and might not work everywhere. But if there are crashes don't hesitate to report them. There is already a night build.
2. No idea what you're talking about. Please be more specific.

Looking forward to further developments! 👍
The only reason I've spend so much time on this is because the ond binding failed in closures, and I needed those to make debugger testing work. I hope to spend my time on something a bit more productive now.
(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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2974
Re: Squirrel 3.1 and new bindings
« Reply #29 on: May 18, 2021, 12:34:34 am »
Has someone tested the wxWidgets wizard on linux?
I have a problem, but i am not 100% sure if i have a broken installation or if it is a bug:
latest codeblocks trunk, linux mint 20
1) Create a new wxWidgets project
2) Name the project "test"
3) choose wxSmith as editor
4) finish the project

The generated source files have the name
Code
testApp.cpp
testApp.h
testMain.cpp
testMain.h

But the include is
Code
#include "TESTMain.h"
also the class is called
Code
TESTDialog
instead of
Code
testDialog
Now i get compilation errors about "TESTMain.h" not found


Afternote:
i have the same bug on windows, but because windows is case insensitive it does not trigger compilation error

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #30 on: May 18, 2021, 09:15:14 am »
I've tried it. I don't remember seeing any problems.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #31 on: May 18, 2021, 09:49:13 am »
The tests for upper and lower aren't good and I've failed to implement them correctly. Will fix soon.
(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 oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13304
    • Travis build status
Re: Squirrel 3.1 and new bindings
« Reply #32 on: May 18, 2021, 10:18:30 am »
See the attached patch:
Code
From 34494a8d7405e211f74101f3989651f340b02157 Mon Sep 17 00:00:00 2001
From: T Petrov <[email protected]>
Date: Tue, 18 May 2021 11:14:18 +0300
Subject: [PATCH] * scripting: Fix regressions in the wxString upper/lower
 bindings

> Upper/Lower were bound incorrectly and they called MakeUpper/MakeLower,
  which modified 'this'.
> MakeUpper/MakeLower returned a copy of 'this' and so further
  modifications to the string were not possible. This means that chaining
  MakeUpper and MakeLower fails in a subtle way.
---
 src/scripts/tests/wx_test.script          | 30 +++++++++++++++++++++++
 src/sdk/scripting/bindings/sc_wxtypes.cpp | 28 +++++++++++++++------
 2 files changed, 50 insertions(+), 8 deletions(-)

diff --git a/src/scripts/tests/wx_test.script b/src/scripts/tests/wx_test.script
index 3268702da..f6259bc1d 100644
--- a/src/scripts/tests/wx_test.script
+++ b/src/scripts/tests/wx_test.script
@@ -72,14 +72,44 @@ class wxTest extends script_test_base
         test_equal("length",string.length(),5);
         test_equal("len",string.len(),5);
         test_equal("size",string.size(),5);
+
+        // Lower case functions
+        string = _T("Hallo");
         test_string("Lower",string.Lower(),"hallo");
+        test_string("Lower after",string,"Hallo");
         string.LowerCase();
         test_string("LowerCase",string,"hallo");
+
+        string = _T("HallO");
         test_string("MakeLower",string.MakeLower(),"hallo");
+        test_string("MakeLower",string,"hallo");
+
+        // Upper case functions
+        string = _T("Hallo");
         test_string("Upper",string.Upper(),"HALLO");
+        test_string("Upper after",string,"Hallo");
         string.UpperCase();
         test_string("UpperCase",string,"HALLO");
+
+        string = _T("Hallo");
         test_string("MakeUpper",string.MakeUpper(),"HALLO");
+        test_string("MakeUpper",string,"HALLO");
+
+        // Test if the return value of MakeUpper/MakeLower is a proper reference to this.
+        // Test if the return value of Lower/Upper is a copy and not reference to this.
+        string = _T("Hallo");
+        test_string("MakeLower Chaining", string.MakeLower().Upper(),"HALLO");
+        test_string("MakeLower Chaining 2", string, "hallo");
+        string = _T("Hallo");
+        test_string("MakeLower Chaining 3", string.MakeLower().MakeUpper(),"HALLO");
+        test_string("MakeLower Chaining 4", string, "HALLO");
+        string = _T("Hallo");
+        test_string("MakeUpper Chaining", string.MakeUpper().Lower(),"hallo");
+        test_string("MakeUpper Chaining 2", string, "HALLO");
+        string = _T("Hallo");
+        test_string("MakeUpper Chaining", string.MakeUpper().MakeLower(),"hallo");
+        test_string("MakeUpper Chaining 2", string, "hallo");
+
         string = _T("Hallo");
         test_string("Mid",string.Mid(2,2),"ll");
         test_string("Remove",string.Remove(2,string.len()-2),"Ha");
diff --git a/src/sdk/scripting/bindings/sc_wxtypes.cpp b/src/sdk/scripting/bindings/sc_wxtypes.cpp
index a9fde7ac0..0c2d6c045 100644
--- a/src/sdk/scripting/bindings/sc_wxtypes.cpp
+++ b/src/sdk/scripting/bindings/sc_wxtypes.cpp
@@ -288,13 +288,25 @@ SQInteger wxString_Length(HSQUIRRELVM v)
     return 1;
 }

-using wxStringDoSomethingAndReturnNewFunc = wxString& (wxString::*)();
+using wxStringMakeFunc = wxString& (wxString::*)();

-template<wxStringDoSomethingAndReturnNewFunc func>
-SQInteger wxString_NoParamReturnWxString(HSQUIRRELVM v)
+template<wxStringMakeFunc func>
+SQInteger wxString_Make(HSQUIRRELVM v)
 {
     ExtractParams1<wxString*> extractor(v);
-    if (!extractor.Process("wxString_NoParamReturnWxString"))
+    if (!extractor.Process("wxString_Make"))
+        return extractor.ErrorMessage();
+    wxString &ref = (extractor.p0->*func)();
+    return ConstructAndReturnNonOwnedPtr(v, &ref);
+}
+
+using wxStringCaseFunc = wxString (wxString::*)() const;
+
+template<wxStringCaseFunc func>
+SQInteger wxString_Case(HSQUIRRELVM v)
+{
+    ExtractParams1<wxString*> extractor(v);
+    if (!extractor.Process("wxString_Case"))
         return extractor.ErrorMessage();

     return ConstructAndReturnInstance(v, (extractor.p0->*func)());
@@ -1010,16 +1022,16 @@ void Register_wxTypes(HSQUIRRELVM v)
         BindMethod(v, _SC("len"), wxString_Length, _SC("wxString::len"));
         BindMethod(v, _SC("size"), wxString_Length, _SC("wxString::size"));

-        BindMethod(v, _SC("Lower"), wxString_NoParamReturnWxString<&wxString::MakeLower>,
+        BindMethod(v, _SC("Lower"), wxString_Case<&wxString::Lower>,
                    _SC("wxString::Lower"));
-        BindMethod(v, _SC("MakeLower"), wxString_NoParamReturnWxString<&wxString::MakeLower>,
+        BindMethod(v, _SC("MakeLower"), wxString_Make<&wxString::MakeLower>,
                    _SC("wxString::MakeLower"));
         BindMethod(v, _SC("LowerCase"), wxString_NoParamNoReturn<&wxString::LowerCase>,
                    _SC("wxString::LowerCase"));

-        BindMethod(v, _SC("Upper"), wxString_NoParamReturnWxString<&wxString::MakeUpper>,
+        BindMethod(v, _SC("Upper"), wxString_Case<&wxString::Upper>,
                    _SC("wxString::Upper"));
-        BindMethod(v, _SC("MakeUpper"), wxString_NoParamReturnWxString<&wxString::MakeUpper>,
+        BindMethod(v, _SC("MakeUpper"), wxString_Make<&wxString::MakeUpper>,
                    _SC("wxString::MakeUpper"));
         BindMethod(v, _SC("UpperCase"), wxString_NoParamNoReturn<&wxString::UpperCase>,
                    _SC("wxString::UpperCase"));
--
2.31.1
(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 BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 2974
Re: Squirrel 3.1 and new bindings
« Reply #33 on: May 18, 2021, 11:40:30 pm »
Yep, this patch fixes the error