I
I
InokWanterer2021-10-04 15:49:11
C++ / C#
InokWanterer, 2021-10-04 15:49:11

c++.sfml functions do not see an array of another class. Where to look for a problem?

I created a project based on SFML lessons, at some point I deviated from the lessons, everything was written there in one file, but I split it into headers and cpp and then the problems started. There is a map class that has a string array, so I can’t access this array in the relationship function with the map in the player class.
map.h

#pragma once
#include <SFML\Graphics.hpp>
#include <iostream> // подключаем, чтобы посмотреть на время в консоли
#include <string>
using namespace sf;
//#include "pers.h"
class mapR
{
public:

  Image map_image;//объект изображения для карты
  Sprite s_map;//создаём спрайт для карты
  Texture map;//текстура карты

  static const int HEIGHT_MAP = 25; //размер карты высота
  static const int WIDTH_MAP = 32; //размер карты ширина
  std:: string TileMaps[HEIGHT_MAP] = {
  "00000000000000000000000000000000",//1
  "0                              0",//2
  "0   s              f           0",//3
  "0      f                       0",//4
  "0                              0",//5
  "0                     h        0",//6
  "0                              0",//7
  "0                              0",//8
  "0            h                 0",//9
  "0                       f      0",//10
  "0                              0",//11
  "0       f                      0",//12
  "0                              0",//13
  "0                 s            0",//14
  "0                              0",//15
  "0                        h     0",//16
  "0                              0",//17
  "0                f             0",//18
  "0         s                    0",//19
  "0                              0",//20
  "0                              0",//21
  "0                      f       0",//22
  "0                              0",//23
  "0                              0",//24
  "00000000000000000000000000000000",//25
//   12345678901234567890123456789012
  };//*/


gives an error message;
1>draw.obj : error LNK2001: unresolved external symbol "public: static class mapR engine::maper" ([email protected]@@[email protected]@A).
1>pers.obj : error LNK2001: unresolved external symbol "public: static class mapR engine::maper" ([email protected]@@[email protected]@A).
1>D:\vs ++\nimra\nimra\x64\Debug\nimra.exe : fatal error LNK1120: unresolved externals: 1
1>Building project "nimra.vcxproj" ended with an error.
========== Build: Successful: 0, Errors: 1, No Changes: 0, Skipped: 0 ==========

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question