Author Topic: compiler problem  (Read 4630 times)

Offline nnarcozy

  • Single posting newcomer
  • *
  • Posts: 3
compiler problem
« on: May 03, 2012, 03:24:22 pm »
Hello,
I have just discovered C::B is a beautiful tool. I thank the authors. I am working on windows 7 with MinGW and gfortran. When I create a fortran project that contains only a main.f90 file: I come very well to compile, linker and run my program.
But in a case more complicated where I have a main file and then two files which contain a module and a dll file: it does not work.
 To compile my project with ms-dos command I put me in the directory and I type :
gfortran ok_module.f90 ok_module2.F90 ok.f90 bolsig_g.dll
this works well but not with C: B.
ld.exe||cannot find -lbolsig_g.dll|
While I have put in the section project > Build options > Linker settings > Link libraries and project > Build options > search directories > linker the file bolsig_g.dll.
More I am not sure that it tries to compile the files in good order. May he begins by ok.f90 then ok_module.f90 and finally ok_module2.f90. While it would make ok_module.f90 then ok_module2.f90 then ok.f90. How to tell the order?

Thanks a lot

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7785
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline nnarcozy

  • Single posting newcomer
  • *
  • Posts: 3
Re: compiler problem
« Reply #2 on: May 03, 2012, 04:14:33 pm »
Thank you for your answer.

I put the option and i said :
gfortran.exe -LD:\ProjetFortran\r1fortran\r1fort\  -o bin\Debug\r1fort.exe obj\Debug\ok_module.o obj\Debug\dvode_f90_m.o obj\Debug\zdplaskin_m.o obj\Debug\ok.o    -lbolsig_g.dll

I don't konw why i put -lbolsig_g.dll instead of bolsig_g.dll. I try with this command line in msdos command :
gfortran.exe -LD:\ProjetFortran\r1fortran\r1fort\  -o bin\Debug\r1fort.exe obj\Debug\ok_module.o obj\Debug\dvode_f90_m.o obj\Debug\zdplaskin_m.o obj\Debug\ok.o   bolsig_g.dll
and it's working.
« Last Edit: May 03, 2012, 04:30:02 pm by nnarcozy »

Offline nnarcozy

  • Single posting newcomer
  • *
  • Posts: 3
Re: compiler problem
« Reply #3 on: May 03, 2012, 05:14:02 pm »
Ok I have found two solutions.

Solution 1:

I have put in the section project > Build options > Linker settings > Link libraries the file bolsig_g.dll.
And I have removed the '-l' option in the Settings>compiler>global compiler settings>Gnu fortran compiler>other settings>advanced options > others > Link library.

That's works I have not enough knowledge in programing to understand why the option -l have to be removed with my bolsig_g.dll

Solution 2 :
I really don't like the 1 solution. I have found another way.
I have removed in the section project > Build options > Linker settings > Link libraries the file bolsig_g.dll.
Then in project>properties>build targets> build target files > selected file properties of bolsig_g.dll > build > uncheck the compile file box and check the link file.
Then rename the file bolsig_g.dll in bolsig_g.o and I put it in the obj/debug and obj/release folder of my project.

 
Tanks a lot

PS: To tell the order of compiling file: project>properties>build targets> build target files > selected file properties>build> you have a cursor for selected the priority of the file
« Last Edit: May 03, 2012, 05:36:41 pm by nnarcozy »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9723
Re: compiler problem
« Reply #4 on: May 04, 2012, 02:56:10 pm »
Make use of the "fortran project" 3rd party plugin. This will help you lot!
See: http://darmar.vgtu.lt/
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ