How to compile the files in c ++ in the Terminal? Where to find the Makefile?

Hello who can help

I have three files in a directory as follows

IntRateCalculator.h

IntRateCalculator.cpp

main.cpp

my book shows me something like this

$ make

GCC - c IntRateCalculator.cpp.

GCC - c main.cpp.

GCC-o main.o IntRateCalculator.o rate function

I tried these welcome in the terminal, but they have not worked and terminal showed me errors. Then I realized later that I need to use the makefile provided on a UNIX platform so that it to work.

So where and how do makefile?

Thank you very much for your help!

Hello BingZL,

What kind of errors do you have?

However, it is a debatable issue. You should find a new book, because these commands will not work. You need a Makefile before running. You'll need Xcode or the tools command line, nothing to do with C++.

Tags: Mac OS & System Software

Similar Questions

  • How to compile the sdk

    Hello

    How to compile the sdk for windows Vista 64 bit and 32 bit?

    Frankly, it's really the first hurdle. If you can not get a sample project to compile and run using only the information that is available here and in the SDK, you will probably not much luck doing anything of your own work.

  • How to change the Makefile to link the .so lib?

    I use the makefile to compile the native application under the window platform.

    I had added some libs to the commune, mk as below, when I need.

    "

    # Add your library names required here
    "LIBS += m bps strm jpeg freetype mmrndclient.

    now, I'm the openal tring and add "OpenAL alut asound" at the end of the LIBS. Like this

    LIBS += m bps strm jpeg freetype OpenAL alut asound mmrndclient

    but the console says

    «do-j 1 - Co.le - v7 - g - fMakefile all the»

    make [2]: * not target "libOpenAL.a" rule, which need to have

    "

    I have research the files under the "BB10SDK", only the libOpenAL.so exists in the mind of mine, there is no difference between .a and .so when compiling.

    How to modify the makefile to share the link to the .so file?

    Thank you

    DO not follow the flag of LIBS in the defaul common.mk
    LIBS += m bps strm jpeg freetype

    Using the LDFLAGS tag, add all your libs below
    "+= LDFLAGS - Wl -, z, relro - Wl, z, now $(if $(filter g so shared, $(VARIANTS)), - pie)" "
    Like this:
    += LDFLAGS-lm - lbps - lstrm - ljpeg - lscoreloopcore

    so many trickly for BB Dev, is it funny or nightmare?

    Another topic, how to cross - compile...

  • How can I move files/folders to iCloud back to their original finder folder

    I just updated to OS Sierra and noticed that my documents folder was empty. How can I move files/folders to iCloud back to their original finder folder?

    Thank you

    The Duke

    See it - Add your files, Desktop and Documents in iCloud Drive - Apple Support

  • How to compile the connection pool java example code

    I recently bought David Knox of 'Effective Oracle Database 10' g security by Design and worked through his examples with identifiers of customers and how to exploit the database security with anonymous connections pools.

    The side of the things database I totally understand and have implemented, but I now want to compile / the java run the examples of code, but do not know what is required to compile this.

    I am running Oracle 10.2.0.4 (64-bit) Enterprise Edition on a Linux (RHEL 5) PC. Version Java is 1.6.0_20. .Bash_profile relevant environment variables are:
    export LD_LIBRARY_PATH = $ORACLE_HOME/lib: / lib: / usr/lib
    Export CLASSPATH = $ORACLE_HOME/jre: $ORACLE_HOME/jlib: $ORACLE_HOME/rdbms/jlib
    export PATH = $ORACLE_HOME/bin: $ORACLE_HOME/OPatch: / usr/kerberos/bin: / usr/local/bin: / bin: / usr/bin

    When I try to compile, I get:
    Oracle Java: DB10204$ FastConnect.java
    Exception in thread "main" java.lang.NoClassDefFoundError: java/FastConnect
    Caused by: java.lang.ClassNotFoundException: FastConnect.java
    in java.net.URLClassLoader$ 1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged (Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    to Sun.misc.Launcher$appclassloader$ AppClassLoader.loadClass (Launcher.java:301)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    The main class is not found: FastConnect.java. Program ends.

    Below is an example java source code. Is anyone able to point me in the right direction as to how to get this to compile? I have just a configuration syntax change and/or the environment to do, or there it more for this example doesn't work? Any help much appreciated.
    oracle:DB10204$   cat FastConnect.java 
    package OSBD;
    import java.sql.*;
    import oracle.jdbc.pool.OracleDataSource;
    
    public class FastConnect
    {
      public static void main(String[] args)
      {
        long connectTime=0, connectionStart=0, connectionStop=0;
        long connectTime2=0, connectionStart2=0, connectionStop2=0;
        ConnMgr cm = new ConnMgr();
        // time first connection. This connection initializes pool.
        connectionStart = System.currentTimeMillis();
        Connection conn = cm.getConnection("SCOTT");
        connectionStop = System.currentTimeMillis();
        String query = "select ename, job, sal from person_view";
        try {
          // show security by querying from View
          Statement stmt = conn.createStatement();
          ResultSet rset = stmt.executeQuery(query);
          while (rset.next()) {
            System.out.println("Name:   " + rset.getString(1));
            System.out.println("Job:    " + rset.getString(2));
            System.out.println("Salary: " + rset.getString(3));
        }
          stmt.close();
          rset.close();
          // close the connection which resets the database session
          cm.closeConnection(conn);
          // time subsequent connection as different user
          connectionStart2 = System.currentTimeMillis();
          conn = cm.getConnection("KING");
          connectionStop2 = System.currentTimeMillis();
          // ensure database can distinguish this new user
          stmt = conn.createStatement();
          rset = stmt.executeQuery(query);
          while (rset.next()) {
            System.out.println("Name:   " + rset.getString(1));
            System.out.println("Job:    " + rset.getString(2));
            System.out.println("Salary: " + rset.getString(3));
          }
          stmt.close();
          rset.close();
          cm.closeConnection(conn);
        } catch (Exception e)    { System.out.println(e.toString()); }
        // print timing results
        connectTime = (connectionStop - connectionStart);
        System.out.println("Connection time for Pool: " + connectTime + " ms.");
        connectTime2 = (connectionStop2 - connectionStart2);
        System.out.println("Subsequent connection time: " +
                            connectTime2 + " ms.");
      }
    }
    Code download is: http://www.mhprofessional.com/getpage.php?c=oraclepress_downloads.php & cat = 4222
    I'm looking at Chapter 6.

    I extracted the .jar (jar - xvf) file

    The ODBC .jar file? Don't, don't. Add it to your classpath as it is, or paste it into the WEB-INF/lib directory, or what you have to do.

  • How to compile the single form?

    Hi all

    EBS R12.2.4

    RHEL6.5

    How do you compile a single form? or all forms in a single module as AR?

    In fact, I have compiled all forms for all modules in our case of BSE, and it took a lot of time. After that, the functional a user issue has been resolved.

    Now, I do not understand why another encounter similar error again functional:


    While it opens a form, the FRM-40735 displayed error message: a TIME-NEW-FORM-INSTANCE trigger raised unhandled exception ORA-20002

    Capture1.PNG

    Capture2.PNG

    Capture3.PNG

    Capture4.PNG

    ---------------------------------------
    Current form
    ----------------------------------------
    Request form: claims
    Name: ARXRAATR
    Train path: /u01/appuat/UAT/fs2/EBSapps/appl/ar/12.0.0/forms/US/ARXRAATR.fmx
    Form Version: 12.0.30.12020000.2
    Last modification of the form: $Date: 2013/03/10 06:49 $

    How to compile this form ARXRAATR.fmx?

    Help, please...
    Thank you very much
    JC

    Check this document:

    Accounting revenue and sales credits: unexpected error while initializing FRM-40735: trigger once - new - form - Instance (Doc ID 1386372.1)

    Kind regards

    Bashar

  • How to compile the forms in 11i

    How to compile form (APXINWKB.fmb) 11i Linux operating system.

    f60gen module = APXINWKB.fmb userid = apps/apps module_type = FORM output_file=/u001/appltech/appl/ap/11.5.0/forms/US/APXINWKB.fmx compile_all = special

    done above seems to compile.

    Yes.

    and make that FORMS60_PATH points to the correct path.

    FORMS60_PATH =: FORMS60_PATH: AU_TOP/resource$: $AU_TOP/forms/US;
    export FORMS60_PATH;

  • How to compile the package file?

    I have an actionscript file, it has a package name, it locate C:\demo directory, as follows:

    package demo {}

    import flash.display. *;

    ABC/public class extends Sprite {}

    public void ABC() {}

    ......

    }

    }

    }

    Then I compile code like following the command, but it increase suite above error:

    C:\ > mxmlc demo\ABC.as

    C:\sdk\frameworks\flex-config.xml loading configuration file

    C:\demo\ABC. As: Error: a file in a source path must have the same package structure ", as a package of the definition,"demo ".

    Where not right above the command?

    Thank you

    Set the source path, for example

    mxmlc demo\ABC.as -source-path=.
    

    --

    Kenneth Kawamoto

    http://www.materiaprima.co.UK/

  • How to create a file extention cod and alx compilation

    Hai all

    I want to ask questions on create how to compile a file with extention alx and cod on blackberry, any suggestion?

    concerning

    Andi

    I assume you are using BlackBerry JDE.

    . COD file is created when you build your project.

    To generate the ALX file:

    Right-click on a project in the files tab and choose generate ALX file option to generate from it.

  • Compile the JSP files in R12.2.4

    Hello

    How we compile JSP files using the command line. Could you please give me the steps.

    Thank you

    Jeremy

    Just to add my personal experience.

    We tried with bounce apache but have not reflecting the changes but we have seen changes after doing the below.

    -bounce apache (use adapcctl.sh stop)

    -bounce oacore (utilisation./admanagedsrvctl.sh stop managed server name)

    -bounce Association (utilisation./admanagedsrvctl.sh stop managed server name)

    I hope this helps.

    Thank you!

  • Compile the package

    Hi, any body can help me how to compile the following:


    apacengs.pls (spec AP_ACCOUNTING_ENGINE_PKG)

    apacengb.pls (body AP_ACCOUNTING_ENGINE_PKG)

    Hello

    using applmgr
    sqlplus apps/password

    SQL > select object_name, object_type of object where object_name = 'AP_ACCOUNTING_ENGINE_PKG ';

    OWNER OBJECT_TYPE OBJECT_NAME

    AP_ACCOUNTING_ENGINE_PKG APPS PACKAGE BODY

    AP_ACCOUNTING_ENGINE_PKG APPS PACKAGE

    SQL > alter compilation of package AP_ACCOUNTING_ENGINE_PKG;

    Modified package.

    SQL > alter the body of package AP_ACCOUNTING_ENGINE_PKG compilation;

    Modified package body.

    SQL >

    Hope so, it will be clear to you

    Thank you
    Amelia G
    Expertise in Oracle applications...

  • Newbie needing help to compile the code example

    Hello

    I know this is a newbie question very.
    Could someone please help me on how to compile the example code?

    [root@localhost getting_started] # gcc-I/usr/src/db-4.7.25.NC/build_unix gettingstarted_common.c example_database_read.c
    /tmp/ccMnYv8b.o: in function 'open_database ':
    gettingstarted_common.c: (.) Text + 0xeb): refers to 'db_create' the undefined
    gettingstarted_common.c: (.) Text + 0xFC): refers to 'db_strerror' the undefined
    /tmp/ccMnYv8b.o: in function 'databases_close ':
    gettingstarted_common.c: (.) Text + 0 x 513): refers to 'db_strerror' the undefined
    gettingstarted_common.c: (.) Text + 0 x 565): refers to 'db_strerror' the undefined
    gettingstarted_common.c: (.) Text + 0x5ba): refers to 'db_strerror' the undefined
    collect2: ld returned 1 exit status


    Thank you very much.
    JB

    Libraries are probably located in the .libs subdirectory (/ usr/src/db-4.7.25.NC/build_unix/.libs). You should probably run "make install" before attempting to use the library, it makes things a little easier.

  • How to use the Rectangle tool?

    I'm trying to use the Rectangle tool to make the spaces in my text. im making a navigation bar for a Web site for a member of the family.

    So I need to add dviders to go between each text link. I need to make selections 210 by 1 pixel using the rectangular sharp tool between each line and fill it with the color #1e1e1e.

    How do I do that? I'm not sure where to find these settings. im a turtial subsequently thats why its like that.

    Here is a picture of what im trying to do.

    photo 1.png

    any help would be thank you very much!

    How can I do this?

    Difficult to explain in a single forum post.

    Ideal if you publish your web site and post a link.

    Then, it comes to create a CSS-based navigation bar (there are a lot of tutorials - and tools/utilities to make the process easier - online) and tweaking the CSS rules to your taste

    An example: http://css3menu.com

    All of this is strictly off-topic for a Photoshop forum, of course. What web editing software do you use? Perhaps to bring the discussion.

  • How to create the script to compile procedure files in oracle - urgent deadline...

    How to create the script to compile procedure files in oracle.    about to go live and have much .prc pkg in a directory usr/tmp/ar... Po... human resources etc. need to create a script to compile all the files in the folder, then do not open all necessary .prc suggestions on how to do it.   Thank you Tom.

    (1) an urgent need, ASAP,... are words that do not in a forum of volunteer. We are here to help if you need it now, for free, open a SR.

    (2) oracle procedures are not files.

    (3) I think you are trying to run operating system packages, no Oracle procedure. right?

  • Error during compilation of package header and the body - How to change pkb file associat

    Hello world

    It has been noticed elsewhere (in the thread "package for compilation and body header" January 12, 2010) compiling the scripts package sometimes fails (apparently due to a bug in sqldeveloper) when the script contains the trailing slash /.

    This bug is still open?

    Question: in the thread mentioned above, it is recommended as a workaround to change the association of corresponding file from pl/sql to sql type. I want to do; I know the place in the Preferences dialog box, but most associations seem to hard-coded and cannot be changed.

    I would appreciate ideas!

    Thanks in advance,

    user8632123.

    For the workaround: you need to change the extension of the file , not the association (for example, .sql).

    Have fun
    K.

Maybe you are looking for

  • Missing girl movie is missing from the iTunes collection

    Girl Gone could apparently not be downloaded in iCloud. What is the history of here and are here all the other movies that have been deleted? Is this a technical problem or a problem with the license? If the licensing, I thought Apple would allow tho

  • Many Photos app issues still to be resolved...

    I had no trouble since the update to El Capitan with my Photos app interacting with my iPhone and my wife.  Currently on 10.11.3. 1. iPhones (the two 5s on 9.3.1) are extremely reliable with connection 2. often, the connection cable simply makes the

  • HP office jet pro 6968: cartridge problem

    Bought this printer about 3 months ago. Everything worked great until it Set up cartridge for black ink ran out. "I bought HP ink cartridges to replace, but when I replaced the cartridge set up, I got this error message on the printer screen:" cartri

  • Signal strength and range of the latest wifi routers

    I have a big house, with my router (BT home hub) in a wiring closet in a laundry room. The House is wired for ethernet and my current Wi - Fi, a Netgear WPN802, is placed at the best discreet place in the House. It is quite visible from everywhere in

  • Find and remove the dependence of the IMAQ

    Have a great project claims there addictive IMAQ, and at the same time she did. I thought all IMAQ screws have been removed from the project, but the library IMAQ is always listed in the dependencies of the project vi.lib. Looking for the project "IM