Topic: Problem with Hello World using C++
Hi,
I just started using a trial version of Simply Fortran and tried to create a simple hello world program using c++. I have created a project and saved the file with the .cpp extension. The code is:
"#include <iostream>
int main(int argc, char **argv) {
std::cout << "Hello world!\n";
return 0;
}"
I get a bunch of error messages when compiling though:
Open Watcom Make Version 1.9 (Built on May 17 2012)
Portions Copyright (c) 1988-2002 Sybase, Inc. All Rights Reserved.
Source code is available under the Sybase Open Watcom Public License.
See http://www.openwatcom.org/ for details.
"C:\Program Files (x86)\Simply Fortran\mingw-w64\bin\gcc.exe" -c -o "build\main.o" -g -m32 ".\main.cpp"
"C:\Program Files (x86)\Simply Fortran\mingw-w64\bin\gfortran.exe" -o "hello.exe" -static -m32 "build\main.o" -LC:/PROGRA~2/SIMPLY~1/MINGW-~1/lib/ -LC:/PROGRA~2/SIMPLY~1/MINGW-~1/lib/gcc/X86_64~1/475CEE~1.2
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~2/SIMPLY~1/MINGW-~1/lib/gcc/X86_64~1/475CEE~1.2\libgcc_eh.a when searching for -lgcc_eh
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~2/SIMPLY~1/MINGW-~1/lib/gcc/X86_64~1/475CEE~1.2\libgcc.a when searching for -lgcc
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~2/SIMPLY~1/MINGW-~1/lib/gcc/X86_64~1/475CEE~1.2\libgcc_eh.a when searching for -lgcc_eh
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~2/SIMPLY~1/MINGW-~1/lib/gcc/X86_64~1/475CEE~1.2\libgcc.a when searching for -lgcc
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~2/SIMPLY~1/MINGW-~1/lib/gcc/X86_64~1/475CEE~1.2\libgcc_eh.a when searching for -lgcc_eh
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/PROGRA~2/SIMPLY~1/MINGW-~1/lib/gcc/X86_64~1/475CEE~1.2\libgcc.a when searching for -lgcc
build\main.o: In function `swscanf':
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/wchar.h:459: undefined reference to `__gxx_personality_sj0'
build\main.o: In function `wscanf':
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/wchar.h:470: undefined reference to `__gxx_personality_sj0'
build\main.o: In function `fwscanf':
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/wchar.h:481: undefined reference to `__gxx_personality_sj0'
build\main.o: In function `fwprintf':
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/wchar.h:517: undefined reference to `__gxx_personality_sj0'
build\main.o: In function `wprintf':
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/wchar.h:528: undefined reference to `__gxx_personality_sj0'
build\main.o:c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/wchar.h:539: more undefined references to `__gxx_personality_sj0' follow
build\main.o: In function `_tcf_0':
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/c++/4.7.2/iostream:75: undefined reference to `std::ios_base::Init::~Init()'
build\main.o: In function `_static_initialization_and_destruction_0':
c:/program files (x86)/simply fortran/mingw-w64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.2/../../../../x86_64-w64-mingw32/include/c++/4.7.2/iostream:75: undefined reference to `std::ios_base::Init::Init()'
collect2.exe: error: ld returned 1 exit status
Error(E42): Last command making (hello.exe) returned a bad status
Error(E02): Make execution terminated
* Complete *
It seems like it is "skipping incompatible" for -lgcc. Does anyone know how I should fix that?
Regards
Ronny