Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Creating a dll. file

Joseph_E_
Beginner
2,277 Views

Hello,

I am trying to create a dll file for my library in TRNSYS with the intel visual compiler and microsoft visual studio. When compiling I receive two errors "Compilation Aborted (code1)" and "error #6580: Name in only-list does not exist.", which can be see from the build log.

TRNSYS Version 17.01.0028 and Microsoft Visual Studio Community 2015 Version 14.0.25431.01 update 3.

 Any help with this issue would be highly appreciated. The source file is also included.

0 Kudos
18 Replies
Steven_L_Intel1
Employee
2,277 Views

The source you attached isn't the one that got the error.

0 Kudos
Joseph_E_
Beginner
2,277 Views

Hi again, 

Thank you for the response.Yes, you are correct. The source code "Type250.f90" calls "callprogram.f90", where it gets an error, I attached it to this message now. I found another thread regarding this issue "http://energy-models.com/forum/trnsys-users-type-15" where they say to comment out "!Use ifport , only:createProcess" , which i assume is line 50 in the source where the error occurs? Will there be any problems doing this?

0 Kudos
Steven_L_Intel1
Employee
2,277 Views

You were given incorrect information. This code is trying to use the Windows API CreateProcess routine. If you replace IFPORT with KERNEL32 it may work.

For more information on calling CreateProcess see http://software.intel.com/en-us/forums/topic/275071#comment-1548443

0 Kudos
Joseph_E_
Beginner
2,277 Views

Hi again,

I replaced ifport with KERNEL32 in the line "    Use ifport , only:createProcess", then I got one fatal error " in Callprogram.f90.

LINK : fatal error LNK1207: incompatible PDB format in 'C:\Trnsys17\Compilers\Ivf11x\TRNDll\Debug\TRNDll.pdb'; delete and rebuild"

which can be seen from the added build log at the bottom of the text file. 

 I am new to this so i apologize for any frustrating questions,

best regards. 

0 Kudos
Steven_L_Intel1
Employee
2,277 Views

That's a very different error. You should be able to get through that by deleting any files with .pdb as a file type in the project and then rebuilding the project.

0 Kudos
Joseph_E_
Beginner
2,277 Views

Hi,

I tried to delete the .pdb files and then rebuilding the file. Then I got this build log with 0 errors but alot of warnings and still no dll. file produced as far as I can see. 

 

0 Kudos
Steven_L_Intel1
Employee
2,277 Views

Yes, you did get a DLL. It was copied to your EXE folder. The build succeeded.

0 Kudos
Joseph_E_
Beginner
2,277 Views

Yes, but I think it skipped the component i was actually looking to compile, as it is not represented in this build. When right clicking and just pressing compile ( which i assume is the same as build) i get this build log attached.

0 Kudos
Steven_L_Intel1
Employee
2,277 Views

No, right click and select Compile just compiles one source, and it looks as if now you have a syntax error in that file. But maybe TYPE_250 isn't in your project. Please attach the .vfproj file.

0 Kudos
mecej4
Honored Contributor III
2,277 Views

The first line in Type250.f90 was probably meant to be a comment: "Object: Type250" is not a valid Fortran statement.

0 Kudos
Joseph_E_
Beginner
2,277 Views

Okay, I attached the .vfproj file from where Type250.f90 is placed. Also i attached a printscreen of the interface. From the output window It seems like it skips the project "MyType" where Type250.f90 is located. It is this source i want to create a dll file from. 

 

Mecej4, commenting out this line only caused 5 more errors so i just left it as it is. 

Thanks for the feedback.

0 Kudos
Arjen_Markus
Honored Contributor I
2,277 Views

From the messages I get the impression that the projects were excluded from the build. Try and open the configuration manager - there you can indicate per project whether they are to be built or not. It may be that somehow these projects have been excluded.

0 Kudos
Joseph_E_
Beginner
2,277 Views

Yes, you are correct Arjen, it was not checked of in the manager as you say. I now checked it of and it now tries to compile the correct file, but still some errors occur. Seems like the opening line and the last line is not correct, as Mecej4 pointed out, but commenting it out did not work..

0 Kudos
Arjen_Markus
Honored Contributor I
2,277 Views

Hm, I can only judge this from the screenshot. The first line is incorrect as a Fortran statement. It starts with a label and then there should a keyword like DO or IF or another construct to associate the label with - that is the meaning of the error message. Why the compiler still does not accept it, is not something I can work out from the screenshot.

Can you post the screenshot for the error you get when the first line is properly commented out as well?

0 Kudos
Joseph_E_
Beginner
2,277 Views

Yes, attached is the screenshot of the errorlist and a text file of Type250, it seems like every line with "return" in it causes an error. 

0 Kudos
mecej4
Honored Contributor III
2,277 Views

The reason for the error messages is that your source code does not contain a SUBROUTINE or FUNCTION statement before the declarations and executable statements. Not having seen either, the compiler assumes that the source code is a main program without a PROGRAM statement (which is allowed, but not recommended). Afterwards, it sees a RETURN statement, which is invalid in a main program.

Please consult the TRNSYS documentation and example source files to see the proper SUBROUTINE statement to use.

0 Kudos
Joseph_E_
Beginner
2,277 Views

Okay, that makes alot of sense. Thank you all for the help. I will look into the documentation. 

0 Kudos
mecej4
Honored Contributor III
2,277 Views

I am not a TRNSYS user, but there are indications in the source files that you posted that they were machine-generated, at least partly. If so, the problem with no SUBROUTINE statement being generated is a problem attributable to the TRNSYS file generation process/program. In such situations, fixing just the generated faulty code is not a viable solution.

0 Kudos
Reply