tdm-mingw

C++ inline functions using GCC - why the CALL?

I have been testing inline function calls in C++. Thread model: win32 gcc version 4.3.3 (4.3.3-tdm-1 mingw32) Stroustrup in The C++ Programming language wirtes: The inline specifier is a hint to the compiler that it should attempt to generate code [...] inline rather than laying down the code for the function once and then calling...

fstream linking error in g++ with -std=gnu++0x

Hello, I'm have an application built with the -std=gnu++0x parameter in tdm-mingw g++ 4.4.0 on windows. It is using an ofstream object and when I build, it gives the following linking error: c:\opt\Noddler/main_func.cpp:43: undefined reference to `std::basic_ofstream<char, std::char_traits<char> >::basic_ofstream(std::string const&, st...

C++ GCC4.4 warning: array subscript is above array bounds

I recently upgraded to GCC 4.4 (MinGW TDM build) and now the follow code produces these warning: In member function 'void Console::print(const std::string&)': warning: array subscript is above array bounds Here's the code: void Console::print( const std::string& str ) { std::string newLine( str ); if( newLine.size()...

Access to global data in a dll from an exported dll function

Hello, I am creating a C++ Win32 dll with some global data. There is a std::map defined globally and there are exported functions in the dll that write data into the map (after acquiring a write lock, ofcourse). My problem is, when I call the write function from inside the dll DllMain, it works without any problems. But when I load the...

GCC: Empty program == 23202 bytes?

test.c: int main() { return 0; } I haven't used any flags (I am a newb to gcc) , just the command: gcc test.c I have used the latest TDM build of GCC on win32. The resulting executable is almost 23KB, way too big for an empty program. How can I reduce the size of the executable? ...

GCC's assembly output of an empty program on x86, win32

I write empty programs to annoy the hell out of stackoverflow coders, NOT. I am just exploring the gnu toolchain. Now the following might be too deep for me, but to continuie the empty program saga I have started to examine the output of the C compiler, the stuff GNU as consumes. gcc version 4.4.0 (TDM-1 mingw32) test.c: int main() ...

How to see what g++ command-lines Boost.Build invokes (1.33.1)

Hi, I'm scratching my head, trying to figure out why the import libraries are not generated when I build the Boost libraries on my machine. More specifically, building the DLLs works fine, but where I would previously (i.e. before I reinstalled my machine) generate the import libraries correctly. Some specs: Boost 1.33.1 g++ 4.3.3 TD...

Trying to compile Python using TDM-GCC on Win32, error in posixmodule.c

This is the line typedef BOOL (WINAPI *CRYPTACQUIRECONTEXTA)(HCRYPTPROV *phProv, LPCSTR pszContainer, LPCSTR pszProvider, DWORD dwProvType, DWORD dwFlags ); Where I get the error: Python-2.6.4\Modules\posixmodule.c|8299|error: expected ')' before '*' token| The compiler is GCC: gcc (TDM-1 mingw32) 4.4.1...

Which unit testing framework to use for C development on Windows?

On Windows XP, using TDM's GCC/MinGW32 for basic development i.e. gcc 4.4.x with gdb. Which unit testing framework to use for test driven development? Apparently Check's unit tests don't yet work on Windows. The questions at Unit Testing Frameworks for C and Unit Testing C Code are similar but not specifically about using gcc 4.4.x on ...

Multiple definition of inline functions when linking static libs

I have a C++ program that I compile with mingw (gcc for Windows). Using the TDM release of mingw which includes gcc 4.4.1. The executable links to two static library (.a) files: On of them is a third-party library written in C; the other is a C++ library, written by me, that uses the C library provides my own C++ API on top. An (in m...

rand_s for MinGW

I have found the rand_s function, part of the CRT, to be extremely useful while developing my application. However, it is my understanding that it is not prototyped in recent MinGW header files. Therefore I am asking for a comprehensive means of either providing or prototyping such a function. I have considered using an #ifdef MINGW st...