Skip to content

C++ compile issue #73

Description

@NeoGeoFreak2004

hey yall, so anyways i was trying to compile my own c++ code using ngdevkit but when i type make into the terminal it gives me a error. The error says: g++ -c -o main.o main.cpp
/usr/bin/m68k-neogeo-elf-gcc -o rom.elf main.o pkg-config --libs ngdevkit
main.o: file not recognized: file format not recognized
collect2: error: ld returned 1 exit status
make: *** [Makefile:17: rom.elf] Error 1
idk what this means so can you please help me with this error!

Activity

  1. NeoGeoFreak2004 commented on Feb 22, 2022

    @NeoGeoFreak2004
    Author

    Hey, can you give me a answer why I’m getting this error.

  2. dciabrin commented on Feb 23, 2022

    @dciabrin
    Owner

    From the look of your command line, you tried to compile your main.cpp with a c++ compiler that's not built by ngdevkit. So it won't produce m68k-elf suitable for linking by m68k-neogeo-elf-gcc

    Support for c++ has been dropped in git a long time ago.

  3. humbertodias commented on Sep 24, 2023

    @humbertodias

    @NeoGeoFreak2004 maybe you could use the docker version #102 as a workaround for while.
    I have tried the same command inside the container and the result was:

    pkg-config --list-all | sort | grep ngevkit
    ngdevkit               ngdevkit - Opensource development for the Neo-Geo

    and

    pkg-config --libs ngdevkit
    -L/ngdevkit/local/m68k-neogeo-elf/lib -specs ngdevkit-specs -lngdevkit
  4. dciabrin commented on Apr 6, 2026

    @dciabrin
    Owner

    I've now published https://github.com/dciabrin/ngdevkit-examples/tree/master/17-hello-c%2B%2B to show how to build a minimal C++ program with the devkit. It should be sufficiently straightforward.

    Closing this ticket accordingly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions