Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assembly Compilation error #1

Open
IamLupo opened this issue Nov 20, 2022 · 4 comments
Open

Assembly Compilation error #1

IamLupo opened this issue Nov 20, 2022 · 4 comments

Comments

@IamLupo
Copy link

IamLupo commented Nov 20, 2022

I tried to compile your project on my Ubuntu 22.04. And i gained the following error:

[ 96%] Building ASM_NASM object asm/CMakeFiles/asm_game.dir/utils.asm.o
/var/www/asm_c_cpp/asm/utils.asm:103: error: expected `,'

Looking at this code it looks like this:

reverse_loop_start:
cmp rcx, 0x

Shouldnt the 0x be something like 0x0?

@nathan-baggs
Copy link
Owner

Good spot, I've just pushed a change

@IamLupo
Copy link
Author

IamLupo commented Nov 20, 2022

Nice,

Also on graphic.asm

you have:
extern render_begin
extern draw_rectangle
extern render_end

But they should be:
global render_begin
global draw_rectangle
global render_end

After these changes the assembly compiles.

@IamLupo
Copy link
Author

IamLupo commented Nov 20, 2022

About the C and CPP version you have in CMakeLists.txt:

target_link_libraries(cpp_game PRIVATE SDL2d m pthread dl)

The SDL2d is the debug library. When i execute:

cmake .. to generate the make files and use make to download and compile the SDL2 library. It produces the release version and not the debug version.

This makes that the following changes fixed it for me.

target_link_libraries(cpp_game PRIVATE SDL2 m pthread dl)

@chazste
Copy link
Contributor

chazste commented Dec 12, 2022

@IamLupo My Pull Request for adding support for building on Win32/Visual studio also addresses the issue you mention above about the debug vs release versions of the SDL library on Ubuntu 22.04.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants