<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.next.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Zabzonk</id>
	<title>Code::Blocks - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.next.codeblocks.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Zabzonk"/>
	<link rel="alternate" type="text/html" href="https://wiki.next.codeblocks.org/index.php?title=Special:Contributions/Zabzonk"/>
	<updated>2026-10-18T21:22:00Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.45.3</generator>
	<entry>
		<id>https://wiki.next.codeblocks.org/index.php?title=FAQ-Compiling_(errors)&amp;diff=7053</id>
		<title>FAQ-Compiling (errors)</title>
		<link rel="alternate" type="text/html" href="https://wiki.next.codeblocks.org/index.php?title=FAQ-Compiling_(errors)&amp;diff=7053"/>
		<updated>2011-12-08T21:53:13Z</updated>

		<summary type="html">&lt;p&gt;Zabzonk: /* Q: My simple C++ program throws up lots of errors - what&amp;#039;s going on? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Code::Blocks Documentation]]&lt;br /&gt;
__TOC__&lt;br /&gt;
Return to &#039;&#039;&#039;[[FAQ]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Q: My simple C++ program throws up lots of errors - what is going on? ====&lt;br /&gt;
&lt;br /&gt;
If you have a C++ program like this:&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  int main() {&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;hello world\n&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
and when you compile it you get errors like this:&lt;br /&gt;
&lt;br /&gt;
  fatal error: iostream: No such file or directory&lt;br /&gt;
&lt;br /&gt;
then you have probably given your source file a .c extension. If you do that, the GCC compiler (and others) will probably attempt to compile the file as a C program, not as C++. You should always give your C++ source files the extension .cpp to make sure the compiler handles them correctly.&lt;br /&gt;
&lt;br /&gt;
==== Q: How do I troubleshoot a compiler problem? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; I would start by turning on full Compiler logging.&lt;br /&gt;
&lt;br /&gt;
This is done by selecting the &amp;quot;Full command line&amp;quot; option Under menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler and Debugger&amp;quot; -&amp;gt; Global compiler settings -&amp;gt; [the compiler you use] -&amp;gt; &amp;quot;Other Setting&amp;quot; tab, &amp;quot;Compiler logging&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This option will make Code::Blocks output the exact commands it uses to compile your code.&lt;br /&gt;
&lt;br /&gt;
Things to remember:&lt;br /&gt;
&lt;br /&gt;
* You should review all the commands and their options;&lt;br /&gt;
* If you don&#039;t know what an option or a command does please read the documentation for the compiler/linker you&#039;re using;&lt;br /&gt;
* Look for missing commands;&lt;br /&gt;
* For every source file (&amp;lt;tt&amp;gt;.cpp&amp;lt;/tt&amp;gt;; &amp;lt;tt&amp;gt;.c&amp;lt;/tt&amp;gt;; &amp;lt;tt&amp;gt;.d&amp;lt;/tt&amp;gt;; etc) in your project, you must have at least one command in the log. This command must produce an object file (file extension &amp;lt;tt&amp;gt;.o&amp;lt;/tt&amp;gt; if using gcc/g++ and &amp;lt;tt&amp;gt;.obj&amp;lt;/tt&amp;gt; if using Visual Studio);&lt;br /&gt;
* Every object file should be linked in the final executable, if not there are undefined symbols errors;&lt;br /&gt;
* Remember the file extension matters: &amp;lt;tt&amp;gt;*.c&amp;lt;/tt&amp;gt; is compiled as C file, &amp;lt;tt&amp;gt;*.cpp&amp;lt;/tt&amp;gt; is compiled as C++ file. [http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html Read more]&lt;br /&gt;
&lt;br /&gt;
==== Q: I imported a MSVCToolkit project/workspace, but Code::Blocks insists on trying to use GCC. What&#039;s wrong? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; A little documentation problem ^^;. The &amp;quot;default compiler&amp;quot; is usually GCC, so when you imported it with &amp;quot;the default compiler&amp;quot;, you told it to use GCC. To fix this situation, go to &amp;quot;Project&amp;quot;, &amp;quot;Build Options&amp;quot; and select VC++ Toolkit as your compiler.&lt;br /&gt;
&lt;br /&gt;
Another possibility is to put the Microsoft compiler as the default one.  To do this, choose &#039;&#039;&#039;&#039;&#039;Settings - Compiler&#039;&#039;&#039;&#039;&#039;, choose the Microsoft compiler in the &#039;&#039;&#039;&#039;&#039;Selected Compiler&#039;&#039;&#039;&#039;&#039; section (top of dialog box) and press the &#039;&#039;&#039;&#039;&#039;Set as default&#039;&#039;&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
From now onwards, for all new projects the Microsoft compiler will be taken by default.&lt;br /&gt;
&lt;br /&gt;
==== Q: When compiling a wxWidgets project, I get several &amp;quot;variable &#039;vtable for xxxx&#039; can&#039;t be auto-imported&amp;quot;. What&#039;s wrong? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; You need to add WXUSINGDLL in &amp;quot;Project-&amp;gt;Build options-&amp;gt;Compiler #defines&amp;quot; and rebuild your project (or create a new project and use the &amp;quot;Using wxWidgets DLL&amp;quot; project option which adds &amp;quot;-DWXUSINGDLL&amp;quot; to Project-&amp;gt;Build options-&amp;gt;Other options).&lt;br /&gt;
Other errors with the same resolution are:&lt;br /&gt;
&#039;unresolved external symbol &amp;quot;char const * const wxEmptyString&amp;quot; (?wxEmptyString@@3PBDB)&#039; or similar.&lt;br /&gt;
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&#039;s fixed now.&lt;br /&gt;
&lt;br /&gt;
==== Q: I can&#039;t compile a multithreaded app with VC Toolkit! Where are the libraries? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Sorry, no fix for your problem...&lt;br /&gt;
&lt;br /&gt;
Your problem doesn&#039;t come from CodeBlocks. It exists, because the free VC toolkit (VCTK) doesn&#039;t provide all the libraries and tools which come with Visual C++ (VC) which isn&#039;t free, unfortunately.&lt;br /&gt;
&lt;br /&gt;
Try buying a full-fledged VC++, or even better, download [http://www.mingw.org/ MinGW]&lt;br /&gt;
&lt;br /&gt;
The libraries that can be obtained free of charge are:&lt;br /&gt;
&lt;br /&gt;
Paths:&lt;br /&gt;
 (VCT3) Visual C++ Toolkit 2003 - C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib&lt;br /&gt;
 (PSDK) Platform SDK - C:\Program Files\Microsoft Platform SDK\Lib&lt;br /&gt;
 (NSDK) .NET 1.1 SDK - C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib&lt;br /&gt;
&lt;br /&gt;
C runtime libs:&lt;br /&gt;
 LIBC.LIB 	Single-threaded, static link                                          (VCT3, NSDK)&lt;br /&gt;
 LIBCMT.LIB 	Multithreaded, static link                                            (VCT3, NSDK)&lt;br /&gt;
 MSVCRT.LIB 	Multithreaded, dynamic link (import library for MSVCR71.DLL)          (NSDK)&lt;br /&gt;
 LIBCD.LIB 	Single-threaded, static link (debug)                                  (VCT3, NSDK)&lt;br /&gt;
 LIBCMTD.LIB 	Multithreaded, static link (debug)                                    (NSDK)&lt;br /&gt;
 MSVCRTD.LIB 	Multithreaded, dynamic link (import library for MSVCR71D.DLL) (debug) (NSDK)&lt;br /&gt;
&lt;br /&gt;
C++ libs:&lt;br /&gt;
 LIBCP.LIB 	Single-threaded, static link                                          (VCT3, PSDK)&lt;br /&gt;
 LIBCPMT.LIB 	Multithreaded, static link                                            (VCT3)&lt;br /&gt;
 MSVCPRT.LIB 	Multithreaded, dynamic link (import library for MSVCP71.dll)          (none)&lt;br /&gt;
 LIBCPD.LIB 	Single-threaded, static link (debug)                                  (VCT3)&lt;br /&gt;
 LIBCPMTD.LIB 	Multithreaded, static link (debug)                                    (none)&lt;br /&gt;
 MSVCPRTD.LIB 	Multithreaded, dynamic link (import library for MSVCP71D.DLL) (debug) (none)&lt;br /&gt;
&lt;br /&gt;
Try setting the library linker directories to:&lt;br /&gt;
 C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib&lt;br /&gt;
 C:\Program Files\Microsoft Platform SDK\Lib&lt;br /&gt;
 C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib&lt;br /&gt;
in that order.&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
meant to work in 32-bit compatibility mode on the 64-bit processors.  Worth a try.  Otherwise, you&lt;br /&gt;
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 &amp;quot;exports.sed&amp;quot; for detailed steps.&lt;br /&gt;
&lt;br /&gt;
See also: [http://wiki.tcl.tk/2435 tclsh script to extract import .lib from (any?) DLL (MinGW)]&lt;br /&gt;
&lt;br /&gt;
See also: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp&lt;br /&gt;
&lt;br /&gt;
See also: http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit&lt;br /&gt;
&lt;br /&gt;
==== Q: I get this error when compiling: Symbol &amp;quot;isascii&amp;quot; was not found in &amp;quot;codeblocks.dll&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Make sure you didn&#039;t mix up the MSVC headers or libs with the MinGW ones.&lt;br /&gt;
&lt;br /&gt;
==== Q: My build fails with multiple &#039;&#039;undefined reference&#039;&#039; errors? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039;&lt;br /&gt;
 undefined reference to `WSACleanup@8&lt;br /&gt;
 undefined reference to `WSACleanup@0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Most of the time it is because the required library is not linked with your project. Go to &#039;&#039;Project-&amp;gt;Build options...-&amp;gt;Linker settings (tab)&#039;&#039; and add the required library or libraries.&lt;br /&gt;
&lt;br /&gt;
If the error includes a line number, it is likely that this is a problem with your code. Track down down your function declarations and implementations. Ensure they all match up, are spelled correctly, and have the correct scope resolution.&lt;br /&gt;
&lt;br /&gt;
==== Q: My build fails in the compile/link/run step with a &#039;&#039;Permission denied&#039;&#039; error? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; There are several possible causes for this:&lt;br /&gt;
&lt;br /&gt;
# The output directory does not have read/write access.&lt;br /&gt;
#* Either change control settings on the output directory, or move the project to different location.&lt;br /&gt;
# A previous instance of the executable failed to terminate properly.&lt;br /&gt;
#* Open your system&#039;s equivalent of Process/Task Manager, search the list for the name of the executable Code::Blocks is trying to output, and terminate it.&lt;br /&gt;
#* Logging off or rebooting will achieve the same effect.&lt;br /&gt;
# The executable is open.&lt;br /&gt;
#* If the executable is open in a hex-editor or actively being run, close it.&lt;br /&gt;
# Security software is interfering.&lt;br /&gt;
#* The target file is locked while an antivirus programming is scanning it; either wait a few seconds for the antivirus scan to finish, set an exception in the antivirus settings, or (temporarily) disable the antivirus program.&lt;br /&gt;
#* Firewalls with very strict settings sometimes block execution; try reducing the firewall&#039;s settings or adding an exception.&lt;br /&gt;
#* Switching security software may have left traces behind that are interfering; hunt down the remnants of the old antivirus/firewall software and remove them.&lt;br /&gt;
# The file/library cannot be found.&lt;br /&gt;
#* Double check all of the compiler and linker [[FAQ-Compiling (general)#Q: I would like to compile a project using some non-standard libraries. How can I indicate to CodeBlocks that these libraries and include files exist?|search directories]] (including any [[Global compiler variables|variables]] they may be using) are properly setup.&lt;br /&gt;
# Code::Blocks was improperly installed.&lt;br /&gt;
#* Mixing binaries from a stable release and a nightly build (or even two different nightly builds) is highly likely to cause a slew of problems; [[Installing Code::Blocks|reinstall Code::Blocks]] in an empty directory.&lt;br /&gt;
# Multiple installed compilers are interfering with each other.&lt;br /&gt;
#* If they are not required to keep, completely remove all but the most used compiler.&lt;br /&gt;
#* If several compilers are required, ensure that &#039;&#039;&#039;none&#039;&#039;&#039; of them are in the &#039;&#039;system&#039;&#039; path (this is so that Code::Blocks will be able to manage all paths).&lt;br /&gt;
#* Also, do not place any compilers in their default installation path (for example &amp;lt;tt&amp;gt;C:\MinGW&amp;lt;/tt&amp;gt;), as some compilers are hard-coded to look for headers in a default path &#039;&#039;before&#039;&#039; searching their own respective directories.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Return to &#039;&#039;&#039;[[FAQ]]&#039;&#039;&#039;.&lt;/div&gt;</summary>
		<author><name>Zabzonk</name></author>
	</entry>
	<entry>
		<id>https://wiki.next.codeblocks.org/index.php?title=FAQ&amp;diff=7052</id>
		<title>FAQ</title>
		<link rel="alternate" type="text/html" href="https://wiki.next.codeblocks.org/index.php?title=FAQ&amp;diff=7052"/>
		<updated>2011-12-08T21:52:32Z</updated>

		<summary type="html">&lt;p&gt;Zabzonk: /* Compiling (errors) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Code::Blocks Documentation]]&lt;br /&gt;
&amp;lt;!-- Editors, note that the HTML anchors are for external websites that have not updated their links; new questions added to the index can safely ignore this. --&amp;gt;&lt;br /&gt;
== [[FAQ-General|General]] ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_What_is_Code::Blocks.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-General#Q: What is Code::Blocks?|What is Code::Blocks?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_What_Code::Blocks_is_not.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-General#Q: What Code::Blocks is not?|What Code::Blocks is not?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_What_licence_is_Code::Blocks_released_under.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-General#Q: What license is Code::Blocks released under?|What license is Code::Blocks released under?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_Is_it_possible_to_integrate_the_win32-help_as_in_dev-cpp.2C_to_get_help_on_the_items_under_the_caret.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-General#Q: Is it possible to integrate the win32-help as in dev-cpp, to get help on the items under the caret?|Is it possible to integrate the win32-help as in dev-cpp, to get help on the items under the caret?]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[FAQ-Compiling (general)|Compiling (general)]] ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_What_compiler_can_I_use_with_Code::Blocks.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: What compiler can I use with Code::Blocks?|What compiler can I use with Code::Blocks?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_My_project_should_be_compiled_with_a_custom_makefile._Is_it_possible_with_Code::Blocks.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: My project should be compiled with a custom makefile. Is it possible with Code::Blocks?|My project should be compiled with a custom makefile. Is it possible with Code::Blocks?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_I_have_downloaded_MS_VC.2B.2B_Toolkit_2003_for_a_compiler._How_do_I_tell_Code::Blocks_that_it_is_my_compiler.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: I have downloaded MS VC++ Toolkit 2003 for a compiler. How do I tell Code::Blocks that it is my compiler?|I have downloaded MS VC++ Toolkit 2003 for a compiler. How do I tell Code::Blocks that it is my compiler?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_Microsoft_calls_MSVCRT.DLL_a_.22Known_DLL..22_How_do_I_know_if_I_can.2Fshould_use_it.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: Microsoft calls MSVCRT.DLL a &amp;quot;Known DLL.&amp;quot; How do I know if I can/should use it?|Microsoft calls MSVCRT.DLL a &amp;quot;Known DLL.&amp;quot; How do I know if I can/should use it?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_How_can_I_use_a_DLL_without_DEF_or_LIB_files.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: How can I use a DLL without DEF or LIB files?|How can I use a DLL without DEF or LIB files?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_Where_are_the_libraries_for_the_OpenGL.2C_Ogre3D.2C_SDL.2C_QT.2C_wxWidgets_etc._projects.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: Where are the libraries for the OpenGL, Ogre3D, SDL, QT, wxWidgets etc. projects?|Where are the libraries for the OpenGL, Ogre3D, SDL, QT, wxWidgets etc. projects?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_Is_it_possible_to_use_Visual_C.2B.2B_6.0_with_Code::Blocks.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: Is it possible to use Visual C++ 6.0 with Code::Blocks?|Is it possible to use Visual C++ 6.0 with Code::Blocks?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_I_would_like_to_compile_a_project_using_some_non-standard_libraries._How_can_I_indicate_to_CodeBlocks_that_these_libraries_and_include_files_exist.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: I would like to compile a project using some non-standard libraries. How can I indicate to CodeBlocks that these libraries and include files exist?|I would like to compile a project using some non-standard libraries. How can I indicate to CodeBlocks that these libraries and include files exist?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_How_do_I_use_both_Debug_and_Release_builds_of_wx_libraries.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: How do I use both Debug and Release builds of wx libraries?|How do I use both Debug and Release builds of wx libraries?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_How_do_I_add_version_information_to_windows_executables_and_dll.27s.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: How do I add version information to windows executables and dll&#039;s?|How do I add version information to windows executables and dll&#039;s?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_Code::Blocks_does_not_force_relink_if_the_library_is_changed.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: Code::Blocks does not force relink if the library is changed?|Code::Blocks does not force relink if the library is changed?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: How do I report a compilation problem on the forums?|How do I report a compilation problem on the forums?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_All_of_the_Build_related_options_are_grayed_out.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (general)#Q: All of the Build related options are grayed out?|All of the Build related options are grayed out?]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[FAQ-Compiling (errors)|Compiling (errors)]] ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;zod&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (errors)#Q: My simple C++ program throws up lots of errors - what is going on?|Q: My simple C++ program throws up lots of errors - what is going on?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_How_do_I_troubleshoot_a_compiler_problem.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (errors)#Q: How do I troubleshoot a compiler problem?|How do I troubleshoot a compiler problem?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_I_imported_a_MSVCToolkit_project.2Fworkspace.2C_but_Code::Blocks_insists_on_trying_to_use_GCC._What.27s_wrong.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (errors)#Q: I imported a MSVCToolkit project/workspace, but Code::Blocks insists on trying to use GCC. What&#039;s wrong?|I imported a MSVCToolkit project/workspace, but Code::Blocks insists on trying to use GCC. What&#039;s wrong?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_When_compiling_a_wxWidgets_project.2C_I_get_several_.22variable_.27vtable_for_xxxx.27_can.27t_be_auto-imported.22._What.27s_wrong.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (errors)#Q: When compiling a wxWidgets project, I get several &amp;quot;variable &#039;vtable for xxxx&#039; can&#039;t be auto-imported&amp;quot;. What&#039;s wrong?|When compiling a wxWidgets project, I get several &amp;quot;variable &#039;vtable for xxxx&#039; can&#039;t be auto-imported&amp;quot;. What&#039;s wrong?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_I_can.27t_compile_a_multithreaded_app_with_VC_Toolkit.21_Where_are_the_libraries.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (errors)#Q: I can&#039;t compile a multithreaded app with VC Toolkit! Where are the libraries?|I can&#039;t compile a multithreaded app with VC Toolkit! Where are the libraries?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_I_get_this_error_when_compiling:_Symbol_.22isascii.22_was_not_found_in_.22codeblocks.dll.22&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (errors)#Q: I get this error when compiling: Symbol &amp;quot;isascii&amp;quot; was not found in &amp;quot;codeblocks.dll&amp;quot;|I get this error when compiling: Symbol &amp;quot;isascii&amp;quot; was not found in &amp;quot;codeblocks.dll&amp;quot;]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_My_build_fails_with_multiple_undefined_reference_errors.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (errors)#Q: My build fails with multiple undefined reference errors?|My build fails with multiple &#039;&#039;undefined reference&#039;&#039; errors?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_My_build_fails_in_the_compile.2Flink.2Frun_step_with_a_Permission_denied_error.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Compiling (errors)#Q: My build fails in the compile/link/run step with a Permission denied error?|My build fails in the compile/link/run step with a &#039;&#039;Permission denied&#039;&#039; error?]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[FAQ-Settings|Settings]] ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;#Q:_How_do_I_get_Code_Completion_to_work.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Settings#Q: How do I get Code Completion to work?|How do I get Code Completion to work?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;#Q:_How_do_I_make_Code::Blocks_portable.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Settings#Q: How do I make Code::Blocks portable?|How do I make Code::Blocks portable?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;#Q:_Code::Blocks_option_xyz_is_missing.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Settings#Q: Code::Blocks option xyz is missing?|Code::Blocks option &#039;&#039;xyz&#039;&#039; is missing?]]&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
== [[FAQ-Issues and Workarounds|Issues and Workarounds]] ==&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_Sometime.2C_in_the_text_editor.2C_space_bar_triggers_Code_Completion.2C_how_do_I_fix_that.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Issues and Workarounds#Q: Sometime, in the text editor, space bar triggers Code Completion, how do I fix that?|Sometime, in the text editor, space bar triggers Code Completion, how do I fix that?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_IDE_is_drawing_the_text_from_Right_to_Left.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Issues and Workarounds#Q: IDE is drawing the text from Right to Left?|IDE is drawing the text from Right to Left?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_All_the_options_in_the_debug_menu_are_grayed_out.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Issues and Workarounds#Q: All the options in the debug menu are grayed out?|All the options in the debug menu are grayed out?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_My_project_works_everywhere_except_one_computer.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Issues and Workarounds#Q: My project works everywhere except one computer?|My project works everywhere except one computer?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_Syntax_highlighting_is_broken.3B_how_do_I_fix_it.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Issues and Workarounds#Q: Syntax highlighting is broken; how do I fix it?|Syntax highlighting is broken; how do I fix it?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_I_posted_on_the_forums_that_Code::Blocks_was_not_working.2C_but_no_one_could_help_me.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Issues and Workarounds#Q: I posted on the forums that Code::Blocks was not working, but no one could help me?|I posted on the forums that Code::Blocks was not working, but no one could help me?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_I_cannot_find_any_text_in_my_Code::Blocks_logs.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Issues and Workarounds#Q: I cannot find any text in my Code::Blocks logs?|I cannot find any text in my Code::Blocks logs?]]&#039;&#039;&#039;&lt;br /&gt;
* &amp;lt;span id=&amp;quot;Q:_Scrolling_causes_gray_areas.2Fdistortions_to_obscure_my_code_in_the_editor.3F&amp;quot;&amp;gt;&amp;lt;/span&amp;gt;&#039;&#039;&#039;[[FAQ-Issues and Workarounds#Q: Scrolling causes gray areas/distortions to obscure my code in the editor?|Scrolling causes gray areas/distortions to obscure my code in the editor?]]&#039;&#039;&#039;&lt;/div&gt;</summary>
		<author><name>Zabzonk</name></author>
	</entry>
	<entry>
		<id>https://wiki.next.codeblocks.org/index.php?title=FAQ-Compiling_(errors)&amp;diff=7051</id>
		<title>FAQ-Compiling (errors)</title>
		<link rel="alternate" type="text/html" href="https://wiki.next.codeblocks.org/index.php?title=FAQ-Compiling_(errors)&amp;diff=7051"/>
		<updated>2011-12-08T21:27:49Z</updated>

		<summary type="html">&lt;p&gt;Zabzonk: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:Code::Blocks Documentation]]&lt;br /&gt;
__TOC__&lt;br /&gt;
Return to &#039;&#039;&#039;[[FAQ]]&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
==== Q: My simple C++ program throws up lots of errors - what&#039;s going on? ====&lt;br /&gt;
&lt;br /&gt;
If you have a C++ program like this:&lt;br /&gt;
&lt;br /&gt;
  #include &amp;lt;iostream&amp;gt;&lt;br /&gt;
  int main() {&lt;br /&gt;
    std::cout &amp;lt;&amp;lt; &amp;quot;hello world\n&amp;quot;;&lt;br /&gt;
  }&lt;br /&gt;
&lt;br /&gt;
and when you compile it you get errors like this:&lt;br /&gt;
&lt;br /&gt;
  fatal error: iostream: No such file or directory&lt;br /&gt;
&lt;br /&gt;
then you have probably given your source file a .c extension. If you do that, the GCC compiler (and others) will probably attempt to compile the file as a C program, not as C++. You should always give your C++ source files the extension .cpp to make sure the compiler handles them correctly.&lt;br /&gt;
&lt;br /&gt;
==== Q: How do I troubleshoot a compiler problem? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; I would start by turning on full Compiler logging.&lt;br /&gt;
&lt;br /&gt;
This is done by selecting the &amp;quot;Full command line&amp;quot; option Under menu &amp;quot;Settings&amp;quot; -&amp;gt; &amp;quot;Compiler and Debugger&amp;quot; -&amp;gt; Global compiler settings -&amp;gt; [the compiler you use] -&amp;gt; &amp;quot;Other Setting&amp;quot; tab, &amp;quot;Compiler logging&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
This option will make Code::Blocks output the exact commands it uses to compile your code.&lt;br /&gt;
&lt;br /&gt;
Things to remember:&lt;br /&gt;
&lt;br /&gt;
* You should review all the commands and their options;&lt;br /&gt;
* If you don&#039;t know what an option or a command does please read the documentation for the compiler/linker you&#039;re using;&lt;br /&gt;
* Look for missing commands;&lt;br /&gt;
* For every source file (&amp;lt;tt&amp;gt;.cpp&amp;lt;/tt&amp;gt;; &amp;lt;tt&amp;gt;.c&amp;lt;/tt&amp;gt;; &amp;lt;tt&amp;gt;.d&amp;lt;/tt&amp;gt;; etc) in your project, you must have at least one command in the log. This command must produce an object file (file extension &amp;lt;tt&amp;gt;.o&amp;lt;/tt&amp;gt; if using gcc/g++ and &amp;lt;tt&amp;gt;.obj&amp;lt;/tt&amp;gt; if using Visual Studio);&lt;br /&gt;
* Every object file should be linked in the final executable, if not there are undefined symbols errors;&lt;br /&gt;
* Remember the file extension matters: &amp;lt;tt&amp;gt;*.c&amp;lt;/tt&amp;gt; is compiled as C file, &amp;lt;tt&amp;gt;*.cpp&amp;lt;/tt&amp;gt; is compiled as C++ file. [http://www.parashift.com/c++-faq-lite/mixing-c-and-cpp.html Read more]&lt;br /&gt;
&lt;br /&gt;
==== Q: I imported a MSVCToolkit project/workspace, but Code::Blocks insists on trying to use GCC. What&#039;s wrong? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; A little documentation problem ^^;. The &amp;quot;default compiler&amp;quot; is usually GCC, so when you imported it with &amp;quot;the default compiler&amp;quot;, you told it to use GCC. To fix this situation, go to &amp;quot;Project&amp;quot;, &amp;quot;Build Options&amp;quot; and select VC++ Toolkit as your compiler.&lt;br /&gt;
&lt;br /&gt;
Another possibility is to put the Microsoft compiler as the default one.  To do this, choose &#039;&#039;&#039;&#039;&#039;Settings - Compiler&#039;&#039;&#039;&#039;&#039;, choose the Microsoft compiler in the &#039;&#039;&#039;&#039;&#039;Selected Compiler&#039;&#039;&#039;&#039;&#039; section (top of dialog box) and press the &#039;&#039;&#039;&#039;&#039;Set as default&#039;&#039;&#039;&#039;&#039; button.&lt;br /&gt;
&lt;br /&gt;
From now onwards, for all new projects the Microsoft compiler will be taken by default.&lt;br /&gt;
&lt;br /&gt;
==== Q: When compiling a wxWidgets project, I get several &amp;quot;variable &#039;vtable for xxxx&#039; can&#039;t be auto-imported&amp;quot;. What&#039;s wrong? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; You need to add WXUSINGDLL in &amp;quot;Project-&amp;gt;Build options-&amp;gt;Compiler #defines&amp;quot; and rebuild your project (or create a new project and use the &amp;quot;Using wxWidgets DLL&amp;quot; project option which adds &amp;quot;-DWXUSINGDLL&amp;quot; to Project-&amp;gt;Build options-&amp;gt;Other options).&lt;br /&gt;
Other errors with the same resolution are:&lt;br /&gt;
&#039;unresolved external symbol &amp;quot;char const * const wxEmptyString&amp;quot; (?wxEmptyString@@3PBDB)&#039; or similar.&lt;br /&gt;
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&#039;s fixed now.&lt;br /&gt;
&lt;br /&gt;
==== Q: I can&#039;t compile a multithreaded app with VC Toolkit! Where are the libraries? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Sorry, no fix for your problem...&lt;br /&gt;
&lt;br /&gt;
Your problem doesn&#039;t come from CodeBlocks. It exists, because the free VC toolkit (VCTK) doesn&#039;t provide all the libraries and tools which come with Visual C++ (VC) which isn&#039;t free, unfortunately.&lt;br /&gt;
&lt;br /&gt;
Try buying a full-fledged VC++, or even better, download [http://www.mingw.org/ MinGW]&lt;br /&gt;
&lt;br /&gt;
The libraries that can be obtained free of charge are:&lt;br /&gt;
&lt;br /&gt;
Paths:&lt;br /&gt;
 (VCT3) Visual C++ Toolkit 2003 - C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib&lt;br /&gt;
 (PSDK) Platform SDK - C:\Program Files\Microsoft Platform SDK\Lib&lt;br /&gt;
 (NSDK) .NET 1.1 SDK - C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib&lt;br /&gt;
&lt;br /&gt;
C runtime libs:&lt;br /&gt;
 LIBC.LIB 	Single-threaded, static link                                          (VCT3, NSDK)&lt;br /&gt;
 LIBCMT.LIB 	Multithreaded, static link                                            (VCT3, NSDK)&lt;br /&gt;
 MSVCRT.LIB 	Multithreaded, dynamic link (import library for MSVCR71.DLL)          (NSDK)&lt;br /&gt;
 LIBCD.LIB 	Single-threaded, static link (debug)                                  (VCT3, NSDK)&lt;br /&gt;
 LIBCMTD.LIB 	Multithreaded, static link (debug)                                    (NSDK)&lt;br /&gt;
 MSVCRTD.LIB 	Multithreaded, dynamic link (import library for MSVCR71D.DLL) (debug) (NSDK)&lt;br /&gt;
&lt;br /&gt;
C++ libs:&lt;br /&gt;
 LIBCP.LIB 	Single-threaded, static link                                          (VCT3, PSDK)&lt;br /&gt;
 LIBCPMT.LIB 	Multithreaded, static link                                            (VCT3)&lt;br /&gt;
 MSVCPRT.LIB 	Multithreaded, dynamic link (import library for MSVCP71.dll)          (none)&lt;br /&gt;
 LIBCPD.LIB 	Single-threaded, static link (debug)                                  (VCT3)&lt;br /&gt;
 LIBCPMTD.LIB 	Multithreaded, static link (debug)                                    (none)&lt;br /&gt;
 MSVCPRTD.LIB 	Multithreaded, dynamic link (import library for MSVCP71D.DLL) (debug) (none)&lt;br /&gt;
&lt;br /&gt;
Try setting the library linker directories to:&lt;br /&gt;
 C:\Program Files\Microsoft Visual C++ Toolkit 2003\lib&lt;br /&gt;
 C:\Program Files\Microsoft Platform SDK\Lib&lt;br /&gt;
 C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\lib&lt;br /&gt;
in that order.&lt;br /&gt;
&lt;br /&gt;
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&lt;br /&gt;
meant to work in 32-bit compatibility mode on the 64-bit processors.  Worth a try.  Otherwise, you&lt;br /&gt;
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 &amp;quot;exports.sed&amp;quot; for detailed steps.&lt;br /&gt;
&lt;br /&gt;
See also: [http://wiki.tcl.tk/2435 tclsh script to extract import .lib from (any?) DLL (MinGW)]&lt;br /&gt;
&lt;br /&gt;
See also: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt_c_run.2d.time_libraries.asp&lt;br /&gt;
&lt;br /&gt;
See also: http://sapdb.2scale.net/moin.cgi/MS_20C_2b_2b_20Toolkit&lt;br /&gt;
&lt;br /&gt;
==== Q: I get this error when compiling: Symbol &amp;quot;isascii&amp;quot; was not found in &amp;quot;codeblocks.dll&amp;quot; ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Make sure you didn&#039;t mix up the MSVC headers or libs with the MinGW ones.&lt;br /&gt;
&lt;br /&gt;
==== Q: My build fails with multiple &#039;&#039;undefined reference&#039;&#039; errors? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;Example:&#039;&#039;&lt;br /&gt;
 undefined reference to `WSACleanup@8&lt;br /&gt;
 undefined reference to `WSACleanup@0&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; Most of the time it is because the required library is not linked with your project. Go to &#039;&#039;Project-&amp;gt;Build options...-&amp;gt;Linker settings (tab)&#039;&#039; and add the required library or libraries.&lt;br /&gt;
&lt;br /&gt;
If the error includes a line number, it is likely that this is a problem with your code. Track down down your function declarations and implementations. Ensure they all match up, are spelled correctly, and have the correct scope resolution.&lt;br /&gt;
&lt;br /&gt;
==== Q: My build fails in the compile/link/run step with a &#039;&#039;Permission denied&#039;&#039; error? ====&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;A:&#039;&#039;&#039; There are several possible causes for this:&lt;br /&gt;
&lt;br /&gt;
# The output directory does not have read/write access.&lt;br /&gt;
#* Either change control settings on the output directory, or move the project to different location.&lt;br /&gt;
# A previous instance of the executable failed to terminate properly.&lt;br /&gt;
#* Open your system&#039;s equivalent of Process/Task Manager, search the list for the name of the executable Code::Blocks is trying to output, and terminate it.&lt;br /&gt;
#* Logging off or rebooting will achieve the same effect.&lt;br /&gt;
# The executable is open.&lt;br /&gt;
#* If the executable is open in a hex-editor or actively being run, close it.&lt;br /&gt;
# Security software is interfering.&lt;br /&gt;
#* The target file is locked while an antivirus programming is scanning it; either wait a few seconds for the antivirus scan to finish, set an exception in the antivirus settings, or (temporarily) disable the antivirus program.&lt;br /&gt;
#* Firewalls with very strict settings sometimes block execution; try reducing the firewall&#039;s settings or adding an exception.&lt;br /&gt;
#* Switching security software may have left traces behind that are interfering; hunt down the remnants of the old antivirus/firewall software and remove them.&lt;br /&gt;
# The file/library cannot be found.&lt;br /&gt;
#* Double check all of the compiler and linker [[FAQ-Compiling (general)#Q: I would like to compile a project using some non-standard libraries. How can I indicate to CodeBlocks that these libraries and include files exist?|search directories]] (including any [[Global compiler variables|variables]] they may be using) are properly setup.&lt;br /&gt;
# Code::Blocks was improperly installed.&lt;br /&gt;
#* Mixing binaries from a stable release and a nightly build (or even two different nightly builds) is highly likely to cause a slew of problems; [[Installing Code::Blocks|reinstall Code::Blocks]] in an empty directory.&lt;br /&gt;
# Multiple installed compilers are interfering with each other.&lt;br /&gt;
#* If they are not required to keep, completely remove all but the most used compiler.&lt;br /&gt;
#* If several compilers are required, ensure that &#039;&#039;&#039;none&#039;&#039;&#039; of them are in the &#039;&#039;system&#039;&#039; path (this is so that Code::Blocks will be able to manage all paths).&lt;br /&gt;
#* Also, do not place any compilers in their default installation path (for example &amp;lt;tt&amp;gt;C:\MinGW&amp;lt;/tt&amp;gt;), as some compilers are hard-coded to look for headers in a default path &#039;&#039;before&#039;&#039; searching their own respective directories.&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Return to &#039;&#039;&#039;[[FAQ]]&#039;&#039;&#039;.&lt;/div&gt;</summary>
		<author><name>Zabzonk</name></author>
	</entry>
</feed>