PDA

View Full Version : Errore Code::Blocks(c++)


Gino+89+
30-11-2007, 15:33
Ciao a tutti,
Ho appena installato code blocks su windows xp SP2, la versione di code blocks è la 1.0 rc2...
Come compilatore di default uso il gnu gcc compiler, il problema è che quando compilo mi da il seguente errore:

mingw32-g++.exe: installation problem, cannot exec `cc1plus': No such file or directory

Come posso fare?
Ho visto che quel file nel mio pc è in:
\CodeBlocks\libexec\gcc\mingw32\3.4.4

...quindi effettivamente c'è, ma non so dove posso spostarlo per far funzionare il tutto (sempre se devo spostarlo)...perchè poi col Dev-c++ uso lo stesso compilatore e funziona..

Ringrazio chiunque mi aiuti!
Saluti

variabilepippo
30-11-2007, 15:43
sempre se devo spostarlo


Stai usando la nightly build più recente (http://forums.codeblocks.org/index.php?board=20.0) (28 novembre 2007) di Code::Blocks o la vecchia 1.0RC2?

Code::Blocks supporta numerosi compilatori però in alcuni casi bisogna impostare a mano i percorsi, accedi alle impostazioni con Settings->Compiler and Debugger->GNU GCC e aggiungi i percorsi mancanti nel tab Search Directories (sezione Compiler). Per scrupolo controlla che anche tutti gli altri percorsi siano corretti.

Gino+89+
30-11-2007, 16:29
Stai usando la nightly build più recente (http://forums.codeblocks.org/index.php?board=20.0) (28 novembre 2007) di Code::Blocks o la vecchia 1.0RC2?


Ho scaricato questa:
Code::Blocks IDE, with MINGW compiler
Filesize: 13,597,181 Bytes | Version: 1.0rc2
MD5 Hash: 7638bdd4fd087b3168be4f0f968d1f3c
Cioè la vecchia se non erro...


Code::Blocks supporta numerosi compilatori però in alcuni casi bisogna impostare a mano i percorsi, accedi alle impostazioni con Settings->Compiler and Debugger->GNU GCC e aggiungi i percorsi mancanti nel tab Search Directories (sezione Compiler). Per scrupolo controlla che anche tutti gli altri percorsi siano corretti.


Io ho Settings->Compiler Settings e poi sul tab Search che mi si apre c'è:

directories:
..\CodeBlocks\include (di default)

linker:
..\CodeBlocks\lib (di default)

ma quì penso sia giusto...
Ho provato poi a copiare quel file nella cartella bin di CodeBlocks ma quando compilo mi da una sfilza di errori:

Compiling: C:\Documents and Settings\GinoCappelli\Desktop\Untitled1.cpp
In file included from D:/CodeBlocks/include/stddef.h:6,
from D:/CodeBlocks/include/locale.h:40,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/clocale:49,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/mingw32/bits/c++locale.h:41,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iosfwd:46,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ios:44,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ostream:45,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iostream:45,
from C:\Documents and Settings\GinoCappelli\Desktop\Untitled1.cpp:1:
D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stddef.h:6:24: no include path in which to search for stddef.h
In file included from D:/CodeBlocks/include/stddef.h:6,
from D:/CodeBlocks/include/locale.h:76,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/clocale:49,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/mingw32/bits/c++locale.h:41,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iosfwd:46,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ios:44,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ostream:45,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iostream:45,
from C:\Documents and Settings\GinoCappelli\Desktop\Untitled1.cpp:1:
D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stddef.h:6:24: no include path in which to search for stddef.h
In file included from D:/CodeBlocks/include/stddef.h:6,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/cstddef:48,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/cstring:49,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/mingw32/bits/c++locale.h:42,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iosfwd:46,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ios:44,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ostream:45,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iostream:45,
from C:\Documents and Settings\GinoCappelli\Desktop\Untitled1.cpp:1:
D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stddef.h:6:24: no include path in which to search for stddef.h
In file included from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/cstring:49,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/mingw32/bits/c++locale.h:42,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iosfwd:46,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ios:44,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ostream:45,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iostream:45,
from C:\Documents and Settings\GinoCappelli\Desktop\Untitled1.cpp:1:
D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/cstddef:52: error: `::ptrdiff_t' has not been declared
D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/cstddef:53: error: `::size_t' has not been declared
In file included from D:/CodeBlocks/include/stddef.h:6,
from D:/CodeBlocks/include/string.h:24,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/cstring:51,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/mingw32/bits/c++locale.h:42,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iosfwd:46,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ios:44,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ostream:45,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iostream:45,
from C:\Documents and Settings\GinoCappelli\Desktop\Untitled1.cpp:1:
D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/stddef.h:6:24: no include path in which to search for stddef.h
In file included from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/cstring:51,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/mingw32/bits/c++locale.h:42,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iosfwd:46,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ios:44,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/ostream:45,
from D:/CodeBlocks/bin/../lib/gcc/mingw32/3.4.2/../../../../include/c++/3.4.4/iostream:45,
from C:\Documents and Settings\GinoCappelli\Desktop\Untitled1.cpp:1:
D:/CodeBlocks/include/string.h:36: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:37: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:38: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:39: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:40: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:46: error: expected constructor, destructor, or type conversion before "strcspn"
D:/CodeBlocks/include/string.h:46: error: expected `,' or `;' before "strcspn"
D:/CodeBlocks/include/string.h:49: error: expected constructor, destructor, or type conversion before "strlen"
D:/CodeBlocks/include/string.h:49: error: expected `,' or `;' before "strlen"
D:/CodeBlocks/include/string.h:50: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:51: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:52: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:55: error: expected constructor, destructor, or type conversion before "strspn"
D:/CodeBlocks/include/string.h:55: error: expected `,' or `;' before "strspn"
D:/CodeBlocks/include/string.h:58: error: expected constructor, destructor, or type conversion before "strxfrm"
D:/CodeBlocks/include/string.h:58: error: expected `,' or `;' before "strxfrm"
D:/CodeBlocks/include/string.h:65: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:66: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:72: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:73: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:77: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:80: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:81: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:90: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:91: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:100: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:102: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:104: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:109: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:125: error: expected constructor, destructor, or type conversion before "wcscspn"
D:/CodeBlocks/include/string.h:125: error: expected `,' or `;' before "wcscspn"
D:/CodeBlocks/include/string.h:127: error: expected constructor, destructor, or type conversion before "wcslen"
D:/CodeBlocks/include/string.h:127: error: expected `,' or `;' before "wcslen"
D:/CodeBlocks/include/string.h:128: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:129: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:130: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:133: error: expected constructor, destructor, or type conversion before "wcsspn"
D:/CodeBlocks/include/string.h:133: error: expected `,' or `;' before "wcsspn"
D:/CodeBlocks/include/string.h:136: error: expected constructor, destructor, or type conversion before "wcsxfrm"
D:/CodeBlocks/include/string.h:136: error: expected `,' or `;' before "wcsxfrm"
D:/CodeBlocks/include/string.h:150: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:151: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:157: error: `size_t' has not been declared
D:/CodeBlocks/include/string.h:158: error: `size_t' has not been declared
Process terminated with status 1 (0 minutes, 9 seconds)

variabilepippo
30-11-2007, 16:45
Cioè la vecchia se non erro...


Inizia con il disinstallare la vecchia versione ed il compilatore MinGW che ormai hai sputtanato copiando files a destra e a manca, poi:

1) Scarica la nightly build + recente e decomprimila insieme agli altri file con estensione .7z in una cartella

2) Reinstalla MinGW (ti consiglio la versione TechPreview 4.2.1)

3) Aggiungi la cartella incriminata alla lista delle cartelle di Code::Blocks

Ti garantisco che funziona alla perfezione! :sofico:

Gino+89+
02-12-2007, 16:27
Ok grazie mille sono riuscito ad installare tutto, MinWC compreso...
Poi ho scaricato le wxWidgets dal sito le ho copiate nella directory di codeBloks e ho cercato di impostare i collegamenti come riuscivo...
Alla fine il compilatore non da problemi, ma quando linka fa un macello:

Compiling: main.cpp
Compiling: connection.cpp
C:\Documents and Settings\GinoCappelli\Desktop\test2\test2\connection.cpp: In member function `int MyConnection::toInteger(wxString)':
C:\Documents and Settings\GinoCappelli\Desktop\test2\test2\connection.cpp:66: warning: comparison between signed and unsigned integer expressions
Linking console executable: bin\Release\test2.exe
obj\Release\main.o:main.cpp:(.text+0x4f): undefined reference to `wxAppConsole::CheckBuildOptions(char const*, char const*)'
obj\Release\main.o:main.cpp:(.text+0x70): undefined reference to `wxApp::wxApp()'
obj\Release\main.o:main.cpp:(.text+0xc0): undefined reference to `wxAppConsole::ms_appInstance'

obj\Release\main.o:main.cpp:(.text+0x14b): undefined reference to `wxStringBase::InitWith(char const*, unsigned int, unsigned int)'
obj\Release\main.o:main.cpp:(.text+0x23b): undefined reference to `wxAppConsole::ms_appInitFn'
obj\Release\main.o:main.cpp:(.rdata$_ZTV20wxThreadHelperThread[__ZTV20wxThreadHelperThread]+0xc): undefined reference to `wxThread::TestDestroy()'
obj\Release\main.o:main.cpp:(.rdata$_ZTV7MainApp[__ZTV7MainApp]+0x8): undefined reference to `wxApp::GetClassInfo() const'
obj\Release\main.o:main.cpp:(.rdata$_ZTV7MainApp[__ZTV7MainApp]+0x14): undefined reference to `wxObject::CreateRefData() const'
obj\Release\main.o:main.cpp:(.rdata$_ZTV7MainApp[__ZTV7MainApp]+0x18): undefined reference to `wxObject::CloneRefData(wxObjectRefData const*) const'
obj\Release\main.o:main.cpp:(.rdata$_ZTV7MainApp[__ZTV7MainApp]+0x1c): undefined reference to `wxEvtHandler::ProcessEvent(wxEvent&)'
obj\Release\main.o:main.cpp:(.rdata$_ZTV7MainApp[__ZTV7MainApp]+0x20): undefined reference to `wxEvtHandler::SearchEventTable(wxEventTable&, wxEvent&)'
obj\Release\main.o:main.cpp:(.rdata$_ZTV7MainApp[__ZTV7MainApp]+0x28): undefined reference to `wxEvtHandler::TryParent(wxEvent&)'
obj\Release\main.o:main.cpp:(.rdata$_ZTV7MainApp[__ZTV7MainApp]+0x2c): undefined reference to `wxApp::GetEventTable() const'
obj\Release\main.o:main.cpp:(.rdata$_ZTV7MainApp[__ZTV7MainApp]+0x30): undefined reference to `wxApp::GetEventHashTable() const'

....etc..etc...

obj\Release\main.o:main.cpp:(.text$_ZN20wxThreadHelperThreadD0Ev[__ZN20wxThreadHelperThreadD0Ev]+0x14): undefined reference to `wxThread::~wxThread()'
obj\Release\main.o:main.cpp:(.text$_ZN7MainAppD1Ev[__ZN7MainAppD1Ev]+0x13): undefined reference to `wxApp::~wxApp()'
Process terminated with status 1 (0 minutes, 22 seconds)
50 errors, 1 warnings

Ho cercato di aggiungere varie cartelle a search Directories->Linker ma non funzionava comunque, che devo fare?

-Slash
02-12-2007, 19:24
a me code::blocks (nightly build) da questo errore su windows, facendo un progetto wxwidgets:

Linking executable: bin\Release\winprova.exe
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw28_core
collect2: ld returned 1 exit status


su linux funziona perfettamente... soluzioni?

Gino+89+
02-12-2007, 20:41
Si avevo anche io quell'errore ieri, l'ho risolto ma non mi ricordo come (ormai penso di averli passati tutti gli errori di quell'IDE :D )

Ok alla fine non so come (spstando file di quà e di la, aggiungendo percoso e spuntando opzione di quà e di là) mi compila tutto, anche i progetti wxWdgets...

Tutto ok, qundo generà l'eseguibile funziona...ma solo copiando il file wxmsw28u_gcc.dll in system32 o nella cartella dove si trova l'eseguibile....perchè??

variabilepippo
03-12-2007, 10:46
ma solo copiando il file wxmsw28u_gcc.dll in system32 o nella cartella dove si trova l'eseguibile....perchè??


Mi sembra normale, se non compili in maniera statica i riferimenti deve andarli a pescare da una libreria dinamica (DLL)...

-Slash
03-12-2007, 20:24
a me code::blocks (nightly build) da questo errore su windows, facendo un progetto wxwidgets:

Linking executable: bin\Release\winprova.exe
C:\MinGW\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -lwxmsw28_core
collect2: ld returned 1 exit status


su linux funziona perfettamente... soluzioni?
nessuna soluzione per questo?