User forums > Using Code::Blocks
projects
rogerh:
If the purpose of projects is to group associated programs into one bundle, why won't mine compile with a main program and a common file? (F95)
The main compiles and runs but it needs the common file to run correctly.
Roger
oBFusCATed:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_%28errors%29#Q:_How_do_I_troubleshoot_a_compiler_problem.3F
rogerh:
Thanks. I did as the instructions said and got a message that might as well have been written in Sanscrit.
It seems as if both common.f95 and roger21.f95 compiled to .o versions but both were considered to be main and therefore failed.
I have no idea what to do about it.
--- Code: ---Cleaned "test1 - Debug"
-------------- Build: Debug in test1 (compiler: GNU Fortran Compiler)---------------
mingw32-gfortran.exe -Jobj\Debug\ -Wall -g -c D:\FORTRAN\COMMON.f95 -o obj\Debug\COMMON.o
mingw32-gfortran.exe -Jobj\Debug\ -Wall -g -c D:\FORTRAN\test1\main.f95 -o obj\Debug\test1\main.o
mingw32-gfortran.exe -Jobj\Debug\ -Wall -g -c D:\FORTRAN\ROGER21.F95 -o obj\Debug\ROGER21.o
mingw32-gfortran.exe -o bin\Debug\test1.exe obj\Debug\COMMON.o obj\Debug\test1\main.o obj\Debug\ROGER21.o
obj\Debug\ROGER21.o: In function `main':
D:/FORTRAN/ROGER21.F95:2: multiple definition of `main'
obj\Debug\test1\main.o:D:/FORTRAN/test1/main.f95:8: first defined here
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---
Roger
stahta01:
--- Quote from: rogerh on July 30, 2015, 03:39:25 pm ---Thanks. I did as the instructions said and got a message that might as well have been written in Sanscrit.
It seems as if both common.f95 and roger21.f95 compiled to .o versions but both were considered to be main and therefore failed.
I have no idea what to do about it.
--- Code: ---Cleaned "test1 - Debug"
-------------- Build: Debug in test1 (compiler: GNU Fortran Compiler)---------------
mingw32-gfortran.exe -Jobj\Debug\ -Wall -g -c D:\FORTRAN\COMMON.f95 -o obj\Debug\COMMON.o
mingw32-gfortran.exe -Jobj\Debug\ -Wall -g -c D:\FORTRAN\test1\main.f95 -o obj\Debug\test1\main.o
mingw32-gfortran.exe -Jobj\Debug\ -Wall -g -c D:\FORTRAN\ROGER21.F95 -o obj\Debug\ROGER21.o
mingw32-gfortran.exe -o bin\Debug\test1.exe obj\Debug\COMMON.o obj\Debug\test1\main.o obj\Debug\ROGER21.o
obj\Debug\ROGER21.o: In function `main':
D:/FORTRAN/ROGER21.F95:2: multiple definition of `main'
obj\Debug\test1\main.o:D:/FORTRAN/test1/main.f95:8: first defined here
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
--- End code ---
Roger
--- End quote ---
I suggest finding a site that supports your Compiler or FORTRAN; and, then posting your code and this build log there.
Ask that site for help in learning FORTRAN and/or how your Compiler works.
Tim S.
rogerh:
Thanks, that sounds reasonable.
Apparently it's not a C::B problem.
Unfortunately the last post on the mingw board was 4 years ago. I don't think that will help.
Also true of the other free compiler and the 3rd one is not free.
It's possible to merge it all into one file but that's not a good solution.
Roger
Navigation
[0] Message Index
[#] Next page
Go to full version