Can I compile in VC2008 with a makefile?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Anna Smidt

    Can I compile in VC2008 with a makefile?

    After having programmed since 8 years only VB6 I want to learn C++.NET now.
    It's amazing that everything has to be prepared first. For example I
    want to build the DirectShow baseclass, but the only files I found in
    the PSDK\Samples\Mu ltimedia\Direct Show\BaseClasse s are

    ..cpp
    ..h
    makefile

    I would like to ask how I should compile them because I was thinking
    that I would have a .sln file. Or can I use the makefile somehow in
    VC++2008.NET. Btw, when talking about VC++2008, should I say VC9?
  • Anna Smidt

    #2
    Re: Can I compile in VC2008 with a makefile?

    I don't understand why you nobody replies. You could even say "It's a
    too complicated theme" or "Learn basics first"... just any reply would
    be good.
    Anna

    Comment

    • SvenC

      #3
      Re: Can I compile in VC2008 with a makefile?

      Hi Anna,
      After having programmed since 8 years only VB6 I want to learn
      C++.NET now. It's amazing that everything has to be prepared first.
      For example I
      want to build the DirectShow baseclass, but the only files I found in
      the PSDK\Samples\Mu ltimedia\Direct Show\BaseClasse s are
      >
      .cpp
      .h
      makefile
      >
      I would like to ask how I should compile them because I was thinking
      that I would have a .sln file. Or can I use the makefile somehow in
      VC++2008.NET.
      In the program group of Visual Studio you should find a Tools sub
      group with a "Visual Studio 2008 command prompt". Alternatively
      the Platform SDK has a "CMD prompt". Start either of those, set
      the current directory to the sample you want to build and use
      nmake -f makefile

      sln files should be available in samples of MFC and ATL.
      Btw, when talking about VC++2008, should I say VC9?
      Yes.

      --
      SvenC

      Comment

      • Anna Smidt

        #4
        Re: Can I compile in VC2008 with a makefile?

        Ah super!!! Thank you!!

        Comment

        • Anna Smidt

          #5
          Re: Can I compile in VC2008 with a makefile?

          nmakeworks great with your explanation/ tutorial (thanks again!), but
          why does it produce debug files under WIN2000_DEBUG? I thought that "-f"
          would make it build release files. When a file has "d" on the end (like
          strmbasD.lib) then it's a debug file, right?
          I have learnt that the makefile is a macro. In the makefile I can read

          !IFDEF NODEBUG
          STRMBASE=strmba se
          !else
          STRMBASE=strmba sd
          !endif

          I thought that by saying -f I would set NODEBUG to "TRUE" (which would
          be RELEASE, wouldn't it?)

          Anna

          Comment

          • Anna Smidt

            #6
            Re: Can I compile in VC2008 with a makefile?

            HHAHHAHAHHAHAHA my first success in C++.
            I found out that I have to append NODEBUG=1
            So it's nmake -f makefile NODEBUG=1

            :-))) So happy

            Comment

            • SvenC

              #7
              Re: Can I compile in VC2008 with a makefile?

              Hi Anna,
              HHAHHAHAHHAHAHA my first success in C++.
              I found out that I have to append NODEBUG=1
              So it's nmake -f makefile NODEBUG=1
              >
              :-))) So happy
              Good to see you found it yourself.
              -f or /f is just the option to the specify the *f*ile to make.

              Use nmake /? to get help on nmake's options.

              Google for "site:msdn.micr osoft.com nmake" (without quotation
              marks) to get some information about nmake from msdn library.

              --
              SvenC

              Comment

              • Anna Smidt

                #8
                Re: Can I compile in VC2008 with a makefile?

                After my first "yippies" I am a bit downside. Could it be that we C++
                programmers spend about 50% of our time compiling something? I don't
                want to be sarcastic, I would only like to know what I have to expect. I
                am trying to compile OpenCV (an image library) for several hours now,
                and I have to fetch all the hints about how to do it from Google without
                any success yet. Everytime I have managed to attach the correct
                libraries and include and source files to my IDE, another problem pops up.
                Could anybody tell me after how many weeks this stress will be gone or
                feel normal?

                Anna

                Comment

                • SvenC

                  #9
                  Re: Can I compile in VC2008 with a makefile?

                  Hi Anna,
                  After my first "yippies" I am a bit downside. Could it be that we C++
                  programmers spend about 50% of our time compiling something? I don't
                  want to be sarcastic, I would only like to know what I have to
                  expect. I am trying to compile OpenCV (an image library) for several
                  hours now,
                  and I have to fetch all the hints about how to do it from Google
                  without any success yet. Everytime I have managed to attach the
                  correct libraries and include and source files to my IDE, another
                  problem pops up. Could anybody tell me after how many weeks this
                  stress will be gone or feel normal?
                  That depends all on the libraries, their documentation and their platform
                  and compiler support.

                  When I took some parts of the boost library back while using with VC6
                  and VC7 they included working makefiles and I had no problems.

                  When you use the libraries and samples coming with VC9 you should
                  also have no problems.

                  So you might be having bad luck with your library.

                  Did you find this link already?


                  --
                  SvenC

                  Comment

                  • Anna Smidt

                    #10
                    Re: Can I compile in VC2008 with a makefile?

                    Sven,
                    thanks, you're really nice. I know this link.
                    I don't have any problems running an OpenCV application, but there is a
                    bug in the OpenCV libraries themselves. I want to fix it and then
                    rebuild it. Maybe it's easy, but at 4 in the morning I gave up :-)
                    I will try it again now.
                    Anna

                    Comment

                    • SvenC

                      #11
                      Re: Can I compile in VC2008 with a makefile?

                      Hi Anna,
                      thanks, you're really nice. I know this link.
                      I don't have any problems running an OpenCV application, but there is
                      a bug in the OpenCV libraries themselves. I want to fix it and then
                      rebuild it. Maybe it's easy, but at 4 in the morning I gave up :-)
                      I will try it again now.
                      Sometimes a break is quite helpful ;-)

                      Just come back with source and compiler errors if you can't find out
                      yourself what's wrong. There are quite some helpful eyes around here.

                      --
                      SvenC

                      Comment

                      • Granville Barnett

                        #12
                        Re: Can I compile in VC2008 with a makefile?

                        "SvenC" <SvenC@nospam.n ospamwrote in message
                        news:uXJK60eLJH A.4772@TK2MSFTN GP03.phx.gbl...
                        Hi Anna,
                        >
                        >thanks, you're really nice. I know this link.
                        >I don't have any problems running an OpenCV application, but there is
                        >a bug in the OpenCV libraries themselves. I want to fix it and then
                        >rebuild it. Maybe it's easy, but at 4 in the morning I gave up :-)
                        >I will try it again now.
                        >
                        Sometimes a break is quite helpful ;-)
                        >
                        Just come back with source and compiler errors if you can't find out
                        yourself what's wrong. There are quite some helpful eyes around here.
                        >
                        --
                        SvenC
                        I would definatley give their build instructions a close read, sometimes you
                        may have to set some env variables manually as well (I know...).

                        Let us know how you get on.

                        Granville

                        Comment

                        • Anna Smidt

                          #13
                          Re: Can I compile in VC2008 with a makefile?

                          Hi Sven,

                          it's all going well :-) I'm really happy! At least there is nothing that
                          really blocks me from going on.

                          I have a question:

                          I have this class:

                          class asmmovieavi
                          {
                          public:
                          asmmovieavi(): capimg(0), capture(0), image(0){ }
                          ~asmmovieavi(){ Close();}

                          // Open a AVI file
                          void Open(const char* videofile);

                          //capture from live camera
                          void CaptureCamera() ;

                          // Close it
                          void Close();

                          // Get concrete frame of the video
                          // Notice: for speed up you have no need to release the returned image
                          IplImage* ReadFrame(int frame_no = -2);

                          // frame count of this video
                          const int FrameCount()con st
                          {return (int)cvGetCaptu reProperty(capt ure, CV_CAP_PROP_FRA ME_COUNT);}

                          const int Type()const{ return avi_or_cam; }

                          private:
                          IplImage* capimg;//captured from video
                          IplImage *image;
                          CvCapture* capture;
                          int avi_or_cam; //0:avi, 1:cam

                          };

                          I think it's a beginner's misunderstandin g, but I don't see where const
                          char* videofile goes. I mean to me it looks as if the class doesn't
                          really do anything with "videofile" . I thought that void Open was a
                          public void that I one can call when he has a handle to the class. At
                          least I am calling this void in another part of my code, so I'm
                          wondering what it does.
                          Even more strange to me is "void Close()". It seems to be hanging around
                          in there doing nothing.

                          Thanks again a lot.
                          Anna

                          Comment

                          • Ben Voigt [C++ MVP]

                            #14
                            No code for member functions, was Re: Can I compile in VC2008 with a makefile?

                            Anna Smidt wrote:
                            Hi Sven,
                            >
                            it's all going well :-) I'm really happy! At least there is nothing
                            that really blocks me from going on.
                            >
                            I have a question:
                            >
                            I have this class:
                            >
                            class asmmovieavi
                            {
                            public:
                            asmmovieavi(): capimg(0), capture(0), image(0){ }
                            ~asmmovieavi(){ Close();}
                            >
                            // Open a AVI file
                            void Open(const char* videofile);
                            >
                            //capture from live camera
                            void CaptureCamera() ;
                            >
                            // Close it
                            void Close();
                            >
                            // Get concrete frame of the video
                            // Notice: for speed up you have no need to release the returned image
                            IplImage* ReadFrame(int frame_no = -2);
                            >
                            // frame count of this video
                            const int FrameCount()con st
                            {return (int)cvGetCaptu reProperty(capt ure, CV_CAP_PROP_FRA ME_COUNT);}
                            >
                            const int Type()const{ return avi_or_cam; }
                            >
                            private:
                            IplImage* capimg;//captured from video
                            IplImage *image;
                            CvCapture* capture;
                            int avi_or_cam; //0:avi, 1:cam
                            >
                            };
                            >
                            I think it's a beginner's misunderstandin g, but I don't see where
                            const char* videofile goes. I mean to me it looks as if the class
                            doesn't really do anything with "videofile" . I thought that void Open
                            was a public void that I one can call when he has a handle to the
                            class. At least I am calling this void in another part of my code, so
                            I'm wondering what it does.
                            Even more strange to me is "void Close()". It seems to be hanging
                            around in there doing nothing.
                            This is a totally new question, you should have started a new thread with an
                            appropriate subject line.

                            To answer your question, the lines you show are prototypes aka forward
                            declarations. The actual code implementing these functions is elsewhere.
                            This separation of interface and implementation is something that many other
                            C-syntax languages (Java, C#, etc) do not allow.
                            >
                            Thanks again a lot.
                            Anna

                            Comment

                            • Anna Smidt

                              #15
                              Re: No code for member functions, was Re: Can I compile in VC2008with a makefile?

                              Thank you!
                              Anna

                              Comment

                              Working...