Difference between revisions of "FAQ"

From CodeBlocks
Jump to: navigation, search
(Legacy question removed)
Line 1: Line 1:
= General =
+
== General ==
  
== Is it possible to integrate the win32-help as in dev-cpp, to get help on the items under the caret? ==
+
=== Q: Is it possible to integrate the win32-help as in dev-cpp, to get help on the items under the caret? ===
  
Integration of the win32 API helpfile should be a no-brainer. Someone could just write a really simple plugin and, upon invocation (through a shortcut possibly), look at the word under the cursor and invoke windows help... If you think you 're up to the task, I can help you with all the info you need. If not, I could write it myself but no promises on a release date ;)
+
'''A:''' Integration of the win32 API helpfile should be a no-brainer. Someone could just write a really simple plugin and, upon invocation (through a shortcut possibly), look at the word under the cursor and invoke windows help... If you think you 're up to the task, I can help you with all the info you need. If not, I could write it myself but no promises on a release date ;)
  
== What licence is Code::Blocks released under? ==
+
=== Q: What licence is Code::Blocks released under? ===
  
GNU General Public License 2 ([http://www.gnu.org/licenses/gpl.txt GPL])
+
'''A:''' GNU General Public License 2 ([http://www.gnu.org/licenses/gpl.txt GPL])
  
= Compiling =
+
== Compiling ==
  
== What compiler can I use with Code::Blocks? ==
+
=== Q: What compiler can I use with Code::Blocks? ===
  
Code::Blocks philosophy is to be able to use any compiler on earth! Well, almost.
+
'''A:''' Code::Blocks philosophy is to be able to use any compiler on earth! Well, almost.
  
 
As a matter of fact it largely depends on the used compiler plugin. The one provided with the default Code::Blocks installation, supports GNU GCC (MinGW/Cygwin), MS Visual C++ Free Toolkit 2003, Borland's C++ Compiler 5.5, DigitalMars Free Compiler., OpenWatcom and Small Device C Compiler (SDCC).
 
As a matter of fact it largely depends on the used compiler plugin. The one provided with the default Code::Blocks installation, supports GNU GCC (MinGW/Cygwin), MS Visual C++ Free Toolkit 2003, Borland's C++ Compiler 5.5, DigitalMars Free Compiler., OpenWatcom and Small Device C Compiler (SDCC).
  
== I imported a MSVCToolkit project/workspace, but Code::Blocks insists on trying to use GCC. What's wrong? ==
+
=== Q: I imported a MSVCToolkit project/workspace, but Code::Blocks insists on trying to use GCC. What's wrong? ===
  
A little documentation problem ^^;. The "default compiler" is usually GCC, so when you imported it with "the default compiler", you told it to use GCC. To fix this situation, go to "Project", "Build Options" and select VC++ Toolkit as your compiler.
+
'''A:''' A little documentation problem ^^;. The "default compiler" is usually GCC, so when you imported it with "the default compiler", you told it to use GCC. To fix this situation, go to "Project", "Build Options" and select VC++ Toolkit as your compiler.
  
Another possibility is to put the M$ compiler as the default one.  To do this, choose '''''Settings - Compiler''''', choose the M$ compiler in the '''''Selected Compiler''''' section (top of dialog box) and press the '''''Set as default''''' button.
+
Another possibility is to put the Microsoft compiler as the default one.  To do this, choose '''''Settings - Compiler''''', choose the Microsoft compiler in the '''''Selected Compiler''''' section (top of dialog box) and press the '''''Set as default''''' button.
  
From now onwards, for all new projects the M$ compiler will be taken by default.
+
From now onwards, for all new projects the Microsoft compiler will be taken by default.
  
== I 'm using gcc compiler from an existing dev-cpp installation. How can I make it work? ==
+
=== Q: My project should be compiled with a custom makefile. Is it possible with Code::Blocks? ===
  
''As of version 1.0-beta6, if a default MinGW installation is not detected, a Dev-C++ installation is checked for and is used if detected.''
+
'''A:''' Yes, you can. You need to change two different settings:
 
+
You need to take two steps. First, set the compiler master path to the dev-cpp folder. It's under "Settings/Configure plugins/Compiler" in the "Programs" tab...
+
Second, you have to add two additional compiler (include) dirs. Go to "Settings/Configure plugins/Compiler" and in the "Compiler dirs" tab add "dev-cpp\include\c++" and "dev-cpp\include\c++\mingw32" (substituting "dev-cpp" with the actual dev-cpp installation folder).
+
 
+
== My project should be compiled with a custom makefile. Is it possible with Code::Blocks? ==
+
 
+
Yes, you can. You need to change two different settings:
+
  
 
a) In "Compiler Settings", under the tab "Other", there's a setting called "Build Method". Choose "Work with makefiles".
 
a) In "Compiler Settings", under the tab "Other", there's a setting called "Build Method". Choose "Work with makefiles".
Line 42: Line 35:
 
And that's it! :)
 
And that's it! :)
  
== I have downloaded MS VC++ Toolkit 2003 for a compiler. How do I tell Code::Blocks that it is my compiler? ==
+
=== Q: I have downloaded MS VC++ Toolkit 2003 for a compiler. How do I tell Code::Blocks that it is my compiler? ===
  
Click on "Project/Build options" and select the compiler you want for your project/target.
+
'''A:''' Click on "Project/Build options" and select the compiler you want for your project/target.
  
== When compiling a wxWidgets project, I get several "variable 'vtable for xxxx' can't be auto-imported". What's wrong? ==
+
=== Q: When compiling a wxWidgets project, I get several "variable 'vtable for xxxx' can't be auto-imported". What's wrong? ===
  
You need to add WXUSINGDLL in "Project->Build options->Compiler #defines" and rebuild your project (or create a new project and use the "Using wxWidgets DLL" project option which adds "-DWXUSINGDLL" to Project->Build options->Other options).
+
'''A:''' You need to add WXUSINGDLL in "Project->Build options->Compiler #defines" and rebuild your project (or create a new project and use the "Using wxWidgets DLL" project option which adds "-DWXUSINGDLL" to Project->Build options->Other options).
 
Other errors with the same resolution are:
 
Other errors with the same resolution are:
 
'unresolved external symbol "char const * const wxEmptyString" ([email protected]@3PBDB)' or similar.
 
'unresolved external symbol "char const * const wxEmptyString" ([email protected]@3PBDB)' or similar.
 
If you were using 1.0-finalbeta and were trying to build a statically linked wxWidgets project, the cause of the problem was some faulty templates. But that's fixed now.
 
If you were using 1.0-finalbeta and were trying to build a statically linked wxWidgets project, the cause of the problem was some faulty templates. But that's fixed now.
  
== I can't compile a multithreaded app with VC Toolkit! Where are the libraries? ==
+
=== Q: I can't compile a multithreaded app with VC Toolkit! Where are the libraries? ===
  
sorry, no fix for your problem...
+
'''A:''' Sorry, no fix for your problem...
  
 
Your problem doesn't come from CodeBlocks. It exists, because the free VC toolkit (VCTK) doesn't provide all the libraries and tools which are coming with Visual C++ (VC) which isn't free, unfortunately.
 
Your problem doesn't come from CodeBlocks. It exists, because the free VC toolkit (VCTK) doesn't provide all the libraries and tools which are coming with Visual C++ (VC) which isn't free, unfortunately.
  
Try buying a full-fledged VC++, or even better, download MinGW :)
+
Try buying a full-fledged VC++, or even better, download [http://www.mingw.org/ MinGW]
  
 
The libraries that can be obtained free of charge are:
 
The libraries that can be obtained free of charge are:
Line 98: Line 91:
 
See also: http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit
 
See also: http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit
  
== Where are the libraries for the OpenGL / SDL / etc. projects? ==
+
=== Q: Where are the libraries for the OpenGL, Ogre3D, SDL, QT, wxWidgets etc. projects? ===
  
They're not bundled. The templates were provided for your convenience, but you need to download the libraries on your own.
+
'''A:''' They're not bundled. The templates were provided for your convenience, but you need to download the libraries on your own.
 
In common terms, "batteries not included" :)
 
In common terms, "batteries not included" :)
  
== Is it possible to use Visual C++ 6.0 with Code::Blocks? ==
+
=== Q: Is it possible to use Visual C++ 6.0 with Code::Blocks? ===
  
As they say in ##C++ on FreeNode:<br>
+
'''A:''' MSVC++ 6 is not a C++ compiler. It was made before the C++ standard, so it compiles some language that isn't C++. Upgrade.
cylon> msvc++6 is not a C++ compiler. It was made before the C++ standard, so it compiles some language that isn't C++. Upgrade.
+
  
== I got this error when compiling: Symbol "isascii" was not found in "codeblocks.dll" ==
+
=== Q: I got this error when compiling: Symbol "isascii" was not found in "codeblocks.dll" ===
Make sure you didn't mix up the MSVC headers or libs with the MinGW ones.
+
'''A:''' Make sure you didn't mix up the MSVC headers or libs with the MinGW ones.

Revision as of 18:37, 9 April 2006

General

Q: Is it possible to integrate the win32-help as in dev-cpp, to get help on the items under the caret?

A: Integration of the win32 API helpfile should be a no-brainer. Someone could just write a really simple plugin and, upon invocation (through a shortcut possibly), look at the word under the cursor and invoke windows help... If you think you 're up to the task, I can help you with all the info you need. If not, I could write it myself but no promises on a release date ;)

Q: What licence is Code::Blocks released under?

A: GNU General Public License 2 (GPL)

Compiling

Q: What compiler can I use with Code::Blocks?

A: Code::Blocks philosophy is to be able to use any compiler on earth! Well, almost.

As a matter of fact it largely depends on the used compiler plugin. The one provided with the default Code::Blocks installation, supports GNU GCC (MinGW/Cygwin), MS Visual C++ Free Toolkit 2003, Borland's C++ Compiler 5.5, DigitalMars Free Compiler., OpenWatcom and Small Device C Compiler (SDCC).

Q: I imported a MSVCToolkit project/workspace, but Code::Blocks insists on trying to use GCC. What's wrong?

A: A little documentation problem ^^;. The "default compiler" is usually GCC, so when you imported it with "the default compiler", you told it to use GCC. To fix this situation, go to "Project", "Build Options" and select VC++ Toolkit as your compiler.

Another possibility is to put the Microsoft compiler as the default one. To do this, choose Settings - Compiler, choose the Microsoft compiler in the Selected Compiler section (top of dialog box) and press the Set as default button.

From now onwards, for all new projects the Microsoft compiler will be taken by default.

Q: My project should be compiled with a custom makefile. Is it possible with Code::Blocks?

A: Yes, you can. You need to change two different settings:

a) In "Compiler Settings", under the tab "Other", there's a setting called "Build Method". Choose "Work with makefiles".

b) In your project's Properties, you can choose to use a makefile. Check "This is a custom makefile" (WARNING! if you forget to check, the makefile will be OVERWRITTEN!)

And that's it! :)

Q: I have downloaded MS VC++ Toolkit 2003 for a compiler. How do I tell Code::Blocks that it is my compiler?

A: Click on "Project/Build options" and select the compiler you want for your project/target.

Q: When compiling a wxWidgets project, I get several "variable 'vtable for xxxx' can't be auto-imported". What's wrong?

A: You need to add WXUSINGDLL in "Project->Build options->Compiler #defines" and rebuild your project (or create a new project and use the "Using wxWidgets DLL" project option which adds "-DWXUSINGDLL" to Project->Build options->Other options). Other errors with the same resolution are: 'unresolved external symbol "char const * const wxEmptyString" ([email protected]@3PBDB)' or similar. If you were using 1.0-finalbeta and were trying to build a statically linked wxWidgets project, the cause of the problem was some faulty templates. But that's fixed now.

Q: I can't compile a multithreaded app with VC Toolkit! Where are the libraries?

A: Sorry, no fix for your problem...

Your problem doesn't come from CodeBlocks. It exists, because the free VC toolkit (VCTK) doesn't provide all the libraries and tools which are coming with Visual C++ (VC) which isn't free, unfortunately.

Try buying a full-fledged VC++, or even better, download MinGW

The libraries that can be obtained free of charge are:

Paths:

(VCT3) Visual C++ Toolkit 2003 - C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib
(PSDK) Platform SDK - C:\Program Files\Microsoft Platform SDK\Lib
(NSDK) .NET 1.1 SDK - C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib

C runtime libs:

LIBC.LIB 	Single-threaded, static link                                          (VCT3, NSDK)
LIBCMT.LIB 	Multithreaded, static link                                            (VCT3, NSDK)
MSVCRT.LIB 	Multithreaded, dynamic link (import library for MSVCR71.DLL)          (NSDK)
LIBCD.LIB 	Single-threaded, static link (debug)                                  (VCT3, NSDK)
LIBCMTD.LIB 	Multithreaded, static link (debug)                                    (NSDK)
MSVCRTD.LIB 	Multithreaded, dynamic link (import library for MSVCR71D.DLL) (debug) (NSDK)

C++ libs:

LIBCP.LIB 	Single-threaded, static link                                          (VCT3, PSDK)
LIBCPMT.LIB 	Multithreaded, static link                                            (VCT3)
MSVCPRT.LIB 	Multithreaded, dynamic link (import library for MSVCP71.dll)          (none)
LIBCPD.LIB 	Single-threaded, static link (debug)                                  (VCT3)
LIBCPMTD.LIB 	Multithreaded, static link (debug)                                    (none)
MSVCPRTD.LIB 	Multithreaded, dynamic link (import library for MSVCP71D.DLL) (debug) (none)

Try setting the library linker directories to:

C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib
C:\Program Files\Microsoft Platform SDK\Lib
C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib

in that order.

The ones listed as (none) above are actually present in the IA64 and AMD64 subdirectories of the PSDK lib directory. Not sure if these would work on 32-bit windows, however, they may if they are meant to work in 32-bit compatibility mode on the 64-bit processors. Worth a try. Otherwise, you can link statically to the C++ library instead of using MSVCP71.dll. If you really want to link against MSVCP71.dll you can try to create MSVCP71.LIB from the dll using lib.exe and sed. Search google for "exports.sed" for detailed steps.

See also: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp

See also: http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit

Q: Where are the libraries for the OpenGL, Ogre3D, SDL, QT, wxWidgets etc. projects?

A: They're not bundled. The templates were provided for your convenience, but you need to download the libraries on your own. In common terms, "batteries not included" :)

Q: Is it possible to use Visual C++ 6.0 with Code::Blocks?

A: MSVC++ 6 is not a C++ compiler. It was made before the C++ standard, so it compiles some language that isn't C++. Upgrade.

Q: I got this error when compiling: Symbol "isascii" was not found in "codeblocks.dll"

A: Make sure you didn't mix up the MSVC headers or libs with the MinGW ones.