Help with Fortran and C++ please - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Help with Fortran and C++ please

Hi all,

I'm a beginner in programming, but I need to manage a program which is written in fortran and c++ (two different sections). I'm working (until now) with g95 for the fortran section and with Intel C++ for the C++ part. Unfortunately, at least now I need to work in windows.

Following the instructions of the manuals I tried to compile both parts of the program and I couldn't.

Compiling with g95, I started writing the command: g95 -c program.f, but it lead to lots of errors. I realised that that the program was using some instructions for c++, and I changed the command to:
g95 -cpp program.f

It returned the error:

>>In file program.f: 9383
>>pot_fc_lg_0(pft,1)=(lm_ind_0(pft,1)/0.45*nind_o(pft))*dphen(d,pft) !g/m2
>>Error: Invalid form or array reference at (1)

The program has already worked for other people, so I don't know where is the problem.


With the C++ part, I tried to compile it with Intel C++ compiler, using the command: icl program.cpp and I had this error:

>>icl: warning #10114: Microsoft Visual C++ not found in path
>>program.cpp(25): catastrophic error: could not open source file >>"iostream"
>>#include (iostream)
>>compilation aborted for program.cpp (code 4)

I guess I'll need to reinstall the Microsoft Visual C++, but I don't understand very well the problem with iostream.


Thank you in advance for any help you could give me

Cheers

mmc

Comments

  • mmcmmc Posts: 3Member
    I reinstalled the Microsoft Visual C++ and still have the same problem.

    Please help!!

    Cheers,

    Maria
  • AsmGuru62AsmGuru62 Posts: 6,519Member
    [color=Blue]Please take a look here:

    [link=http://software.intel.com/en-us/articles/cdiag10114/]http://software.intel.com/en-us/articles/cdiag10114/[/link]

    I am not sure if it helps - I never used Intel C++ Compiler. Also why would they emulate VC++ compiler?!.. no idea.

    P.S. My guess is (from that article) if you pass /Qvc8 parameter to ICL - it will no longer look for VC++ compiler, like so:

    [code]icl /Qvc8 program.cpp[/code]
    [/color]
  • mmcmmc Posts: 3Member
    : [color=Blue]Please take a look here:
    :
    : [link=http://software.intel.com/en-us/articles/cdiag10114/]http://sof
    : tware.intel.com/en-us/articles/cdiag10114/[/link]
    :
    : I am not sure if it helps - I never used Intel C++ Compiler. Also
    : why would they emulate VC++ compiler?!.. no idea.
    :
    : P.S. My guess is (from that article) if you pass /Qvc8 parameter to
    : ICL - it will no longer look for VC++ compiler, like so:
    :
    : [code]: icl /Qvc8 program.cpp[/code]:
    : [/color]


    Thank you!

    Apparently none of the commands are working. However, I tried to execute the vcvars32.bat from visual c++ and when I tried again the icl program.cpp it lead to other errors, which are of this form:

    C:Archivos de programaMicrosoft Visual Studio 10.0VCINCLUDEcodeanalysissourceannotations.h(78): warning #1552: unrecognized attribute "repeatable"
    REPEATABLE
    ^
    (...)many others similar to this

    compilation aborted for program.cpp (code 4)


    I don't know wether they're related to the .bat file or the program, but I'll try to check it deeply. Anyone can help with it?

    Thanks again

Sign In or Register to comment.