MinGW

C/C++ este un limbaj multi-paradigmă de nivel mediu, orientat pe obiecte, folosit pe scară largă în industria software datorită echilibrului dintre viteză şi complexitate. Dacă ai nelămuriri în legătură cu acest limbaj sau vrei să ne înveți ceva chiar tu, intră aici.

MinGW

Postby jolgau » 07 Dec 2011, 22:25

Tocmai m-am hotarat sa renunt la Dev C++ si sa imi instalez MinGW dar am o problema ... mingw nu ma lasa sa compilez.

De ce nu ma lasa mingw sa compilez?
0,0p / 0 votes
User avatar
jolgau
Bit
 
Joined: 11 Dec 2010
Status: 0

Re: MinGW

Postby morpheus » 07 Dec 2011, 22:45

Ce faci exact ? Da detalii.
0,0p / 0 votes
User avatar
morpheus
Word
 
Joined: 30 Dec 2009
Location: Bucharest, Romania
Status: 54.84

Re: MinGW

Postby nomemory » 07 Dec 2011, 22:58

Eu iti recomand cu caldura: Code::Blocks (daca vrei sa testezi sa downloadezi varianta a doua: codeblocks-10.05mingw-setup.exe)
0,0p / 0 votes
User avatar
nomemory
Bit
 
Joined: 24 Aug 2011
Location: Bucuresti
Status: 2

Re: MinGW

Postby morpheus » 07 Dec 2011, 23:03

Jolgau, MinGW != MinGW Developer Studio. Daca tu de fapt folosesti MinGW Developer Studio fa ce spune nomemory.
Altfel, daca folosesti MinGW (cum am presupus eu) si ai probleme sa compilezi folosind gcc in command line, explica ce faci exact.
0,0p / 0 votes
User avatar
morpheus
Word
 
Joined: 30 Dec 2009
Location: Bucharest, Romania
Status: 54.84

Re: MinGW

Postby just me » 07 Dec 2011, 23:13

Jolgau, nu cumva deschizi programul facut cu Code Blocks direct cu MinGW-ul si din cauza asta nu compileaza? Sau deschizi ca si Win32 Console Application si C/C++ Source File?
0,0p / 0 votes
" Being happy doesn't mean that everything is perfect. It means that you've decided to look beyond the imperfections "
User avatar
just me
Bit
 
Joined: 30 Dec 2009
Location: Cluj
Status: 3

Re: MinGW

Postby jolgau » 07 Dec 2011, 23:16

Aaaa nu mai conteaza cu mingw , am ascultat sfatul lui @nomemory si mi-am pus Code :: Blocks dar va multumesc mult.
0,0p / 0 votes
User avatar
jolgau
Bit
 
Joined: 11 Dec 2010
Status: 0

Re: MinGW

Postby just me » 07 Dec 2011, 23:49

Eu nu stiu ce sa zic, am studenti care folosesc Code Blocks si tot au probleme cu rezolvatul unor probleme, da foarte multe erori care defapt in Visual sau MinGW nu exista. :(
0,0p / 0 votes
" Being happy doesn't mean that everything is perfect. It means that you've decided to look beyond the imperfections "
User avatar
just me
Bit
 
Joined: 30 Dec 2009
Location: Cluj
Status: 3

Re: MinGW

Postby morpheus » 07 Dec 2011, 23:56

MInGW e un port al toolchain-ului GNU pe Windows.
CodeBlocks e un IDE peste MinGW.
MInGW Developer Studio e un alt IDE peste MinGW care nu mai e mentinut si vine implicit cu o versiune veche de MinGW.
CodeBlocks full vine cu o versiune relativ noua de MinGW.
Ce versiune de Visual Studio folosesc studentii (cea care nu le da erori) ?
0,0p / 0 votes
User avatar
morpheus
Word
 
Joined: 30 Dec 2009
Location: Bucharest, Romania
Status: 54.84

Re: MinGW

Postby just me » 07 Dec 2011, 23:57

Visual Studio 6.0
0,0p / 0 votes
" Being happy doesn't mean that everything is perfect. It means that you've decided to look beyond the imperfections "
User avatar
just me
Bit
 
Joined: 30 Dec 2009
Location: Cluj
Status: 3

Re: MinGW

Postby morpheus » 08 Dec 2011, 00:03

Problemele sunt cel mai probabil din codul lor (al studentilor), in sensul ca e non-standard.
Visual C++ 6.0 e un compilator vechi, pre-standard.
Daca ei si-ar compila acel cod cu Visual Studio 2008 sau 2010, probabil ca de asemenea ar avea probleme.
Ei ar trebui sa invete sa scrie cod standard C++ 98 si sa foloseasca un compilator nou (gcc 4.4 sau mai nou, Visual Studio Express Edition 2008 sau 2010 sunt recomandate si gratuite).
0,0p / 0 votes
User avatar
morpheus
Word
 
Joined: 30 Dec 2009
Location: Bucharest, Romania
Status: 54.84

Re: MinGW

Postby just me » 08 Dec 2011, 00:08

Asta e o problema care a dat foarte multe erori:

  1. #include <stdio.h>
  2. #define MAX_SIR 50
  3. void citire_mat(int lin, int col, double mat[][MAX_SIR])
  4. { int i, j;
  5.   for (i=0; i<lin; i++)
  6.   {
  7.     for (j=0; j<col; j++)
  8.     {
  9.       printf ("Elem[%d][%d]=", i+1, j+1) ;
  10.       scanf("%lf", &mat[i][j]);
  11.     }
  12.   }
  13. }
  14.  
  15. double suma(int lin, int col, double mat[][MAX_SIR])
  16. {
  17.     int i, j;
  18.     double s=0;
  19.     for( i=0; i<lin; i++)
  20.         for( j=0; j<col; j++)
  21.         {   
  22.            s=s+mat[i][j];
  23.         }
  24.     return s;
  25. }
  26.  
  27. void afisare_mat(int lin, int col, double mat[][MAX_SIR])
  28. {
  29.   int i, j;
  30.   for (i=0; i<lin; i++)
  31.   {
  32.     for (j=0; j<col; j++)
  33.     {
  34.      printf("%15.2lf\t", mat[i][j]);
  35.     }
  36.     printf("\n");
  37.   }
  38. }
  39. int main()
  40. {double a[MAX_SIR][MAX_SIR];
  41.   int n, m;
  42.   printf("Dati numarul de linii: ");
  43.   scanf("%d", &n);
  44.   printf("Dati numarul de coloane: ");
  45.   scanf("%d", &m);
  46.   printf("Dati valorile matricii a:\n");
  47.   citire_mat(n, m, a);
  48.   printf("\nMatricea a este:\n");
  49.   afisare_mat(n, m, a);
  50.  printf ("\nSuma elementelor este: %.2lf\n",  suma(n, m, a)) ;
  51.   return 0;
  52. }
  53.  


Ce e gresit in ea?
0,0p / 0 votes
" Being happy doesn't mean that everything is perfect. It means that you've decided to look beyond the imperfections "
User avatar
just me
Bit
 
Joined: 30 Dec 2009
Location: Cluj
Status: 3

Re: MinGW

Postby morpheus » 08 Dec 2011, 00:12

Ce erori da ? Sunt la compilare sau la executie ?
Am incercat cu gcc 4.4.5 pe Linux si a functionat fara probleme (si compilarea si executia).
0,0p / 0 votes
User avatar
morpheus
Word
 
Joined: 30 Dec 2009
Location: Bucharest, Romania
Status: 54.84

Re: MinGW

Postby nomemory » 08 Dec 2011, 00:21

Confirm, nici o eroare la compilare cu gcc 4.5.2.
0,0p / 0 votes
User avatar
nomemory
Bit
 
Joined: 24 Aug 2011
Location: Bucuresti
Status: 2

Re: MinGW

Postby just me » 08 Dec 2011, 00:27

In Code Blocks dadea erori, nu in MinGW sau Visual
0,0p / 0 votes
" Being happy doesn't mean that everything is perfect. It means that you've decided to look beyond the imperfections "
User avatar
just me
Bit
 
Joined: 30 Dec 2009
Location: Cluj
Status: 3

Re: MinGW

Postby nomemory » 08 Dec 2011, 00:44

Pai Code::Blocks nu e un compilator... nu iti dea Code::Blocks erorile.
0,0p / 0 votes
User avatar
nomemory
Bit
 
Joined: 24 Aug 2011
Location: Bucuresti
Status: 2

Re: MinGW

Postby Cosmin_NTG » 09 Dec 2011, 11:41

MinGW Developer Studio nu te lasa sa compilezi pentru ca Debugger-ul e pornit atunci cand scrii codul. Dupa ce ai terminat de scris codul, tasteaza CTRL+F5 (asta pentru a opri debugger-ul) si apoi CTRL+F7 pentru a compila. Pentru executie se tasteaza CTRL+F10.
0,0p / 0 votes
Thinking about solutions is better than thinking about problems
User avatar
Cosmin_NTG
Byte
 
Joined: 11 Jan 2011
Location: 192.2L1.44G
Status: 10


Return to C / C++

Who is online

Users browsing this forum: No registered users and 0 guests