- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
I am using Intel Fortran 9.1 and VC++ 2005.
I have two programs
PROGRAM main
write(*,*)"Calling C Function"
CALL ChgStr()
write(*,*)"Back From C Function"
END PROGRAM main
#include
#include
void chgstr()
{
printf("\nIn C function");
}
I would like to create a static library of C program and use it for fortran executable.
Please suggest how to do it.
I did the following.
cl -c chgstr.c
created a object file chgstr.obj
lib /out:clib.lib chgstr.obj
created static library for chgstr.obj
ifort /names:lowercase /extend_source -c fmain.f
created fmain.obj
ifort fmain.obj clib.lib
(to create executable of fmain.obj clib.lib but gave following error)
Intel Fortran Compiler for Intel EM64T-based applications, Version 9.1 Build 20070109
Copyright (C) 1985-2007 Intel Corporation. All rights reserved.
Fatal error cannot open "ifconsol"
ifort: error: problem during multi-file optimization compilation (code 1)
tried with the link command
link /out:1.exe fmain.obj clib.lib
gave the following error
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
LINK : fatal error LNK1104: cannot open file 'ifconsol.lib'
Please suggest how to do.
Is there a way I can do it through IDE (VS2005)
Thanks,
Chandra
- Etiquetas:
- Intel® Fortran Compiler
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
In your original post you indicated that you were using the EM64T compiler but here I see you referencing Itanium libraries. These are not the same! What kind of system are you building for?
I recommend using the ifort command to link.
Enlace copiado
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
When I did this recently (all through the IDE), I just added the lib to my fortran project.
Linda
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
When I did this recently (all through the IDE), I just added the lib to my fortran project.
Linda
I suggest adding the path of the ifconsol library to the link command.
Tung.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
When I did this recently (all through the IDE), I just added the lib to my fortran project.
Linda
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
I suggest adding the path of the ifconsol library to the link command.
Tung.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
In your original post you indicated that you were using the EM64T compiler but here I see you referencing Itanium libraries. These are not the same! What kind of system are you building for?
I recommend using the ifort command to link.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
9.1IA32Libifconsol.lib"
Microsoft Incremental Linker Version 8.00.50727.42
Copyright (C) Microsoft Corporation. All rights reserved.
Intel Fortran Compiler for 32-bit applications, Version 9.1 Build 20061103Z Package ID: W_FC_C_9.1.033
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.
Copyright (C) Microsoft Corporation. All rights reserved.
-subsystem:console
fmain.obj
clib.lib
fmain.obj : error LNK2019: unresolved external symbol __intel_new_proc_init referenced in function MAIN__
fmain.obj : error LNK2019: unresolved external symbol for_set_reentrancy referenced in function MAIN__
fmain.obj : error LNK2019: unresolved external symbol for_write_seq_lis referenced in function MAIN__
fmain.obj : error LNK2019: unresolved external symbol CHGSTR referenced in function MAIN__
LINK : error LNK2001: unresolved external symbol mainCRTStartup
fmain.exe : fatal error LNK1120: 5 unresolved externals
In your original post you indicated that you were using the EM64T compiler but here I see you referencing Itanium libraries. These are not the same! What kind of system are you building for?
I recommend using the ifort command to link.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
It would help if I could see all the commands used to build this application. There's something wrong in either the environment or an inconsistency in the build commands but I am not seeing everything. Part of the problem is that there is nothing supplying the main entry point (which is typically in a C run-time library. I am also puzzled by the routine names shown in the linker errors as it looks as if they are EM64T references. You cannot mix architectures - you must be consistent in the tools you use.
- Marcar como nuevo
- Favorito
- Suscribir
- Silenciar
- Suscribirse a un feed RSS
- Resaltar
- Imprimir
- Informe de contenido inapropiado
You are getting the error with ifconsol.lib because you might be trying to link in the normal command prompt window.
Try to do the link in the Intel IA-32 command prompt.
Regards
Kameswara Sarma
- Suscribirse a un feed RSS
- Marcar tema como nuevo
- Marcar tema como leído
- Flotar este Tema para el usuario actual
- Favorito
- Suscribir
- Página de impresión sencilla