hi, I'm having some trouble cross-compiling and am lost as to what step to take next in finding out how to make it work (not something that happens often). The basic "hello, world" console app compiles fine but I have a project that I've been working on that won't compile for windows and I have some general questions regarding the process,
my project uses libraries glfw, ftgw, and box2d. It doesn't seem the problem is in libraries though because the error messages have only to do with header files, like in this one example:
In file included from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/i586-mingw32msvc/bits/c++locale.h:49,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/iosfwd:45,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/bits/stl_algobase.h:70,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/memory:53,
from /usr/include/freetype2/../Source/Dynamics/b2Body.h:26,
from /usr/include/Box2D.h:41,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio: At global scope:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:171: error: ‘::vfscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:172: error: ‘::vscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:174: error: ‘::vsscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:182: error: ‘__gnu_cxx::vfscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:183: error: ‘__gnu_cxx::vscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:185: error: ‘__gnu_cxx::vsscanf’ has not been declared
the errors are coming from well-established files like cstdio, cwchar, and cstdlib, which leads me to believe that there are some odd #defines happening. as far as I know, there aren't any platform-specific #defines happening aside from the windows-type ones from this tutorial, as these libraries are multi-platform. do I have to compile a new, different set of libraries for these sub-systems, in order to successfully cross-compile a windows binary? I'll throw in the entire build log for good measure.
Compiling: main.cpp
In file included from /usr/include/freetype2/../Source/Collision/Shapes/../../Common/b2Math.h:25,
from /usr/include/freetype2/../Source/Collision/Shapes/b2Shape.h:22,
from /usr/include/freetype2/../Source/Collision/Shapes/b2CircleShape.h:22,
from /usr/include/Box2D.h:36,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:164: error: ‘::lldiv_t’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:170: error: ‘::_Exit’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:177: error: ‘::llabs’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:179: error: ‘lldiv_t’ does not name a type
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:183: error: ‘::lldiv’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:198: error: ‘::strtof’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:199: error: ‘::strtold’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:206: error: ‘__gnu_cxx::lldiv_t’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:208: error: ‘__gnu_cxx::_Exit’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:211: error: ‘__gnu_cxx::llabs’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:212: error: ‘__gnu_cxx::div’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:213: error: ‘__gnu_cxx::lldiv’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:216: error: ‘__gnu_cxx::strtof’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdlib:219: error: ‘__gnu_cxx::strtold’ has not been declared
In file included from /usr/include/Box2D.h:39,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h: In member function ‘virtual void b2ContactListener::Add(const b2ContactPoint*)’:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h:95: warning: statement has no effect
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h: In member function ‘virtual void b2ContactListener::Persist(const b2ContactPoint*)’:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h:99: warning: statement has no effect
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h: In member function ‘virtual void b2ContactListener::Remove(const b2ContactPoint*)’:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h:103: warning: statement has no effect
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h: In member function ‘virtual void b2ContactListener::Result(const b2ContactResult*)’:
/usr/include/freetype2/../Source/Dynamics/b2WorldCallbacks.h:106: warning: statement has no effect
In file included from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/i586-mingw32msvc/bits/c++locale.h:49,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/iosfwd:45,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/bits/stl_algobase.h:70,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/memory:53,
from /usr/include/freetype2/../Source/Dynamics/b2Body.h:26,
from /usr/include/Box2D.h:41,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio: At global scope:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:171: error: ‘::vfscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:172: error: ‘::vscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:174: error: ‘::vsscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:182: error: ‘__gnu_cxx::vfscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:183: error: ‘__gnu_cxx::vscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cstdio:185: error: ‘__gnu_cxx::vsscanf’ has not been declared
In file included from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/bits/postypes.h:46,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/iosfwd:49,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/bits/stl_algobase.h:70,
from /usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/memory:53,
from /usr/include/freetype2/../Source/Dynamics/b2Body.h:26,
from /usr/include/Box2D.h:41,
from /home/dantarius/codeblocks/physics/main.cpp:6:
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:153: error: ‘::fwide’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:154: error: ‘::fwprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:155: error: ‘::fwscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:164: error: ‘::swprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:165: error: ‘::swscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:167: error: ‘::vfwprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:169: error: ‘::vfwscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:171: error: ‘::vswprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:173: error: ‘::vswscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:175: error: ‘::vwprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:177: error: ‘::vwscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:194: error: ‘::wcstof’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:205: error: ‘::wprintf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:206: error: ‘::wscanf’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:253: error: ‘::wcstold’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:262: error: ‘::wcstoll’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:263: error: ‘::wcstoull’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:270: error: ‘__gnu_cxx::wcstold’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:271: error: ‘__gnu_cxx::wcstoll’ has not been declared
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/include/c++/cwchar:272: error: ‘__gnu_cxx::wcstoull’ has not been declared
In file included from /home/dantarius/codeblocks/physics/main.cpp:12:
/home/dantarius/codeblocks/physics/camera.h: In function ‘void cameradragcb(int, int)’:
/home/dantarius/codeblocks/physics/camera.h:85: warning: unused variable ‘t’
In file included from /home/dantarius/codeblocks/physics/main.cpp:17:
/home/dantarius/codeblocks/physics/mainloop.h: In function ‘void mainloop()’:
/home/dantarius/codeblocks/physics/mainloop.h:52: warning: unused variable ‘t’
Process terminated with status 1 (0 minutes, 0 seconds)
40 errors, 6 warnings
command line:
i586-mingw32msvc-g++ -Wall -DWINVER=0x0400 -D__WIN95__ -D__GNUWIN32__ -DSTRICT -DHAVE_W32API_H -D__WXMSW__ -D__WINDOWS__ -I/usr/include -I/usr/include/freetype2 -I/usr/include -I/usr/include/freetype2 -I/usr/i586-mingw32msvc/include -c /home/dantarius/codeblocks/physics/main.cpp -o .objs/main.o
thanks for any help in advance,
brad