python and swig

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itajit
    New Member
    • Feb 2007
    • 8

    python and swig

    Hi,
    I'm using python and swig. I'm a begginner and after generating the .cpp and wrap file from swig the compilation of wrap file is giving problem taht can not include python.h, though it is present there in Lib folder of python.What should I do for compiling and creating a object file, I'm having Windows xp operating system.Plz reply me soon, its urgent.

    Ajit Pandey
  • bartonc
    Recognized Expert Expert
    • Sep 2006
    • 6478

    #2
    Originally posted by itajit
    Hi,
    I'm using python and swig. I'm a begginner and after generating the .cpp and wrap file from swig the compilation of wrap file is giving problem taht can not include python.h, though it is present there in Lib folder of python.What should I do for compiling and creating a object file, I'm having Windows xp operating system.Plz reply me soon, its urgent.

    Ajit Pandey
    Are you using MS VC++ compiler? If not, which one?

    Comment

    • itajit
      New Member
      • Feb 2007
      • 8

      #3
      Originally posted by bartonc
      Are you using MS VC++ compiler? If not, which one?

      Yes VC++ 6.0, but will it be runnable with turbo command promt?

      Comment

      • bartonc
        Recognized Expert Expert
        • Sep 2006
        • 6478

        #4
        Originally posted by itajit
        Yes VC++ 6.0, but will it be runnable with turbo command promt?
        You should have a folder some place like "D:\swigwin-1.3.29\Examples \python" Start with the "simple" project. This project will fill in the command line for you. After you have the project to a point where it will compile, you can copy the command to your favorite prompt.

        Comment

        • itajit
          New Member
          • Feb 2007
          • 8

          #5
          Originally posted by bartonc
          You should have a folder some place like "D:\swigwin-1.3.29\Examples \python" Start with the "simple" project. This project will fill in the command line for you. After you have the project to a point where it will compile, you can copy the command to your favorite prompt.
          The error is encountered that "Can not open include file Python.h".
          That is the problem I'm facing from 2 days.

          Comment

          • bartonc
            Recognized Expert Expert
            • Sep 2006
            • 6478

            #6
            Originally posted by itajit
            The error is encountered that "Can not open include file Python.h".
            That is the problem I'm facing from 2 days.
            In the Project Properties dialog
            in the C/C++|General section
            in Additional Include Directories
            I have "$(PYTHON_INCLU DE)", but you could put your path to python24\includ e.

            In the Project Properties dialog
            in the Linker|Input section
            in Additional Dependancies
            I have "$(PYTHON_LIB)" , but you could put your path to python24\lib.

            Comment

            • itajit
              New Member
              • Feb 2007
              • 8

              #7
              Originally posted by bartonc
              In the Project Properties dialog
              in the C/C++|General section
              in Additional Include Directories
              I have "$(PYTHON_INCLU DE)", but you could put your path to python24\includ e.

              In the Project Properties dialog
              in the Linker|Input section
              in Additional Dependancies
              I have "$(PYTHON_LIB)" , but you could put your path to python24\lib.
              Hi, thanx,Now that error is been resolved but a new error is genereted
              That error is in the include file <IOSFWD>. Saying that ' {' is expected, but I have checked all the braces are properly placed.Error numbers are C2143 and C2059. plz guide yar, its urgent and important.

              bye

              Comment

              • bartonc
                Recognized Expert Expert
                • Sep 2006
                • 6478

                #8
                Originally posted by itajit
                Hi, thanx,Now that error is been resolved but a new error is genereted
                That error is in the include file <IOSFWD>. Saying that ' {' is expected, but I have checked all the braces are properly placed.Error numbers are C2143 and C2059. plz guide yar, its urgent and important.

                bye
                I suggest that you start small, (say) with the simple example, and add your files and/or declarations to it until you get the error. Then you'll know where the error is comming from.

                Comment

                • itajit
                  New Member
                  • Feb 2007
                  • 8

                  #9
                  Originally posted by bartonc
                  I suggest that you start small, (say) with the simple example, and add your files and/or declarations to it until you get the error. Then you'll know where the error is comming from.

                  Actually the .c and wrap.c file is compiled successfully but now how to link them? I have tried the ld command and one other alternative but it is giving an error that undefined function to each function.What should I do now and how?

                  Comment

                  • bartonc
                    Recognized Expert Expert
                    • Sep 2006
                    • 6478

                    #10
                    Originally posted by itajit
                    Actually the .c and wrap.c file is compiled successfully but now how to link them? I have tried the ld command and one other alternative but it is giving an error that undefined function to each function.What should I do now and how?
                    I used the example project to meet my needs. The project takes care of all the gory details. I recomment that you do the same.

                    Comment

                    • itajit
                      New Member
                      • Feb 2007
                      • 8

                      #11
                      Originally posted by bartonc
                      I used the example project to meet my needs. The project takes care of all the gory details. I recomment that you do the same.
                      Ya I too using example project, But tell me how to link two object file genereted by swig to create .dll file.

                      Comment

                      • bartonc
                        Recognized Expert Expert
                        • Sep 2006
                        • 6478

                        #12
                        Originally posted by itajit
                        Ya I too using example project, But tell me how to link two object file genereted by swig to create .dll file.
                        The dll should be in \Release folder.

                        Comment

                        Working...