#Map of commands

14 messages · Page 1 of 1 (latest)

manic sonnet
#

So I have a Class called Interpreter.
I have in it a struct call Commands and it contains functions.
I wanted to have a way to have a value that represent each function so after some research I used unorder map. VS code doesn't throw any error but when I compile it give me:C:\Users\ssoit\AppData\Local\Temp\ccHMlSVm.o:interpreter.cpp:(.text+0x65b): undefined reference to `Interpreter::commandFunctions' C:\Users\ssoit\AppData\Local\Temp\ccHMlSVm.o:interpreter.cpp:(.text+0x66b): undefined reference to `Interpreter::commandFunctions'

cosmic lagoon
#

you declared your static variable but you didn't define it

#

either make it inline or define it in the .cpp file

manic sonnet
cosmic lagoon
#

right

#

didn't see that

#

but it should be Interpreter::commandFunctions

#

otherwise you're declaring a new variable which is global

#

instead of the one inside the scope of the class

manic sonnet
stray riverBOT
#

@manic sonnet has reached level 1. GG!

silent shore
manic sonnet
#

it reads a binary array(which is a copy of a binary file) and reads instruction from it. Like 0000 01 0008 sets the value 8 into register B. For the question, it interprets a asm-like language which I develop how it should be written in binary at school. (it is very not advance rn)

stray riverBOT
#

@manic sonnet has reached level 2. GG!