Author Topic: Creating a project only for a ASM source code  (Read 4225 times)

Offline druizm

  • Multiple posting newcomer
  • *
  • Posts: 12
Creating a project only for a ASM source code
« on: May 17, 2019, 01:22:23 pm »
Hello,

I have created a simple project with a one asm file. Once created, and after modifying compiler options for "asm" extension, I can build my asm file with no problems. After compilation (with "nasm -f elf64 -F dward") I get ".o" file. Now, I need to build project to generate binary file... but it seems CodeBlocks need a GCC compiler (or similar), so if I build my project directly, building execution is "g++ obj/Debug/my_file.o -o bin/Debug/my_file" and it finishes with errors. However, from the command line, if I run "ld -o bin/Debug/my_file obj/Debug/my_file.o", I get binary file with no errors... but I can't add this file to my project and, then, run "Debugger".

Help, please!

Thanks a lot!

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Creating a project only for a ASM source code
« Reply #1 on: May 17, 2019, 04:21:08 pm »
Have you tried building the asm file with the GNU assembler?. The executable is as (or as.exe in Windows) and it is bundled with GCC, so you should have it already.

Offline druizm

  • Multiple posting newcomer
  • *
  • Posts: 12
Re: Creating a project only for a ASM source code
« Reply #2 on: May 20, 2019, 10:19:25 am »
Have you tried building the asm file with the GNU assembler?. The executable is as (or as.exe in Windows) and it is bundled with GCC, so you should have it already.

My problem is not with compiling process. I can compile and link my ASM file and generate a binary file... but from a terminal shell. My question/problem is that for debugging purposes, I need to build my ASM file (first) and, then, build my project... and, by default, CodeBlocks executes a "g++ -o bin/Debug/my_file obj/Debug/my_file.o", but because of my file is an ASM source code file, I need to build my project with "ld -o bin/Debug/my_file obj/Debug/my_file.o"... I don't know how change these configuration point...

Offline Miguel Gimenez

  • Developer
  • Lives here!
  • *****
  • Posts: 1553
Re: Creating a project only for a ASM source code
« Reply #3 on: May 20, 2019, 02:49:53 pm »
What errors are you getting when executing g++?

Offline LETARTARE

  • Lives here!
  • ****
  • Posts: 531
  • L'ami de l'homme.The friend of man.
    • LETARTARE
Re: Creating a project only for a ASM source code
« Reply #4 on: May 20, 2019, 04:09:53 pm »
Just an indication ... perhaps ?
Quote
Settings->Compiler...->Other settings->Advanced options...
CB-13483, plugins-sdk-2.25.0 : Collector-2.0.0, AddOnForQt-3.9.1
1-Win7 Business Pack1 64bits : wx-3.2.4, gcc-8.1.0,
2-OpenSuse::Leap-15.4-64bits : wx-3.2.4;gtk3, gcc-8.2.1,
=> !! The messages are translated by Deepl