Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. C++ program is not building in G++ (Ubuntu)

C++ program is not building in G++ (Ubuntu)

Scheduled Pinned Locked Moved C / C++ / MFC
c++comlinuxhelp
10 Posts 3 Posters 0 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.
  • M Offline
    M Offline
    Manoj7390
    wrote on last edited by
    #1

    Hi, I have written the code for Elliptic curve cryptography, its working fine in compilers like MS visual C++, Codelite. But its not building and compiling in G++ (Ubuntu 12.04). What might be the problem. If any any one have the C++ code for ECC, please share it to my mail manoj.7390@gmail.com Thanking you...

    L 1 Reply Last reply
    0
    • M Manoj7390

      Hi, I have written the code for Elliptic curve cryptography, its working fine in compilers like MS visual C++, Codelite. But its not building and compiling in G++ (Ubuntu 12.04). What might be the problem. If any any one have the C++ code for ECC, please share it to my mail manoj.7390@gmail.com Thanking you...

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Manoj7390 wrote:

      What might be the problem.

      It could be anything, but you need to provide some more useful details, such as compiler error messages etc.

      Use the best guess

      M 1 Reply Last reply
      0
      • L Lost User

        Manoj7390 wrote:

        What might be the problem.

        It could be anything, but you need to provide some more useful details, such as compiler error messages etc.

        Use the best guess

        M Offline
        M Offline
        Manoj7390
        wrote on last edited by
        #3

        I am getting lots of errors like this..

        main.cpp:(.text+0x1a6): undefined reference to `std::cout'

        main.cpp:(.text+0x1ab): undefined reference to `std::basic_ostream<char, std::char_traits<char>

        & std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

        main.cpp:(.text+0x1ba): undefined reference to `std::cout'

        main.cpp:(.text+0x1bf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

        main.cpp:(.text+0x1e1): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

        main.cpp:(.text+0x1fe): undefined reference to `std::cout'

        main.cpp:(.text+0x203): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

        main.cpp:(.text+0x213): undefined reference to `std::cout'

        main.cpp:(.text+0x230): undefined reference to `std::cout'

        If it is not sufficient, i will send the whole code, i dont know how to attach the file here. Please give me your mail id, i will send you the code.

        CPalliniC L 2 Replies Last reply
        0
        • M Manoj7390

          I am getting lots of errors like this..

          main.cpp:(.text+0x1a6): undefined reference to `std::cout'

          main.cpp:(.text+0x1ab): undefined reference to `std::basic_ostream<char, std::char_traits<char>

          & std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

          main.cpp:(.text+0x1ba): undefined reference to `std::cout'

          main.cpp:(.text+0x1bf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

          main.cpp:(.text+0x1e1): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

          main.cpp:(.text+0x1fe): undefined reference to `std::cout'

          main.cpp:(.text+0x203): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

          main.cpp:(.text+0x213): undefined reference to `std::cout'

          main.cpp:(.text+0x230): undefined reference to `std::cout'

          If it is not sufficient, i will send the whole code, i dont know how to attach the file here. Please give me your mail id, i will send you the code.

          CPalliniC Offline
          CPalliniC Offline
          CPallini
          wrote on last edited by
          #4

          How do you invoke the C++ compiler (command line, please)? You have to g++ (instead of gcc), see, for instance here[^].

          Veni, vidi, vici.

          In testa che avete, signor di Ceprano?

          M 1 Reply Last reply
          0
          • M Manoj7390

            I am getting lots of errors like this..

            main.cpp:(.text+0x1a6): undefined reference to `std::cout'

            main.cpp:(.text+0x1ab): undefined reference to `std::basic_ostream<char, std::char_traits<char>

            & std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

            main.cpp:(.text+0x1ba): undefined reference to `std::cout'

            main.cpp:(.text+0x1bf): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

            main.cpp:(.text+0x1e1): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

            main.cpp:(.text+0x1fe): undefined reference to `std::cout'

            main.cpp:(.text+0x203): undefined reference to `std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)'

            main.cpp:(.text+0x213): undefined reference to `std::cout'

            main.cpp:(.text+0x230): undefined reference to `std::cout'

            If it is not sufficient, i will send the whole code, i dont know how to attach the file here. Please give me your mail id, i will send you the code.

            L Offline
            L Offline
            Lost User
            wrote on last edited by
            #5

            Manoj7390 wrote:

            i will send you the code.

            No you won't. Just show us the first few lines of your source (where your #include statements are), and the lines that are producing the errors.

            Use the best guess

            M 1 Reply Last reply
            0
            • CPalliniC CPallini

              How do you invoke the C++ compiler (command line, please)? You have to g++ (instead of gcc), see, for instance here[^].

              Veni, vidi, vici.

              M Offline
              M Offline
              Manoj7390
              wrote on last edited by
              #6

              I am using CC - command for compiling, What is the command for g++

              CPalliniC 1 Reply Last reply
              0
              • L Lost User

                Manoj7390 wrote:

                i will send you the code.

                No you won't. Just show us the first few lines of your source (where your #include statements are), and the lines that are producing the errors.

                Use the best guess

                M Offline
                M Offline
                Manoj7390
                wrote on last edited by
                #7

                #include <cstdlib>
                #include <iostream>
                #include <vector>
                using namespace std;

                #include <math.h>

                Plenty of errors are coming, i couldn't figure it out. But my question is same program is running in other compilers but why it is not running in g++. Might be there is a small bug.

                L 1 Reply Last reply
                0
                • M Manoj7390

                  #include <cstdlib>
                  #include <iostream>
                  #include <vector>
                  using namespace std;

                  #include <math.h>

                  Plenty of errors are coming, i couldn't figure it out. But my question is same program is running in other compilers but why it is not running in g++. Might be there is a small bug.

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  Manoj7390 wrote:

                  Plenty of errors are coming, i couldn't figure it out.

                  Like I said, show us the line of code and the error message; the first two or three should be enough.

                  Manoj7390 wrote:

                  Might be there is a small bug.

                  Most unlikely, it is much more likely that the compiler cannot find one of the include files, or there is some other setting specific to g++ that you need to add. I do not have a Linux system so cannot test this.

                  Use the best guess

                  M 1 Reply Last reply
                  0
                  • M Manoj7390

                    I am using CC - command for compiling, What is the command for g++

                    CPalliniC Offline
                    CPalliniC Offline
                    CPallini
                    wrote on last edited by
                    #9

                    You are using the C compiler. g++ is the command for invoking the C++ compiler, e.g.

                    g++ myapp.cpp -o myapp

                    If you are using a makefile, set CC=g++.

                    Veni, vidi, vici.

                    In testa che avete, signor di Ceprano?

                    1 Reply Last reply
                    0
                    • L Lost User

                      Manoj7390 wrote:

                      Plenty of errors are coming, i couldn't figure it out.

                      Like I said, show us the line of code and the error message; the first two or three should be enough.

                      Manoj7390 wrote:

                      Might be there is a small bug.

                      Most unlikely, it is much more likely that the compiler cannot find one of the include files, or there is some other setting specific to g++ that you need to add. I do not have a Linux system so cannot test this.

                      Use the best guess

                      M Offline
                      M Offline
                      Manoj7390
                      wrote on last edited by
                      #10

                      Thanks.. I have got the output.. I was using CC instead of g++. It works with g++ Thank you...

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups