mingw

MinGW linker can't find MPICH2 libraries

MPICH2 is installed in C:\Program Files\MPICH2. There are two subdirectories (of interest), \include which contains .h files, and \lib which contains .lib files. The readme that comes with MPICH2 has the following instructions: create a makefile add –I…mpich2\include (uppercase i) add –L…mpich2\lib add –lmpi (lowercase L) add the rule...

mingw32 Ruby Installer for Windows

How good is the new Ruby Installer for Windows? I asked before about why Ruby was so slow on windows and now I've seen some impressive benchmarks showing marked speed improvements with the minGW compilation used in the new installers and am curious how it has worked for people who have tried it? How many gems are broken for this versio...

What's the easiest way to call Postgres from a MinGW program?

All I need is get MinGW talking to Postgres. I've considered several options: Use libpq. The libpq.lib that comes with Postgres for Windows links okay, but crashes when I use the library. I think because it was compiled for VC++. I can't find just the libpq code, so I'd have to recompile the entire Postgres tree in MinGW. Not easy...

C++ ctype facet for UTF-8 in mingw

In a project all internal strings are kept in utf-8 encoding. The project is ported to Linux and Windows. There is a need for a to_lower functionality now. On POSIX OS I could use std::ctype_byname("ru_RU.UTF-8"). But with g++ (Debian 4.3.4-1), ctype::tolower() don't recognize Russian UTF-8 characters (latin text is lowercased fine). O...

Can't link libpqxx in MinGW

Using MSYS, I compiled libpq (from compiling postgres). I then compiled libpqxx. Now, I want to create a client that will use libpqxx. libpq seemed to work fine. And, I can compile code with libpqxx. However, linking the libpq client application fails. Here's my code: #include <pqxx/pqxx> #include <iostream> using namespace std; ...

GtkGlArea's configure script is ignoring opengl32.a in MinGW

I've got a strange situation. I downloaded gtkglarea. I ran the configure script, telling it --with-lib-opengl32. This is necessary under MinGW because OpenGL is in the library c:/mingw/lib/opengl32.a. I also specified to configure that it needs to look for libraries in c:/mingw/lib using --libdir=c:/mingw/lib. And I have the library ope...

Why does my simple GTK+ based app take 8 seconds to start up?

Hi folks, I wrote a GTK+ app whose .exe is small, but of course like all GTK+ apps it links with many DLLs (under Windows). What my program does at this point is construct a GUI that consists of a GtkWindow, GtkTable, and about 12 others widgets. That's it. Yet when I start it up it takes about 8 seconds on my 2 GHz WinXP machine. Is ...

mkdir missing from MSYS

Why do I get this in MSYS? user@lappy1 ~ $ mkdir test sh: mkdir: command not found Basic commands like cd and pwd work just fine. What happened to mkdir? ...

mingw32-make : "Input line too long" issue

We have a Makefile which runs on a Windows 2003 machine and we are using mingw32-make for it. Since the Makefile has many include paths, it exceeds the buffer size of 8K that the cmd can handle [Ref - http://support.microsoft.com/kb/830473/EN-US/due to which the compilation results in "input line too long" issue. I wanted to know the fo...

mingw 3.4.5 missing dlfcn.h?

Hi, is it possible that my mingw 3.4.5 installation is faulty? or is this provided on some other library floating around? in case you are wondering, dlfcn.h is where stuff like dlopen and dlclose are defined, so it should be pretty standard ...

How can a currently running C program find out what directory it is located in?

Say I have a command line C program which is currently executing, and I want to read a file or execute another binary in the same directory - how can I find out what directory that is? Note that I'm not looking for the current working directory. The user may have invoked my original program in any of the following ways (and possibly oth...

Using GCC's C++0x mode in production?

Is anyone using the GCC 4.4.0 C++0x support in production? I'm thinking about using it with the latest MinGW, but I'm not sure if it's mature enough. I'm interested in: TR1 support auto initializer lists ...

Link libraries compiled by various compilers

Hello, I would like to ask in more detail about a answer I recently got here (3rd one): Compiled languages basics If I write in C and MinGW and I link to C++ library compiled by VC - will it work? How do I know in advance? In other words, if I'm able to create without warnings an .exe which links to that C++ .dll, and I'm able to run ...

Multithreaded Windows service in MingW

I am trying to build a Windows service with MingW. It need thread safe exceptions, so I added the linker flag -mthreads. The application works fine from the command-line, but when I try to start it from services.msc, the 1054 error ("The service did not respond to the start or control request in a timely fashion") is raised. The service ...

MinGW - cross compile tool - latest version?

At the MinGW download page you can download the "Cross-Hosted MinGW Build Tool" which is a shell script to build the "MinGW cross-compiler" so that you will be able to compile your programs on "Linux" to the "Windows" target. I have downloaded that script, run it and answered the interactive questions the script has asked me. I had to d...

make install on MinGW/MSYS doesn't like --prefix=/mingw

I've begun using MinGW/MSYS in an attempt to use some Linux libraries on Windows. Using ./configure --prefix=/mingw make make install has worked well so far, but I've had two different libraries fail on 'make install', on an 'ln -s' call. It goes something like this: rm -f /mingw/lib/libvamp-sdk.so.2 ln -s libvamp-sdk.so.2.0.0 /min...

A simple C program without #include <stdio.h>

How to call "printf" directly without including stdio.h ? I found a interesting tutorial here: http://www.halcode.com/archives/2008/05/11/hello-world-c-and-gnu-as/ So, here's my attempt: int main(){ char ss[] = "hello"; asm ( "pushl %ebp ;" "movl %esp, %ebp ;" "subl $4, %esp ;" "movl $ss, (%esp) ;" "call _printf ;" "mov...

C++ Output evaluation order with embedded function calls

Hi, I'm a TA for an intro C++ class. The following question was asked on a test last week: What is the output from the following program: int myFunc(int &x) { int temp = x * x * x; x += 1; return temp; } int main() { int x = 2; cout << myFunc(x) << endl << myFunc(x) << endl << myFunc(x) << endl; } The answer, to me a...

power of an integer in c++

Hi! I need to get the result from pow(a,b) as an integer (both a and b are integers too). currently the calculations where (int) pow( (double)a, (double)b) is included are wrong. Maybe someone can help with a function that does the pow(a,b) with integers and returns an integer too? But here is the odd part: I made my script in Linux wi...

Sockets in MinGW

I was just trying to build netcat in MSYS using MinGW and realized that MinGW never really ported all of the BSD socket stuff to Windows (eg sys/socket.h). I know you can use Windows Sockets in MinGW, but why did they never make a Windows port of the BSD sockets? I noticed quite a few programs using #ifdef's to workaround the issue. I...