Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs have moved to the Altera Community. Existing Intel Community members can sign in with their current credentials.
29305 Discussions

Error LNK 1149 in compiling a DLL

moropera
Beginner
3,012 Views

When creating a DLL that contains procedures that call graphic DLLs I get the error:
LINK : fatal error LNK1149: output filename matches input filename 'I:\GinoLib\GMENUWI8.LIB'

In Properties of the DLL Project I put the references to the graphic DLL:

Linker --> Input --> Additional Dependencies
"I:\GinoLib\GMENUWI8.LIB" "I:\GinoLib\GMWINERR.LIB" "I:\GinoLib\GINLIBI8.LIB"

Linker --> Advanced --> Import Library
""I:\GinoLib\GMENUWI8.LIB" "I:\GinoLib\GMWINERR.LIB" "I:\GinoLib\GINLIBI8.LIB"

Entry Point : no value
and the Command Line is:
/OUT:"I:\Test_DLL\BinDbg\DLL1.dll" /
INCREMENTAL:NO /
NOLOGO /
NODEFAULTLIB:"libc" /
MANIFEST /
MANIFESTFILE:"Debug\DLL1.dll.intermediate.manifest" /
MANIFESTUAC:"level='asInvoker' uiAccess='false'" /
DEBUG /
PDB:"I:\Test_DLL\BinDbg\DLL1.pdb" /
SUBSYSTEM:WINDOWS /
IMPLIB:"I:\GinoLib\GMENUWI8.LIB" "I:\GinoLib\GMWINERR.LIB" "I:\GinoLib\GINLIBI8.LIB" /
DLL "I:\GinoLib\GMENUWI8.LIB" "I:\GinoLib\GMWINERR.LIB" "I:\GinoLib\GINLIBI8.LIB"

compiling i obtain :
LINK : fatal error LNK1149: output filename matches input filename 'I:\GinoLib\GMENUWI8.LIB'

Either by removing the reference to Additional Dependencies or the Import Libraries the error become:
DLL_1.obj : error LNK2019: unresolved external symbol _MENU_F90_mp_GMDISPLAYERRORBOX referenced in function _WIN_MESSAGE

Can anyone help me ?

0 Kudos
5 Replies
Steve_Lionel
Honored Contributor III
2,990 Views

Remove the Import Library values - you misunderstand what this is for (not surprising, as it is worded confusingly.) This value is to give the name of the .LIB generated when you build the DLL - the default is that it uses the name of the DLL with a .LIB file type.

0 Kudos
moropera
Beginner
2,989 Views

Thanks Steve, but as I have already reported in my request, by removing Import Library values i get the error of unresolved external symbol referring to the function in one of the libraries in Additional Dependencies.

0 Kudos
Steve_Lionel
Honored Contributor III
2,976 Views

OK, that's a separate problem. There is a module called MENU_F90 that has a module procedure GMDISPLAYERRORBOX, for which you're not providing the object file from compiling that module. Not being familiar with the libraries you're linking to, I don't know where this would come from, but it appears to be a GinoMenu routine. You may need to ask the GinoMenu people for help with this.

0 Kudos
moropera
Beginner
2,962 Views
Steve, one last observation then I won't bore you anymore.
If I move the GMDISPLAYERRORBOX Subroutine, which calls the graphics library, from the DLL to MAIN, everything compiles and works. Only if I make a call to another external DLL in the DLL do I have the problem. My question is: is it possible that in a Process of a DLL you can call another DLL?
Thank you
 
 
 
0 Kudos
Steve_Lionel
Honored Contributor III
2,951 Views

This suggests that your main program links to something your DLL doesn't. Is that routine yours?

Yes, a DLL can call another DLL - this is more often the case than not. You simply provide the import library for the called DLL when linking the calling DLL.

DLL-ness isn't the problem here. It's that you USE a module but don't provide the object code that resulted from compiling that module.

0 Kudos
Reply