title
Products            Buy            Support Forum            Professional            About            Codec Central
 

Anybody know how to compile C++ programs?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ChristinaS
    dBpoweramp Guru
    • Apr 2004
    • 4097

    Anybody know how to compile C++ programs?

    Don't laugh, but I spent several days trying to find a C++ compiler to use to compile some programs my daughter wrote for a university course. They use MAC's at the uni. With the limited knowledge she has acquired so far of programming, she's telling me they cannot compile and save an executable. I have my doubts but in the absence of any other solution ....

    I am totally unfamiliar with C++, in fact with just about any programming language that's used on pc's nowadays. I managed a bit of java and I did get to compile and save executables.

    So she brought home the sources of those programs and I tried in vain to find a C++ compiler. I installed something that does anything but compile the silly stuff. Microsoft Visual C++ 2005 Express.

    I Just want to get an .exe out of all that. Or compile and get error messages. Something. Anything.

    Can anybody tell me what I should be looking for? What to download?

    Please???? :komisch9:
  • Razgo
    Administrator
    • Apr 2002
    • 2532

    #2
    Re: Anybody know how to compile C++ programs?

    I haven't had anything to do with that side of the fence. but i know Spoon and Donny have.

    Comment

    • ChristinaS
      dBpoweramp Guru
      • Apr 2004
      • 4097

      #3
      Re: Anybody know how to compile C++ programs?

      Originally posted by Razgo
      I haven't had anything to do with that side of the fence. but i know Spoon and Donny have.

      Eh, I know, I'm hoping they'll take pity on me and help me out here :o :D

      This is a program and some functions that generate cords of a harmonic progression ( some details at http://musictech.webado.net, a site set up to document the school project). Basic, beginner stuff to be sure, but it would be nice at least to get to keep that program in a usable form.

      Comment

      • Spoon
        Administrator
        • Apr 2002
        • 43901

        #4
        Re: Anybody know how to compile C++ programs?

        It is possible if was written on a MAC you need a Mac to compile and run it. Visual Studio 2005 express is a fully featured c++ compiler.
        Spoon
        www.dbpoweramp.com

        Comment

        • ChristinaS
          dBpoweramp Guru
          • Apr 2004
          • 4097

          #5
          Re: Anybody know how to compile C++ programs?

          Originally posted by Spoon
          It is possible if was written on a MAC you need a Mac to compile and run it. Visual Studio 2005 express is a fully featured c++ compiler.
          It was written on a MAC indeed. I have the full source. I should at least get error mesages when trying to compile if the syntax is not compatible.

          I have downloaded and installed that Visual c++ studio and damned if I can find how to invoke the compiler there even to at least get those errors LOL

          The help indicates I have to go to a dos window and run a command line (cl .... ). Well it's complaining that there's no such thing as cl .

          Trying to run from the directory of where the C++ thing is installed it complains it cannot find my source even if I give the full path. I'm about to throw in the towel LOL

          Incidentally I pasted the source code into the studio editor and resaved it to wherever it saves sources, normally it should find it - my logic tells me .

          Maybe itnever did get installed properly though it took an awful lot of space and time to do so.

          Comment

          • ChristinaS
            dBpoweramp Guru
            • Apr 2004
            • 4097

            #6
            Re: Anybody know how to compile C++ programs?

            Ok, going to the dos window from inside the application I get a long list of help info, which didn't make me any brighter.

            But ...


            Hah!

            I got partway there by trying to create a new project and pasting in all the code from what I have (and copying into the project folder all the other siources I already had).

            That's when I got the Build button and that in fact does the compilation.

            I'll ba damned!

            Ok, so now it shows me 2 errors:


            ------ Build started: Project: melina2, Configuration: Debug Win32 ------
            Compiling...
            melina2.cpp
            c:\documents and settings\christina\my documents\visual studio 2005\projects\melina2\melina2\progression.h(49) : error C3861: 'time': identifier not found
            .\melina2.cpp(154) : error C3861: 'usleep': identifier not found
            .\melina2.cpp(188) : error C3861: 'usleep': identifier not found
            .\melina2.cpp(202) : error C3861: 'usleep': identifier not found
            .\melina2.cpp(216) : error C3861: 'usleep': identifier not found
            Build log was saved at "file://c:\Documents and Settings\Christina\My Documents\Visual Studio 2005\Projects\melina2\melina2\Debug\BuildLog.htm"
            melina2 - 5 error(s), 0 warning(s)
            ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
            So am I to understand that there's no time and usleep function available in the Windows environment but they are available on the MAC ?


            Errr..... ok-doki .... any ideas what I can substitute for them? Surely there has to be something ......

            Comment

            • ChristinaS
              dBpoweramp Guru
              • Apr 2004
              • 4097

              #7
              Re: Anybody know how to compile C++ programs?

              OK, found out I can include <time> . So I'm finally left with the usleep function which eludes me.

              References to that range from a relatively simple:

              void usleep(unsigned int mseconds)
              {
              clock_t goal = mseconds + clock();
              while (goal > clock());
              }


              to stuff I got lost trying to piee together.

              Alas now the compilation goes further but I'm stuck soemwhere else ..


              ------ Rebuild All started: Project: melina2, Configuration: Debug Win32 ------
              Deleting intermediate and output files for project 'melina2', configuration 'Debug|Win32'
              Compiling...
              Stdafx.cpp
              Compiling...
              melina2.cpp
              AssemblyInfo.cpp
              Generating Code...
              Compiling resources...
              Linking...
              melina2.obj : error LNK2028: unresolved token (0A000461) "public: void __thiscall RtMidiOut::sendMessage(class std::vector<unsigned char,class std::allocator<unsigned char> > *)" (?sendMessage@RtMidiOut@@$$FQAEXPAV?$vector@EV?$al locator@E@std@@@std@@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
              melina2.obj : error LNK2028: unresolved token (0A000462) "public: __thiscall RtMidiOut::RtMidiOut(void)" (??0RtMidiOut@@$$FQAE@XZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
              melina2.obj : error LNK2019: unresolved external symbol "public: void __thiscall RtMidiOut::sendMessage(class std::vector<unsigned char,class std::allocator<unsigned char> > *)" (?sendMessage@RtMidiOut@@$$FQAEXPAV?$vector@EV?$al locator@E@std@@@std@@@Z) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
              melina2.obj : error LNK2019: unresolved external symbol "public: __thiscall RtMidiOut::RtMidiOut(void)" (??0RtMidiOut@@$$FQAE@XZ) referenced in function "int __cdecl main(void)" (?main@@$$HYAHXZ)
              C:\Documents and Settings\Christina\My Documents\Visual Studio 2005\Projects\melina2\Debug\melina2.dll : fatal error LNK1120: 4 unresolved externals
              Build log was saved at "file://c:\Documents and Settings\Christina\My Documents\Visual Studio 2005\Projects\melina2\melina2\Debug\BuildLog.htm"
              melina2 - 5 error(s), 0 warning(s)
              ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

              And this is where I am just staring... LOL


              I have a feeling stuff is now too MAC_OS specific and I'll ne be able to convert it easily if at all.

              Things like:

              //************************************************** *******************//
              // API: Macintosh OS-X
              //************************************************** *******************//

              // API information found at:
              // - http://developer. apple .com/audio/pdf/coreaudio.pdf

              #if defined(__MACOSX_CORE__)

              // The CoreMIDI API is based on the use of a callback function for
              // MIDI input. We convert the system specific time stamps to delta
              // time values.

              // OS-X CoreMIDI header files.
              #include <CoreMIDI/CoreMIDI.h>
              #include <CoreAudio/HostTime.h>

              :headbang:

              Comment

              • Spoon
                Administrator
                • Apr 2002
                • 43901

                #8
                Re: Anybody know how to compile C++ programs?

                >void usleep(unsigned int mseconds)

                You would be better

                #define usleep Sleep

                But yes, Windows Midi is very different to the MAC.
                Spoon
                www.dbpoweramp.com

                Comment

                • ChristinaS
                  dBpoweramp Guru
                  • Apr 2004
                  • 4097

                  #9
                  Re: Anybody know how to compile C++ programs?

                  Thanks :D

                  But neither Sleep nor sleep are defined .... so I'll keep what I have for now for usleep. Mind you the argument may eventually need adjusting if it's not in the same units of time as what the MAC OS usleep uses.

                  Though the midi functions are the actual problem now :cry:

                  If I only knew what the heck I was doing LOL
                  Last edited by ChristinaS; 12-17-2006, 12:24 AM.

                  Comment

                  Working...

                  ]]>