Home > other >  struct does not declare anything [-Wmissing-declarations]
struct does not declare anything [-Wmissing-declarations]

Time:07-13

I was trying to make a camera struct to handle a camera for an openGL tutorial in C.

// camera.h
#ifndef CAMERA_H
#define CAMERA_H

#include <stdbool.h>
#include <cglm/cglm.h>

struct camera
{
    bool ortho;
    float ratio;
    vec3 pos, x, y, z;
    float fov, yaw, pitch, roll;
    mat4 view, projection, model;
};

int updateCamera(struct camera *c);

#endif

but when I compile (with clang) i get these two errors:

./src/visual/camera.h:7:1: warning: declaration does not declare anything [-Wmissing-declarations]
struct camera
^
./src/visual/camera.h:16:5: error: field 'updateCamera' declared as a function
int updateCamera(struct camera *c);
    ^

I do not understand what is wrong with the declared struct (the same errors appear for any other struct in the same file)

my guess would be that something is wrong in another file, but I do not know what to search, plus there aren't any included files

If somebody could give me any hint about what could be wrong, it would be greatly appreciated!

sry for my english & still beginner understanding of C

  • Related