I have this code, but when I try to compile it, it says, please can somebody helps me? please a lot :cry: :roll:
code
/*
* File: Bullet.hpp
* Author: Adamv
*
* Created on April 25, 2011, 6:11 PM
*/
#include <SFML/Graphics.hpp>
#include <SFML/Window.hpp>
#include <SFML/System.hpp>
#include <cmath>
#ifndef BULLET_HPP
#define BULLET_HPP
#define PI 3.14159265
class cBullet
{
private:
static sf::Image imgBullet;
static sf::Sprite sprBullet;
bool active;
float x;
float y;
float angle;
float distance;
public:
cBullet();
bool IsActive();
void SetActive(bool status, float mx, float my);
void Move();
void SetAngle(float mangle);
void Draw(sf::RenderWindow & App);
~cBullet() {} ;
};
#endif /* BULLET_HPP */
errors
"/bin/make" -f nbproject/Makefile-Release.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Documents and Settings/Adamv/Desktop/CombatShooter'
"/bin/make" -f nbproject/Makefile-Release.mk dist/Release/MinGW-Windows/combatshooter.exe
make[2]: Entering directory `/c/Documents and Settings/Adamv/Desktop/CombatShooter'
mkdir -p build/Release/MinGW-Windows
rm -f build/Release/MinGW-Windows/main.o.d
g++.exe -c -O2 -I/F/CodeBlocks/SFML-1.6-sdk-windows-mingw/SFML-1.6/include -MMD -MP -MF build/Release/MinGW-Windows/main.o.d -o build/Release/MinGW-Windows/main.o main.cpp
mkdir -p build/Release/MinGW-Windows
rm -f build/Release/MinGW-Windows/Bullet.o.d
g++.exe -c -O2 -I/F/CodeBlocks/SFML-1.6-sdk-windows-mingw/SFML-1.6/include -MMD -MP -MF build/Release/MinGW-Windows/Bullet.o.d -o build/Release/MinGW-Windows/Bullet.o Bullet.cpp
mkdir -p dist/Release/MinGW-Windows
g++.exe -o dist/Release/MinGW-Windows/combatshooter build/Release/MinGW-Windows/main.o build/Release/MinGW-Windows/Bullet.o -L/F/CodeBlocks/SFML-1.6-sdk-windows-mingw/SFML-1.6/lib /F/CodeBlocks/SFML-1.6-sdk-windows-mingw/SFML-1.6/lib/libsfml-graphics.a /F/CodeBlocks/SFML-1.6-sdk-windows-mingw/SFML-1.6/lib/libsfml-window.a /F/CodeBlocks/SFML-1.6-sdk-windows-mingw/SFML-1.6/lib/libsfml-system.a
f:/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.
This should work unless it involves constant data structures referencing symbols from auto-imported DLLs.
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x110): undefined reference to `cBullet::sprBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x132): undefined reference to `cBullet::sprBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x14a): undefined reference to `cBullet::sprBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x1d2): undefined reference to `cBullet::imgBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x213): undefined reference to `cBullet::imgBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x227): undefined reference to `cBullet::imgBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x22e): undefined reference to `cBulletInfo: resolving vtable for sf::Sprite by linking to __imp___ZTVN2sf6SpriteE (auto-import)
::sprBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x322): undefined reference to `cBullet::imgBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x363): undefined reference to `cBullet::imgBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x377): undefined reference to `cBullet::imgBullet'
build/Release/MinGW-Windows/Bullet.o:Bullet.cpp:(.text+0x37e): undefined reference to `cBullet::sprBullet'
collect2: ld returned 1 exit status
make[2]: *** [dist/Release/MinGW-Windows/combatshooter.exe] Error 1make[2]: Leaving directory `/c/Documents and Settings/Adamv/Desktop/CombatShooter'
make[1]: Leaving directory `/c/Documents and Settings/Adamv/Desktop/CombatShooter'
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 4s)
but this is not important because it says this in the past and it works
f:/codeblocks/mingw/bin/../lib/gcc/mingw32/4.4.1/../../../../mingw32/bin/ld.exe: warning: auto-importing has been activated without --enable-auto-import specified on the command line.