Home>

This is a presentation image, but what does this error message mean? [File is invalid or corrupted 1107]
I checked bullet.hpp where the problem occurred, but there was no problem and it was possible to compile with Visual studio 2019, so it seems that it is not a compilation error.

#ifndef ___BULLET_HPP_
#define ___BULLET_HPP_
// Self-made header relation
#include "Sprite.hpp"
#include "Fps.hpp"
// #include "Stage.hpp"

// Standard header related
#include "stdio.h"
#include<fstream>
#include<sstream>
#include<iostream>
#include<vector>
#include<time.h>
#include<random>
// OpenGL related
#include "GLEW/include/GL/glew.h"
#include "gl/GL.h"
#include "GLFW/include/GLFW/glfw3.h"
// Math library
#include "glm/ext.hpp"
#include<glm/ext/vector_int2.hpp>
#define BULLET_MAX ((int) 500)

// Bullet data
class Stage_Object;
class Bullet_Data
{
public:
    Bullet_Data ()
    {
    }
    bool isAlive;// Does it exist?
    bool isHit;// Did it land?
    glm :: ivec2 Pos;// Bullet coordinates
    glm :: ivec2 Vec;// Direction of bullets
    glm :: ivec2 Col_Size;// The size of the collision detection
    Stage_Object * HitObject;


    void Reset ()
    {
    }
};

class Bullet
{
public:

    Bullet (Game * g, Sprite * sp [], Sprite * hit []);
    ~ Bullet ();
    void Draw ();
    void Update ();
    void Shooting (int x, int y, int vX, int vY);

    Bullet_Data * getBulletData (int i);

    // Size of collision detection
    const glm :: ivec2 mCol;
private: private:

    Bullet_Data * mBullet [BULLET_MAX];// Bullet data
    std :: vector<Sprite *>* mHitEffect;// Hit effect
    std :: vector<Sprite *>* mBullet_pic;// Image of the bullet itself

    Game * mOwner;// Game class

};

#endif
  • Answer # 1

    clThe command is.c.cpp.cc.cxxFiles with extensions other than C/C ++ sources, such as (for example,.obj.res.libEtc.) are passed to the linker as is.
    In the linker.hppCannot be processed, resulting in an error.

    In the first place, the header file (.hpp) is not to be compiled, so I think you should exclude it from the compilation target.

  • Answer # 2

    Hello.

    I'm not sure because there is no command line, but isn't it passing hpp directly to the linker?

  • Answer # 3

    This is an error from the linker, not the compiler
    It seems that the hpp file is mixed in the library file settings.
    The linker only accepts libraries or object files.
    Let's check it all over the place.