Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Polish
  4. Jak dołączać biblioteki do plików nagłówkowych?
Qt 6.11 is out! See what's new in the release blog

Jak dołączać biblioteki do plików nagłówkowych?

Scheduled Pinned Locked Moved Polish
3 Posts 3 Posters 1.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    olokotampus
    wrote on last edited by
    #1

    Ćwiczeniowiec zalecił pisać programy z użyciem maina, headera i pliku klasy, zamiast wszystko w jednym pliku. Wszystko pięknie, ale jak próbuję zadeklarować pole typu string w headerze, to mi wywala błąd, że nie zna takiego typu. Tak wygląda mój header:

    @#ifndef CPIES_H
    #define CPIES_H

    #include <string>

    class CPies
    {
    private:
    string namae;
    public:
    CPies();
    };

    #endif // CPIES_H@

    Ponadto biblioteki ze stringiem mam jeszcze w main i w pliku klasy.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      turaz
      wrote on last edited by
      #2

      Jeżeli masz zamiar używać Qt to użyj klasy QString.
      @#include <QString>@

      "dokumentacja":http://qt-project.org/doc/qt-5/qstring.html

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sharki
        wrote on last edited by
        #3

        string jest w bilbiotece standardowej, w namespace std

        std::string name;

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved