gcc probléma

Kezdőlap Fórumok Programozás gcc probléma

3 bejegyzés megtekintése - 1-3 / 3
  • Szerző
    Bejegyzés
  • #1921857
    iczy
    Felhasználó

      1.)
      elore bocsatoma forditom verzioja:

      Reading specs from /usr/lib/gcc-lib/i386-linux/2.95.4/specs
      gcc version 2.95.4 20011002 (Debian prerelease)
      Ezert nekem nemugat a .h miatt

      2.)

      forditas g++ es nem gcc

      igy pl: g++ -o program program.cpp
      vagy g++ -c program.cpp ; g++ -o program program.o

      3.)
      cpp-ban nem kel kiirni a .h kiterjesztest, erre figyelmeztet az antiquated header.
      ha viszont nem irod ki, egyes forditok aszongyak cout -ra, hogy undefined.

      igy azt ajanlom, hogy koovesd az ajanlast, es ird be mindig, hogy
      g++ -Wno-deprecated -o program program.cpp

      4.)
      Thinking in c++ -ra ha rakeresel a neten, van egy nagyon jo kis doksi.
      Kicsit windoz izu , de jo.

      SOXERENCSET.

      #1921858
      admin
      Adminisztrátor

        Köszönöm szépen,
        a probléma megoldódott

        nem gcc-t hanem g++-t kellett használnom

        #1871832
        csaba
        Felhasználó

          Helló!

          Biztos nagyon hülye kérdésem van! C++-al próbálkozom. Minden tankönyv elsõ programját próbáltam megalkotni:


          #include
          using namespace std;

          int main()
          {
          cout header for the header for C++ includes, or instead of the deprecated header . To disable this warning use -Wno-deprecated.
          /tmp/cce0zEp5.o(.text+0x19): In function `main’:
          : undefined reference to `std::cout’
          /tmp/cce0zEp5.o(.text+0x1e): In function `main’:
          : undefined reference to `std::basic_ostream >& std::operator >(std::basic_ostream >&, char const*)’
          /tmp/cce0zEp5.o(.text+0x4a): In function `__static_initialization_and_destruction_0(int, int)’:
          : undefined reference to `std::ios_base::Init::Init[in-charge]()’
          /tmp/cce0zEp5.o(.text+0x79): In function `__tcf_0′:
          : undefined reference to `std::ios_base::Init::~Init [in-charge]()’
          /tmp/cce0zEp5.o(.eh_frame+0x11): undefined reference to `__gxx_personality_v0′
          collect2: ld returned 1 exit status
          [/b]

          Elsõsorban az undefined reference to ‘std::basic_ostream résszel van problémám. Ez gondolom a cout parancsal van összefüggésben, de mi az, hogy undefined reference????

        3 bejegyzés megtekintése - 1-3 / 3
        • Be kell jelentkezni a hozzászóláshoz.