- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Hi, everyone! I have searched many web pages but still cannot solve my problems, looking forward to reply.
vc6.0/fortran6.0: my project(.exe file) contains a static lib compile with several .c and .f files
now, I need to compile the project with vs2010/IVF2010. I used VS2010 to open vc6.0 project file(*.dsw) directly and build lib successfully, but some problems occured:
1. *.lib(vs2010) seems didn't compiled the *.f, for the *.lib(vs2010) file is smaller than *.lib(vc6.0) .
2.when building my .exe file, noted that unresolved external symbols.
How to resolve this problem? Besides, how to compile several independent *.c files which called by fortran separately into one static lib?
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Unlike Developer Studio, Visual Studio does not allow you to combine files in different languages into one project. So, as your library has both C and Fortran source code, you will need to create two separate projects, one for the C source files and one for the Fortran source files. You can make the one depend on the other, so that updates in the C sources automatically cause a recompilation of the Fortran sources (or vice versa, just as the case may be). For the actual program, make it depend on both libraries/projects.
링크가 복사됨
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
I believe you want to convert the VC6/CVF6 project first. Refer to Migrating from Compaq* Visual Fortran for the details and let us know if this helps.
I’m not clear on what version of our compiler you are now using. Are you using the Visual Studio 2010 Shell that came with our product or do you have the full Visual Studio 2010 version?
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Unlike Developer Studio, Visual Studio does not allow you to combine files in different languages into one project. So, as your library has both C and Fortran source code, you will need to create two separate projects, one for the C source files and one for the Fortran source files. You can make the one depend on the other, so that updates in the C sources automatically cause a recompilation of the Fortran sources (or vice versa, just as the case may be). For the actual program, make it depend on both libraries/projects.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
wen,
As Arjen states, you will require different projects for different languages/compilers...
...however, these you will typically place into a single Solution. Performing a Build on the Solution, builds all projects in the solution.
Note, MS VS Start Page is a bit non-intuitive about Solutions. There is no "New Solution", nor is there a File | New | Solution
Instead, the Solution is created with the same name as the first Project created when there is an empty Solution, and the Project is placed under (inside) the Solution folder. Subsequent "New Project" are created in the Solution folder (there are alternative ways to place them elsewhere if you have the need).
Jim Dempsey
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
Thanks all! According to your advice, I have separated my project to fortran and c++, but I cannot solve the unresolved external symbols problem. The relationship among libs:
target.exe -------> XE2011_static_fortran_lib ------->VS2010_static_lib
XE2011_static_fortran_lib : error LNK2019: unresolved external symbols _VS2010_static_lib@8,the symbol was referenced in _XE2011_static_fortran_lib.
What's the reason?
PS:I have checked the function name through DUMPBIN, and my lib dictionaries contained ia32.
- 신규로 표시
- 북마크
- 구독
- 소거
- RSS 피드 구독
- 강조
- 인쇄
- 부적절한 컨텐트 신고
You probably have mismatched calling conventions. The CVF compiler used STDCALL as the default calling convention, and Intel Fortran des not. See the section "Default Calling Conventions Have Changed" in the Compaq Fortran migration guide.
You should probably check that all your projects have the same setting of the calling convention, and clean and rebuild your Fortran library.
