How to link nasm obj file to gcc linker, into cpp project

CodeLite installation/troubleshooting forum
Radu
CodeLite Curious
Posts: 2
Joined: Mon Nov 20, 2023 11:34 am
Genuine User: Yes
IDE Question: cpp
Contact:

How to link nasm obj file to gcc linker, into cpp project

Post by Radu »

gcc 17.0.2(clang)(msys64)

I have in Project Settings>Pre Build:
E:\CodeLite\proiecte\test\nasm-2.09.10\nasm.exe -f win64 -g E:\CodeLite\proiecte\test\nasm-2.09.10/my_asm.asm

It creates file:
E:\CodeLite\proiecte\test\nasm-2.09.10\my_asm.obj

Build Error:
ld.lld: error: undefined symbol: my_asmz
referenced by main.cpp:12

ObjectsList.txt has only :
../build-Debug/test/main.cpp.o

[ I tried this in Visual Studio 2017 using tutorial: https://www.cs.uaf.edu/2017/fall/cs301/ ... e/nasm_vs/
But there I can't get the debugger to work on the asm file, breakpoints are ignored, error: no symbols have been loaded for this document ( have added -vcv8 )
I posted in the visual studio subreddit, no one answered, if someone has any info how to fix this also ]

User avatar
Jarod42
CodeLite Expert
Posts: 240
Joined: Wed Sep 30, 2009 5:54 pm
Genuine User: Yes
IDE Question: C++
Location: France
Contact:

Re: How to link nasm obj file to gcc linker, into cpp project

Post by Jarod42 »

You don't have rule to make the file generated by prebuild to be part of objects required for application.

Instead of prebuild, you might go in menu Settings/Build Settings...

For your compiler, go in Templates panel
add your asm extension, with associatate build rule.

Finally, add that asm file into your project.

Post Reply