Skip to content

undefined reference to `timersub' error when running shmoo-cpu-nbody.sh #2

@Lissanro

Description

@Lissanro

If I try to run shmoo-cpu-nbody.sh I get the following error:

% ./shmoo-cpu-nbody.sh 
In file included from nbody.c:4:0:
timer.h: In function ‘GetTimer’:
timer.h:49:3: warning: implicit declaration of function ‘timersub’; did you mean ‘utimes’? [-Wimplicit-function-declaration]
   timersub(&timerStop, &timerStart, &timerElapsed);
   ^~~~~~~~
   utimes
/tmp/cco5fkjG.o: In function `GetTimer':
nbody.c:(.text+0x270): undefined reference to `timersub'
/tmp/cco5fkjG.o: In function `main':
nbody.c:(.text.startup+0x148): undefined reference to `timersub'
collect2: error: ld returned 1 exit status
nbody
./shmoo-cpu-nbody.sh: 10: ./shmoo-cpu-nbody.sh: ./nbody: not found

The solution is simple - just remove -std=c99 in ./shmoo-cpu-nbody.sh.

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