CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2008
    Posts
    48

    How to run a C++ module in Unix system

    Hi,

    How to create a module using C++ code which can be executed automatically in Unix.

    Like we have a Jar in JAVA which contains set of Java classes and which make it possible to run automatically using 'ant', is there anything available with C++ also ?

    Scenario
    -----------
    We have a requirement to write some code in C++ which can read/write from Oracle Database and can be scheduled to run automatically in Unix. I want to know how to create a module and wht type it should be either .so or .exe or just simple .obj file. The module is actually divided into a list of around 10 classes

  2. #2
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: How to run a C++ module in Unix system

    Eh... just create a normal executable program? Considering that this is Unix, you might not name the file with an extension at all.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

  3. #3
    Join Date
    Nov 2003
    Location
    Belgium
    Posts
    8,150

    Re: How to run a C++ module in Unix system

    .obj files cannot be executed as is.
    .so files are libraries (similar like .dll files on Windows) and can also not be executed as is.

    You need an executable, not a module.
    An executable in Unix normally does not have any extensions. Your C++ code will be compiled by your compiler in object files, .obj which will then be linked by your C++ linker to an executable without any extensions.

    For example, you could use gcc as follows to compile test.cpp:
    Code:
    # gcc test.cpp -o test
    which compiles test.cpp to test. You can then run test as follows "./test".
    Marc Gregoire - NuonSoft (http://www.nuonsoft.com)
    My Blog
    Wallpaper Cycler 3.5.0.97

    Author of Professional C++, 4th Edition by Wiley/Wrox (includes C++17 features)
    ISBN: 978-1-119-42130-6
    [ http://www.facebook.com/professionalcpp ]

  4. #4
    Join Date
    Sep 2008
    Posts
    48

    Re: How to run a C++ module in Unix system

    Hi, Thanks for your clarification.

    We have requirement in our project to create a WEB-Application and we need to use an existing C++ code, which as you said is an EXE, which will load a vast amount of user profile data from an FTP server, which will then create a Dummy database with all user data, this database will be specifically used for my application.

    Now my question is, which language should i use for desiging WEB-UI part, like JSP/PHP/ASP so that it should be compatible to use the existing C++ code.

    Also pls let me know the standard way of creating WEB Applications using C++ in UNIX platform, i mean where can we use C++ and for which creating which layer(Controller/Loader/UserInterface) should i use it, and Which Language should i use for UI Layer.

    Also confirm me whether it is better using JSP and JAVA than C++, for creating WEB-Applications .

    Also Pls give me some sample web-application scenarios where C++ wil be used.

    Pls note: this should be under unix platform.

    Thanks
    Kiran
    Last edited by rsodimbakam; September 23rd, 2008 at 01:27 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured