Author Topic: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)  (Read 140420 times)

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
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.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline dwmcqueen

  • Multiple posting newcomer
  • *
  • Posts: 56
Does it search there before or after the one passed in (in my case C:\MingW-4.2)?

Offline dwmcqueen

  • Multiple posting newcomer
  • *
  • Posts: 56
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 ?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
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
« Last Edit: July 15, 2007, 08:37:43 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
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
« Last Edit: July 15, 2007, 08:59:02 pm by stahta01 »
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline dwmcqueen

  • Multiple posting newcomer
  • *
  • Posts: 56
Just checking - hard to tell when you are being sarcastic or straightforward

Offline dwmcqueen

  • Multiple posting newcomer
  • *
  • Posts: 56
But you have done much for the GCC compiler under MingW - and for that I appreciate your work!

Offline jsibarani

  • Multiple posting newcomer
  • *
  • Posts: 31
Thanks!

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


marouanebj

  • Guest
Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
« Reply #99 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
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

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7588
    • My Best Post
Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
« Reply #100 on: September 17, 2007, 10:28:14 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++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
« Reply #101 on: September 18, 2007, 04:11:07 am »
marouanebj:
You need to add "-fopenmp" to the linking step as well. I'm not sure how this is done in Eclipse.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

marouanebj

  • Guest
Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
« Reply #102 on: September 18, 2007, 10:33:23 am »
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

  • Guest
Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
« Reply #103 on: September 18, 2007, 10:36:44 am »
should I add the -fopenmp in the GCC Assembler flags ?
information: the configuration on Eclipse are divided in 3: Assembler, Compiler, Linker.

marouanebj

  • Guest
Re: TDM's unofficial GCC 4.2.0 for MinGW (now with OpenMP, Fortran and Obj-C)
« Reply #104 on: September 18, 2007, 11:37:18 am »
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