|
From: Isomorphismus on 2 Apr 2008 12:21 Hello everyone, I get the mistake unresolved external symbol -LNK2001 when building a solution, but I checked over and over, but I wrote the correct name when calling my routine, in code it looks like this: i got my module: module a contains subroutine init_global() ! ! Initializes global constants. ! implicit none ![c] Initialize prog% prog%title = "Vedyn" ; prog%source = "" etc.. end subroutine init_global and calling from the program part looks like this: call init_global() What´s wrong with that? I just don´t get it.. thx, Iso
From: Les on 2 Apr 2008 12:41 In your main program do you have a USE A ? Does your link path contain the path to module a ? Les "Isomorphismus" <nataliehapp(a)hotmail.com> wrote in message news:34239b0d-8912-4728-b200-bcfbbe5fac12(a)s19g2000prg.googlegroups.com... Hello everyone, I get the mistake unresolved external symbol -LNK2001 when building a solution, but I checked over and over, but I wrote the correct name when calling my routine, in code it looks like this: i got my module: module a contains subroutine init_global() ! ! Initializes global constants. ! implicit none ![c] Initialize prog% prog%title = "Vedyn" ; prog%source = "" etc.. end subroutine init_global and calling from the program part looks like this: call init_global() What�s wrong with that? I just don�t get it.. thx, Iso
From: Steve Lionel on 2 Apr 2008 13:41 On Wed, 2 Apr 2008 09:21:52 -0700 (PDT), Isomorphismus <nataliehapp(a)hotmail.com> wrote: >Hello everyone, >I get the mistake unresolved external symbol -LNK2001 when building a >solution, >but I checked over and over, but I wrote the correct name when calling >my routine, in code it looks like this: In addition to USE A, you must also link in the object file created when module A was compiled. This is automatic when you build in Visual Studio (since you say LNK2001 I know you are using MS tools), but if you are building from the command line you might have forgotten to do that. -- Steve Lionel Developer Products Division Intel Corporation Nashua, NH For email address, replace "invalid" with "com" User communities for Intel Software Development Products http://softwareforums.intel.com/ Intel Fortran Support http://support.intel.com/support/performancetools/fortran My Fortran blog http://www.intel.com/software/drfortran
From: Isomorphismus on 3 Apr 2008 04:22 On 2 Apr., 19:41, Steve Lionel <Steve.Lio...(a)intel.invalid> wrote: > On Wed, 2 Apr 2008 09:21:52 -0700 (PDT), Isomorphismus > > <natalieh...(a)hotmail.com> wrote: > >Hello everyone, > >I get the mistake unresolved external symbol -LNK2001 when building a > >solution, > >but I checked over and over, but I wrote the correct name when calling > >my routine, in code it looks like this: > > In addition to USE A, you must also link in the object file created when > module A was compiled. This is automatic when you build in Visual Studio > (since you say LNK2001 I know you are using MS tools), but if you are building > from the command line you might have forgotten to do that. > well, actually I use 2 modules in my program and the other one linked perfectly (i got the use - statement and I builded in the visual studio, so it should have linked). i solved the problem now by putting the routine init_global into the other module, and now it runs, but it ´s kind of strange, isn´t it? Thanks for your help, greetings, Iso
From: Ken.Fairfield on 3 Apr 2008 13:06 On Apr 3, 1:22 am, Isomorphismus <natalieh...(a)hotmail.com> wrote: > On 2 Apr., 19:41, Steve Lionel <Steve.Lio...(a)intel.invalid> wrote: > > > On Wed, 2 Apr 2008 09:21:52 -0700 (PDT), Isomorphismus > > > <natalieh...(a)hotmail.com> wrote: > > >Hello everyone, > > >I get the mistake unresolved external symbol -LNK2001 when building a > > >solution, > > >but I checked over and over, but I wrote the correct name when calling > > >my routine, in code it looks like this: > > > In addition to USE A, you must also link in the object file created when > > module A was compiled. This is automatic when you build in Visual Studio > > (since you say LNK2001 I know you are using MS tools), but if you are building > > from the command line you might have forgotten to do that. > > well, actually I use 2 modules in my program and the other one linked > perfectly (i got the use - statement and I builded in the visual > studio, so it should have linked). i solved the problem now by putting > the routine init_global into the other module, and now it runs, but it > ´s kind of strange, isn´t it? Well, no, it's not strange...necessarily. Since you haven't shown us the actual code, you haven't shown where or how "prog" is defined, you haven't shown us the USE statements, chances are there is just a programming error producing this. If you want to actually *understand* what led to the error, in order to avoid it or something similarly "strange" in the future, you need to show us more detail, i.e., the actual code that produced the error. -Ken
|
Next
|
Last
Pages: 1 2 Prev: progress bar in fortran Next: Bug in Salford's FTN95 compiler version 5.20.1? |