Hello
I'm using TDM-GCC compiler, and trying to compile a simple hello world for 32 bit using -m32 in other options under compiler and debugger and I get this error.
C:\Users\Dnabled\Documents\C++ Work\Test.o:Test.cpp|| undefined reference to `___main'|
C:\Users\Dnabled\Documents\C++ Work\Test.o:Test.cpp|| undefined reference to `__ZSt4cout'|
C:\Users\Dnabled\Documents\C++ Work\Test.o:Test.cpp|| undefined reference to `__ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc'|
C:\Users\Dnabled\Documents\C++ Work\Test.o:Test.cpp|| undefined reference to `__ZNSt8ios_base4InitD1Ev'|
C:\Users\Dnabled\Documents\C++ Work\Test.o:Test.cpp|| undefined reference to `__ZNSt8ios_base4InitC1Ev'|
C:\Users\Dnabled\Documents\C++ Work\Test.o:Test.cpp|| undefined reference to `_atexit'|
c:\program files\mingw64\bin\..\lib\gcc\x86_64-w64-mingw32\4.5.2\..\..\..\..\x86_64-w64-mingw32\lib\libmingw32.a(lib64_libmingw32_a-crt0_c.o)||In function `main':|
c:\crossdev\src\mingw-w64-svn\mingw-w64-crt\crt\crt0_c.c|18|undefined reference to `WinMain'|
||=== Build finished: 7 errors, 0 warnings ===|
Using -m64 works well.
the code:
#include<iostream>
using namespace std;
int main()
{
cout << "This is for you.";
}
According to TDM-GCC I should be able to compile for both 32 and 64 bit using their 64 bit compiler and the -m32 command. Am I doing something wrong? I need to make 32 bit programs because at school the OS is 32 bit and we get projects from time to time.
Thank You