Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/fortran/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
fortran:在eclipsephotran中使用pgplot_Eclipse_Fortran_Gfortran_Photran - Fatal编程技术网

fortran:在eclipsephotran中使用pgplot

fortran:在eclipsephotran中使用pgplot,eclipse,fortran,gfortran,photran,Eclipse,Fortran,Gfortran,Photran,所以我实际上根本不是一个Fortran程序员,但我有一些代码正在使用Fortran中的pgplot图形库。我能够使用以下命令从控制台获得用fortran运行的代码 gfortran -o simple discrete.f -lpgplot -IX11 离散.f是文件名。因此,当我从控制台运行它时,它就工作了。但是,我想在EclipsePhotran插件中运行代码,这样我就可以使用调试器,这样我就可以逐步完成代码并观察一些变量。我试图将-lpgplot和-IX11标志放在Eclipse中,但在

所以我实际上根本不是一个Fortran程序员,但我有一些代码正在使用Fortran中的pgplot图形库。我能够使用以下命令从控制台获得用fortran运行的代码

gfortran -o simple discrete.f -lpgplot -IX11
离散.f是文件名。因此,当我从控制台运行它时,它就工作了。但是,我想在EclipsePhotran插件中运行代码,这样我就可以使用调试器,这样我就可以逐步完成代码并观察一些变量。我试图将-lpgplot和-IX11标志放在Eclipse中,但在将pgbbuf和pgnumb_uu函数作为未定义的引用时出现了错误(这意味着从Eclipse调用-lpgplot函数时不起作用)

谁能告诉我如何正确设置标志以在Photran中运行此代码,这样我就可以编译它并看到出现的pgplot图

我正在添加控制台输出:

02:57:05 **** Clean-only build of configuration Debug for project burglar_code_martin ****
make clean 
rm -rf  ./burglary_model.o  burglar_code_martin


02:57:05 Build Finished (took 61ms)

02:57:05 **** Build of configuration Debug for project burglar_code_martin ****
make all 
Building file: ../burglary_model.f
Invoking: GNU Fortran Compiler
gfortran -funderscoring -I/usr/lib -O0 -g -Wall -c -fmessage-length=0 -lpgplot -IX11 -o "burglary_model.o" "../burglary_model.f"
Warning: Nonconforming tab character in column 1 of line 225
Warning: Nonconforming tab character in column 1 of line 228
../burglary_model.f:155.27:

            call probcheck(frac,1,outc)                                 
                           1
Warning: Rank mismatch in argument 'problist' at (1) (rank-1 and scalar)
../burglary_model.f:54.33:

                  call probcheck(robprob,1,outcome)                     
                                 1
Warning: Rank mismatch in argument 'problist' at (1) (rank-1 and scalar)
../burglary_model.f:95.30:

               call probcheck(placeprob,1,outcome)                      
                              1
Warning: Rank mismatch in argument 'problist' at (1) (rank-1 and scalar)
../burglary_model.f:206.36:

      subroutine output(A,burgsatloc,t,l,pic,screen,A0,Bbar)            
                                    1
Warning: Unused dummy argument 'burgsatloc' at (1)
../burglary_model.f:206.44:

      subroutine output(A,burgsatloc,t,l,pic,screen,A0,Bbar)            
                                            1
Warning: Unused dummy argument 'pic' at (1)
../burglary_model.f:206.51:

      subroutine output(A,burgsatloc,t,l,pic,screen,A0,Bbar)            
                                                   1
Warning: Unused dummy argument 'screen' at (1)
../burglary_model.f:145.32:

      integer l,pic,screen,i,j,k,PGOPEN,burgsatloc(512,*),nbar,outc     
                                1
Warning: Unused variable 'k' declared at (1)
../burglary_model.f:146.15:

      real rand,red,green,blue                                          
               1
Warning: Unused variable 'rand' declared at (1)
../burglary_model.f:143.53:

      subroutine initialize(burgsatloc,B,l,pic,screen,rbar,Bbar)        
                                                     1
Warning: Unused dummy argument 'screen' at (1)
../burglary_model.f:4.58:

      integer i,j,n,l,pic,screen,guy,burgsatloc(512,512),k,             
                                                          1
Warning: Unused variable 'k' declared at (1)
Finished building: ../burglary_model.f

Building target: burglar_code_martin
Invoking: GNU Fortran Linker
gfortran -lpgplot -IX11 -o "burglar_code_martin"  ./burglary_model.o   
./burglary_model.o: In function `output_':
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:241: undefined reference to `pgbbuf_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:242: undefined reference to `pgnumb_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:244: undefined reference to `pgenv_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:246: undefined reference to `pglab_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:247: undefined reference to `pgimag_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:253: undefined reference to `pgebuf_'
./burglary_model.o: In function `initialize_':
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:165: undefined reference to `pgopen_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:168: undefined reference to `pgpap_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:169: undefined reference to `pgask_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:170: undefined reference to `pgscir_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:175: undefined reference to `pgscr_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:181: undefined reference to `pgscr_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:187: undefined reference to `pgscr_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:193: undefined reference to `pgscr_'
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:199: undefined reference to `pgscr_'
./burglary_model.o: In function `implicit':
/media/jaimini/workspace/eclipsejuno/burglar_code_martin/Debug/../burglary_model.f:109: undefined reference to `pgclos_'
collect2: ld returned 1 exit status
make: *** [burglar_code_martin] Error 1

02:57:05 Build Finished (took 209ms)

尝试将
-lpgplot
替换为
-L/full/path/to/libpgplot.XX
,其中
XX
是libpgplot的适当文件扩展名。因此,我实际上切换到了Netbean 7.3。Netbeans编译器设置更容易调整,而且很有效。我实际上能够保持-lgplot设置不变,并且它工作正常凯德,谢谢你,凯尔。