News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)

Started by TDragon, May 18, 2007, 11:36:45 PM

Previous topic - Next topic

stahta01

Quote from: dwmcqueen on July 14, 2007, 11:25:44 PM
Something I noticed - and am having a weird time figuring out how.

I have this version installed to C:\MingW-4.2\.  However, the linker is pulling in libraries from my C:\MingW\lib directory even though it is not specified as a library path (and isn't in an environment variable).  It also pulls in from my C:\MingW-4.2\lib.  Anyone know how to get it to ignore my C:\MingW\lib directory?

I have found that in order to avoid that you can not have an X:\MingW on your computer (where X is any of the drives on your computer).

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

TDragon

What Tim said. :)

Basically, "/mingw/lib" is, by default, hardcoded into the directories to be searched. If someone more knowledgeable about GCC's internal workings than me provides a patch to turn this off, I can certainly apply it to my distributions.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

dwmcqueen

Does it search there before or after the one passed in (in my case C:\MingW-4.2)?

dwmcqueen

I just wanted to make sure I understood what you said, 20-40 - are you saying we are insane to name our directories C:\MingW-[version] or one would be insane to install it to C:\MingW ?

stahta01

Quote from: dwmcqueen on July 15, 2007, 08:24:16 PM
I just wanted to make sure I understood what you said, 20-40 - are you saying we are insane to name our directories C:\MingW-[version] or one would be insane to install it to C:\MingW ?

I myself consider it best to only install to C:\MinGW or in using multiple installs to make sure C:\MinGW does not exists.

Note: Per my understanding of TDM Directions, when building GCC you should use C:\MinGW. Since I don't use C:\MinGW I think I know why my last try on building MinGW GCC failed. ( About 2 to 3 months ago.)

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

stahta01

FYI:

I finally found the option to remove some warnings on compiling Code::Blocks.

warning: deprecated conversion from string constant
-Wno-write-strings

Edit: Sorry if this was already mentioned, the CB search did not find it, but CB search misses a lot of things.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

dwmcqueen

Just checking - hard to tell when you are being sarcastic or straightforward

dwmcqueen

But you have done much for the GCC compiler under MingW - and for that I appreciate your work!

jsibarani

Thanks!

I have successfully compiled a monolithic dll and then compiled wxAui  sample


marouanebj

Hi,
I don't know if it's the proper place.
But I have a probleme compiling a program with OpenMP.
1/ I installed the last release of MinGW with the installer 5.1.3
2/ I dowloaded the GCC 4.2.1 TDM 2 from http://www.tdragon.net/recentgcc/
3/ I putted them in C/MinGW
I use Eclipse to compile
this is the progam:
// ================================
// Hello World OpenMP
// program that write Hello word for each thread
// ================================
#include <omp.h>
#include <stdio.h>
int main(int argc, char *argv[])
{
   int nthreads, tid;
   /* Fork a team of threads giving them their own copies of variables */
   #pragma omp parallel private(tid)
   {
      /* Obtain and print thread id */
      //tid = omp_get_thread_num();
      tid = 0;
      printf("Hello World from thread = %d\n", tid);
   
      /* Only master thread does this */
      if (tid == 0) {
         //nthreads = omp_get_num_threads();
         nthreads = 1;
         printf("Number of threads = %d\n", nthreads);
      }   
   }  /* All threads join master thread and terminate */
   return 0;
}
// =================
This is the console msg:
**** Build of configuration Release for project test gcc ****

**** Internal Builder is used for build               ****
gcc -O3 -g -Wall -c -fmessage-length=0 -fopenmp -osrc\main.o ..\src\main.c
gcc -otestgcc.exe src\main.o
src\main.o: In function `main':C:/Documents and Settings/marouane/eclipse_workspace/test gcc/Release/../src/main.c:9: undefined reference to `GOMP_parallel_start'
:C:/Documents and Settings/marouane/eclipse_workspace/test gcc/Release/../src/main.c:9: undefined reference to `GOMP_parallel_end'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 1063  ms.


can someone help me.
Thanks

stahta01

Quote from: marouanebj on September 17, 2007, 09:24:56 PM
Hi,
I don't know if it's the proper place.
But I have a probleme compiling a program with OpenMP.
1/ I installed the last release of MinGW with the installer 5.1.3

I suggest doing a manual install so you know exactly what binaries were installed.

Tim S
C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

TDragon

marouanebj:
You need to add "-fopenmp" to the linking step as well. I'm not sure how this is done in Eclipse.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

marouanebj

Hi again, Still same troubles

ok I added the -fopenmp in the linking. Here is the result:
**** Internal Builder is used for build               ****
gcc -O3 -g -Wall -c -fmessage-length=0 -fopenmp -osrc\main.o ..\src\main.c
gcc -Xlinker -fopenmp -shared -olibtestgcc.exe src\main.o
src\main.o: In function `main':C:/Documents and Settings/marouane/eclipse_workspace/test gcc/Release/../src/main.c:9: undefined reference to `GOMP_parallel_start'
:C:/Documents and Settings/marouane/eclipse_workspace/test gcc/Release/../src/main.c:9: undefined reference to `GOMP_parallel_end'
collect2: ld returned 1 exit status
Build error occurred, build is stopped
Time consumed: 328  ms.


Is it possible that I have a Path Problem ? or the information on where is the lib which contain this header (omp.h)  file.
- I'm almost a beginner in compiling, so if I say strange things correct me.

marouanebj

should I add the -fopenmp in the GCC Assembler flags ?
information: the configuration on Eclipse are divided in 3: Assembler, Compiler, Linker.

marouanebj

OK I got it.

There was an error in the second compilation:
this work:
**** Internal Builder is used for build               ****
gcc -O2 -g -Wall -c -fmessage-length=0 -fopenmp -osrc\main.o ..\src\main.c
gcc -fopenmp -otestgcc.exe src\main.o
Build complete for project test gcc
Time consumed: 281  ms. 

Thanks All