Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm trying to get the MinGw C++ compiler set up so I can compile my code for Windows computers and I'm having troubles. I originally installed minGw32 but then found that mingw-w64 was a better fit for me, so I uninstalled minGw32 and installed mingw-w64. The problem is that when I try to compile a simple hello world application I get Multiple Definition errors (which are not from my code).

I'm thinking it has something to do with the removal of w32 and the installation of w64 without a clean directory. How do/should I clean the necessary folders & get rid of those multiple definitions.
Here's the first command I tried:

i686-w64-mingw32-gcc -c helloWorld.cpp

The result was

i686-w64-mingw32-gcc: error trying to exec 'cc1plus': execvp: No such file or directory

If I try

i686-w64-mingw32-gcc test.exe -o helloWorld.cpp

I get

i686-w64-mingw32-gcc: error: test.exe: No such file or directory
i686-w64-mingw32-gcc: fatal error: no input files
compilation terminated.

So I guess I'm also confused with how to use MinGw as well. I've been using G++ for a long time now but nothing seems to work. Here's what helloWorld.cpp looks like:

#include <iostream>

using namespace std;

int main()
{
    cout << "Hello World!\n";
    return 0;
}
share|improve this question
Please provide the code of the "simple hello world application" and the specific error output you get. – gertvdijk Nov 19 '12 at 23:10

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.