News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Long way to json libs support with masm32

Started by Archer-Dante, April 15, 2024, 11:18:06 PM

Previous topic - Next topic

Archer-Dante

Greetings

While tried to add some json support stuff i've discovered on forums, i've also met bunch of build errors.

Libs like jansson and cjson are both require UCRT.lib
So i did include it this like this:
includelib "C:\PF\Windows Kits\10\Lib\(version)\ucrt\x86\ucrt.lib"But the next it needs another lib
LINK : fatal error LNK1104: cannot open file "vcruntime.lib"I add it as well like this (full path now):
includelib "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\lib\x86\vcruntime.lib"And while trying to assemble or build it gives an error:
main.asm(403) fatal error A1016: Internal Assembler ErrorAnd always moves cursor to the last endp of asm file.


And here I don't know what to do to make it work or why this error happens since no info.

jj2007

Have you tried settimg the Path to the lib folder?

Archer-Dante

uh, what does is mean? Beside the path to lib with includelib like above, i just don't know other methods, maybe i miss something

fearless

Can you post some code so we can see what the issue is, thanks.

Archer-Dante

feels dumb, but can't find how to attach here anything besides images...

jj2007

Quote from: Archer-Dante on April 15, 2024, 11:36:33 PMBeside the path to lib with includelib like above

Have a look at the linker options in \Masm32\examples\exampl04\altbuild\makeit.bat

Some libraries expect "dependent" libs to be in the same folder.

Quote from: Archer-Dante on April 16, 2024, 12:20:50 AMfeels dumb, but can't find how to attach here anything besides images...

In the lower right corner, there is a More... button. Choose "Modify". This opens a different dialog with "Click or drag files here to attach them". Allowed file types are *.zip and *.png (careful with the latter, they cost bandwidth, and moderators are absolutely not happy if you post any images above 10kB there).

Re JSON, there is rudimentary support in MasmBasic: Json$(). If you have a concrete case, I'd be grateful to see that, as I never really had a chance to test that on a real world example.

Archer-Dante

Made a bare minimum which still not working:

.486
.xmm
.Model Flat, StdCall
OPTION CASEMAP :NONE

include masm32rt.inc
include C:\masm32\masmbasic\masmbasic.inc
includelib "C:\Program Files (x86)\Windows Kits\10\Lib\10.0.22621.0\ucrt\x86\ucrt.lib"
includelib "C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.39.33519\lib\x86\vcruntime.lib"
include cjson_x86.inc
includelib cjson_x86.lib
;include jansson_x86.inc
;includelib jansson_x86.lib

.data

.data?

.code

Startup proc
ret
Startup endp

End


QuoteHave a look at the linker options in \Masm32\examples\exampl04\altbuild\makeit.bat
Some libraries expect "dependent" libs to be in the same folder.
that's interesting
but i'm working with radasm2
will try to move some dlls to sources as well


QuoteIn the lower right corner, there is a More... button. Choose "Modify". This opens a different dialog with "Click or drag files here to attach them". Allowed file types are *.zip and *.png (careful with the latter, they cost bandwidth, and moderators are absolutely not happy if you post any images above 10kB there).
ty~

QuoteRe JSON, there is rudimentary support in MasmBasic: Json$(). If you have a concrete case, I'd be grateful to see that, as I never really had a chance to test that on a real world example.
maybe i'll give it a try later, but for now i'm looking for shortest way, even if it won't be the fastest

Archer-Dante

#7
Looks like it's has finally compiled.

After copying vcruntime.lib to the source folder, the next issue was to move cjson_x86.lib from masm32\libs to the source folder. Finally, it's compiled successfully.

I expect the linker and compiler will locate it under masm32\libs, as specified in the installation instructions.
https://github.com/mrfearless/libraries/tree/master/cJSON/cjson%20x86

jj2007

.486
.xmm
.Model Flat, StdCall
OPTION CASEMAP :NONE

include masm32rt.inc

include C:\masm32\masmbasic\masmbasic.inc

MasmBasic.inc contains masm32rt.inc, and masm32rt.inc does the model etc stuff for you. Since some members (me included) have their Masm32 stuff not on C: but on a different drive,  it's always a good idea to use \Masm32\..., thus it works on D:\Masm32.., ... Z:\Masm32 :cool:

This is not the case of VC libs that sit in C:, of course - they need the drive letter.

Quote from: Archer-Dante on April 16, 2024, 12:59:20 AMbut i'm working with radasm2

I have no experience with RadAsm (since I have my own IDE). Are there any conflicts with MasmBasic?

Archer-Dante

Quote from: jj2007 on April 16, 2024, 01:42:31 AM.486
.xmm
.Model Flat, StdCall
OPTION CASEMAP :NONE

include masm32rt.inc

include C:\masm32\masmbasic\masmbasic.inc

MasmBasic.inc contains masm32rt.inc, and masm32rt.inc does the model etc stuff for you. Since some members (me included) have their Masm32 stuff not on C: but on a different drive,  it's always a good idea to use \Masm32\..., thus it works on D:\Masm32.., ... Z:\Masm32 :cool:

This is not the case of VC libs that sit in C:, of course - they need the drive letter.

Quote from: Archer-Dante on April 16, 2024, 12:59:20 AMbut i'm working with radasm2

I have no experience with RadAsm (since I have my own IDE). Are there any conflicts with MasmBasic?

I'm not sure i'll keep it in this project, so maybe i'll keep lines as well for a while.
But big thanks for mentioning it, good to know!

QuoteI have no experience with RadAsm (since I have my own IDE). Are there any conflicts with MasmBasic?
I've not actually tried it properly yet.
Just compiled a few examples from the manual to ensure it works in some way.

A few of them are failed to compile, while other ones compiles and launches flawlessly; I'm just trying to figure out some things yet.

NoCforMe

Quote from: Archer-Dante on April 16, 2024, 12:20:50 AMfeels dumb, but can't find how to attach here anything besides images...
Meta-note here: If you reply to a post here, you sometimes don't get the "Click or drag files here to attach them" option until you preview the post, after which it appears. Seems to be a quirk of the SMF (Simple Machines) software that runs this site.
Assembly language programming should be fun. That's why I do it.

stoo23

QuoteMeta-note here: If you reply to a post here, you sometimes don't get the "Click or drag files here to attach them" option until you preview the post, after which it appears. Seems to be a quirk of the SMF (Simple Machines) software that runs this site.
Sorry, .. Not so, ... that ONLY occurs when you use the "Quick Reply" Window below the last post.

If you click the Blue 'highlighted' "Reply" button, directly below the last post, you will get ALL of the 'PostImage' and 'Drag and Drop' options, without requiring to 'Preview'.
:smiley:

jj2007


Archer-Dante

Quote from: jj2007 on April 16, 2024, 05:06:27 PM
Quote from: Archer-Dante on April 16, 2024, 01:55:44 AMA few of them are failed to compile

Which ones, for example?


Can't tell for now, I just deleted those projects already.
If i'll meet another one i'll let you know