User forums > General (but related to Code::Blocks)

GCC 4.2.1 binary release for mingw is available from MINGW

<< < (11/12) > >>

TDragon:

--- Quote from: Blue-Tiger on September 25, 2007, 04:24:59 pm ---Does anyone know how i can enable OpenMP-Support in the official MinGW release?

--- End quote ---
First, you need to build pthreads-win32 (the standard DLL -- "make GC-inlined"); second, you need to add "-fopenmp" and the path to the DLL (typically "pthreadGC2.dll") to your command line.

Baluarte:
Hi!

Perhaps this object of discussion is not in the correct place, but I am without ideas.

I am working with last nightly build of Codeblocks. Until now, my compilers have been  gcc 3.4.5 (official MinGW), gcc 4.2.0 (TDragon) and gcc 4.2.1 (TDragon). No problem!

However, When I try the official new version (MinGW with gcc 4.2.1-dw2-2) (Installed manually or installed with the MinGW Gcc v4.2.1 Unofficial Installer help [by RJP Computing]) i get strange link errors. (???)

Maybe a lost flag or... I have not a a remote idea!

For example!

The code:

// my first program in C++

#include <iostream>
using namespace std;

int main ()
{
  cout << "Hello World!";
  return 0;
}

I get:

[100.0%] g++.exe -LC:\mSYS\local\lib -LC:\mSYS\local\lib\boost-1.34.1\lib -LC:\MinGW\lib\gcc\mingw32\4.2.1-dw2 -LC:\MinGW\lib  -o bin\Release\DisplayOPENGL.exe obj\Release\Main.o   -s -L/usr/local/lib  -mthreads  -Wl,--subsystem,windows -mwindows -lwx_msw_aui-2.8 -lwx_msw_xrc-2.8 -lwx_msw_qa-2.8 -lwx_msw_html-2.8 -lwx_msw_adv-2.8 -lwx_msw_core-2.8 -lwx_base_xml-2.8 -lwx_base_net-2.8 -lwx_base-2.8  -lwx_msw_richtext-2.8 -lMagick++ -lWand -lMagick -lgdi32 -lm -lpthreadGC2 -lSDL 
obj\Release\Main.o: In function `_static_initialization_and_destruction_0':
c:/mingw/bin/../lib/gcc/mingw32/4.2.1-dw2/include/c++/iostream:77: undefined reference to `_imp___ZNSt8ios_base4InitC1Ev'
obj\Release\Main.o: In function `_tcf_0':
c:/mingw/bin/../lib/gcc/mingw32/4.2.1-dw2/include/c++/iostream:77: undefined reference to `_imp___ZNSt8ios_base4InitD1Ev'
obj\Release\Main.o: In function `operator<< <std::char_traits<char> >':
c:/mingw/bin/../lib/gcc/mingw32/4.2.1-dw2/include/c++/ostream:517: undefined reference to `_imp___ZSt4cout'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 0 seconds)
3 errors, 0 warnings

I am desolated! Any comment? Thank you!

Baluarte

PD:Sigh! Sorry for my poor and schematic english! My native language is spanish.

 

MortenMacFly:

--- Quote from: Baluarte on October 05, 2007, 02:04:30 pm ---[100.0%] g++.exe -LC:\mSYS\local\lib -LC:\mSYS\local\lib\boost-1.34.1\lib -LC:\MinGW\lib\gcc\mingw32\4.2.1-dw2 -LC:\MinGW\lib  -o bin\Release\DisplayOPENGL.exe obj\Release\Main.o   -s -L/usr/local/lib  -mthreads  -Wl,--subsystem,windows -mwindows -lwx_msw_aui-2.8 -lwx_msw_xrc-2.8 -lwx_msw_qa-2.8 -lwx_msw_html-2.8 -lwx_msw_adv-2.8 -lwx_msw_core-2.8 -lwx_base_xml-2.8 -lwx_base_net-2.8 -lwx_base-2.8  -lwx_msw_richtext-2.8 -lMagick++ -lWand -lMagick -lgdi32 -lm -lpthreadGC2 -lSDL 

--- End quote ---
For your example why do you link against:
- a million wx libs
- Magick++
- math library
- pthread
- SDL
???
Please create a plain console app, don't link against any additional lib and see if it's still the same...
With regards, Morten.

Baluarte:

8-O

Ah! I am shocked!! I never thought a Codeblocks Developer answered to me! TO ME! I am not a believer person but God(dess) (s) bless your generous mind and skilled hands!
Very grateful for your unforeseen interest!

I am convinced that your proyect "CODEBLOCKS" remarkably encourages the C++ development.

In any sense this piece of software is so important like free compilers because it is a democratising tool in multiple planes. Machines/Platforms. Operating Systems. Compilers. Users according to  purchasing power. Users according to knowledge. Users according to use easiness and so on.
 
 (C++ Eclipse Plugin CDT.Anjunta, DevCPP, KDevelop, Builder IDE, Visual Studio IDE, XCode) had/have not such power.
 
On the other hand, beyond any trascendental dream, the design is very cute. Complete. Generic. Understandable. Natural... The Oxford dictionary have not enough positive adjetives!

At the end, Open-Source and free. Thanks!


My trouble:

I didn“t consider the flags because the same flags had worked with other compiler versions. In fact previously I had built all dependent libraries with gcc 4.2.1-dw2 without troubles.
I admit I was blinded. I am shamed. Sorry!

But I wake! I followed your  reductionist approximation and I found the source of the problem.

Simply, under the tab "#defines" in Compiler and debugger I had:

WXUSINGDLL
__WXMSW__
WXUSINGDLL=1
NO_GCC_PRAGMA
_DLL
_MT


Why is that here? I can not remember it. But I do not worry! I do not need it!

I apologize you for my abominable english

Biplab:

--- Quote from: Baluarte on October 05, 2007, 06:41:18 pm ---Why is that here? I can not remember it. But I do not worry! I do not need it!

--- End quote ---

I guess you tried to use a wxWidgets project to compile your console app.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version