News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

LNK 2019 - Unresolved external symbols, unable to link

Started by FearlessDoggo21, December 27, 2020, 02:40:02 PM

Previous topic - Next topic

FearlessDoggo21

I recently begun using the ML64 assembler to create some smaller projects, but then I decided I wanted to create a window with x86 assembly. Long story short, the code is in place, but I'm having trouble linking with x86 libraries, namely kernel32.lib and user32.lib. I've tried using both Visual Studio and the ml command line compiler to compile and link with the libraries, but I've had no luck with either. I've copied the files and tried to link them locally with the file paths, but also no luck. I'm really unable to think of anything else I could try, but it's probably some keyword that I've missed because I started with ml64.

The complete file is located here, on my github: https://github.com/FearlessDoggo21/AssemblyWindow/blob/master/window.asm. I apologize for the horrible alignment and suggest you stay away from the rest of my code unless you want to be horrified. Hopefully the comments help you understand what I'm trying to accomplish specifically. Thanks in advance to anyone that gives it a try.

On an unrelated note, if anyone could direct me to where I could learn where to specify how many bytes to push with an immediate value, that would also be cool.
And if you could give me a heads up if any of my code seems unreasonable or unnecessary (besides the whole thing that I could have written this in C in about 1/3 the time).

Cheers.

hutch--

Have a look at the 64 bit supplement to MASM32. You will need to provide the Microsoft binaries and put them in the bin64 directory but if you set it up properly and don't do any mods that mess it up, it will get you up and going with ML64. There are enough examples and code templates to give you something to start with and once you get the swing of it you can do more or less anything you like.

jj2007

Quote from: FearlessDoggo21 on December 27, 2020, 02:40:02 PMI decided I wanted to create a window with x86 assembly

Either you follow the x64 route as shown by Hutch (he is running this forum), or you stick with x86 and study \Masm32\examples\exampl01\generic\generic.asm. Your code has numerous problems and is unnecessarily complicated.

May I ask which sources (tutorials, books) inspired you to write window.asm?

daydreamer

Quote from: FearlessDoggo21 on December 27, 2020, 02:40:02 PM

And if you could give me a heads up if any of my code seems unreasonable or unnecessary (besides the whole thing that I could have written this in C in about 1/3 the time).

normally you use first include masm32rt.inc,which contains .h files translated to masm format
,before includelib's,maybe thats why it refuses to link
for better productivity,check help file for similar structures ,.IF,.WHILE and use macros like invoke,rv together maybe with chr$,instead of lots of pushes and calls

my none asm creations
https://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding