Index: D:/codeblocks/src/sdk/as/source/as_arrayobject.cpp
===================================================================
--- D:/codeblocks/src/sdk/as/source/as_arrayobject.cpp	(revision 2051)
+++ D:/codeblocks/src/sdk/as/source/as_arrayobject.cpp	(working copy)
@@ -33,8 +33,14 @@
 #endif
 #include <assert.h>
 #include <new>
-#include <malloc.h>
 
+#ifdef __FreeBSD__
+    #include <stdlib.h>
+#else
+    #include <malloc.h>
+#endif
+
+
 #include "as_config.h"
 #include "as_arrayobject.h"
 #include "as_scriptengine.h"
Index: D:/codeblocks/src/sdk/as/source/as_gcobject.cpp
===================================================================
--- D:/codeblocks/src/sdk/as/source/as_gcobject.cpp	(revision 2051)
+++ D:/codeblocks/src/sdk/as/source/as_gcobject.cpp	(working copy)
@@ -34,8 +34,11 @@
 #endif
 #include <assert.h>
 #include <new>
-#if defined(WIN32) || defined(HAVE_MALLOC_H)
-#include <malloc.h>
+
+#ifdef __FreeBSD__
+    #include <stdlib.h>
+#else
+    #include <malloc.h>
 #endif
 
 #include "as_config.h"
Index: D:/codeblocks/src/sdk/as/source/as_scriptengine.cpp
===================================================================
--- D:/codeblocks/src/sdk/as/source/as_scriptengine.cpp	(revision 2051)
+++ D:/codeblocks/src/sdk/as/source/as_scriptengine.cpp	(working copy)
@@ -39,8 +39,13 @@
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
-#include <malloc.h>
 
+#ifdef __FreeBSD__
+    #include <stdlib.h>
+#else
+    #include <malloc.h>
+#endif
+
 #include "as_config.h"
 #include "as_scriptengine.h"
 #include "as_builder.h"
Index: D:/codeblocks/src/sdk/configmanager.cpp
===================================================================
--- D:/codeblocks/src/sdk/configmanager.cpp	(revision 2051)
+++ D:/codeblocks/src/sdk/configmanager.cpp	(working copy)
@@ -1230,8 +1230,7 @@
     if(mNode)
     {
         while((curr = mNode->IterateChildren(curr)->ToElement()))
-            set->insert(_U(curr->FirstChild()->ToText()->Value()))
-            ;
+            set->insert(_U(curr->FirstChild()->ToText()->Value()));
     }
 }
 
Index: D:/codeblocks/src/sdk/editorbase.cpp
===================================================================
--- D:/codeblocks/src/sdk/editorbase.cpp	(revision 2051)
+++ D:/codeblocks/src/sdk/editorbase.cpp	(working copy)
@@ -317,6 +317,7 @@
         }
         m_SwitchTo.clear();
     }
+#if wxABI_VERSION >= 20601
     else if (id == idGoogle)/////////////////// TODO: UrlEncode
     {
         wxLaunchDefaultBrowser(wxString(_T("http://www.google.com/search?q=")) << URLEncode(lastWord));
@@ -325,6 +326,7 @@
     {
         wxLaunchDefaultBrowser(wxString(_T("http://search.microsoft.com/search/results.aspx?qu=")) << URLEncode(lastWord) << _T("&View=msdn"));
     }
+#endif
     else
     {
         event.Skip();
Index: D:/codeblocks/src/src/appglobals.cpp
===================================================================
--- D:/codeblocks/src/src/appglobals.cpp	(revision 2051)
+++ D:/codeblocks/src/src/appglobals.cpp	(working copy)
@@ -28,6 +28,8 @@
   const wxString g_AppPlatform = _T("OS/2");
 #elif defined(__WXMAC__)
   const wxString g_AppPlatform = _T("Mac OS X");
+#elif defined(__FreeBSD__)
+  const wxString g_AppPlatform = _T("FreeBSD");
 #elif defined(__UNIX__)
   const wxString g_AppPlatform = _T("Linux");
 #else
@@ -46,7 +48,9 @@
 
 operating_system_t __cb_get_os()
 {
-#if   defined(__UNIX__)
+#if defined(__FreeBSD__)
+    return oxFreeBSD;
+#elif defined(__UNIX__)
     return osLinux;
 #elif defined(__WXMAC__)
     return osOSX;
@@ -78,7 +82,7 @@
 }
 
 
-const wxString langs[] =
+const wxString langs[LANGUAGES_SIZE] =
 {
 	_("(System default)")
 //        ,_T("English (U.S.)")
@@ -89,7 +93,7 @@
 };
 
 // Must have the same order than the above
-const int locales[] =
+const int locales[LANGUAGES_SIZE] =
 {
 	wxLANGUAGE_DEFAULT
 //        ,wxLANGUAGE_ENGLISH_US
Index: D:/codeblocks/src/src/appglobals.h
===================================================================
--- D:/codeblocks/src/src/appglobals.h	(revision 2051)
+++ D:/codeblocks/src/src/appglobals.h	(working copy)
@@ -17,17 +17,18 @@
 extern const wxString g_DefaultBatchBuildArgs;
 
 #define LOCALIZE   true
-#define LANGUAGES  2
-//Please fix this. I have no Idea that the WXSIZEOF couldn't work whithout defining LANGUAGES
-extern const wxString langs[LANGUAGES];
-extern const int locales[LANGUAGES];
+#define LANGUAGES_SIZE  2
 
+extern const wxString langs[LANGUAGES_SIZE];
+extern const int locales[LANGUAGES_SIZE];
+
 typedef enum
 {
 osUnknownWindows,
 osWindows9598ME,
 osWindowsNT2000,
 osWindowsXP,
+oxFreeBSD,
 osLinux,
 osOS2,
 osOSX
Index: D:/codeblocks/src/src/environmentsettingsdlg.cpp
===================================================================
--- D:/codeblocks/src/src/environmentsettingsdlg.cpp	(revision 2051)
+++ D:/codeblocks/src/src/environmentsettingsdlg.cpp	(working copy)
@@ -117,7 +117,7 @@
 
 	bool i18n=cfg->ReadBool(_T("/environment/I18N"), false);
 		XRCCTRL(*this, "chkI18N", wxCheckBox)->SetValue(i18n);
-	for(size_t i=0; i < WXSIZEOF(langs); i++)
+	for(size_t i=0; i < LANGUAGES_SIZE; i++)
 	{
 		XRCCTRL(*this, "cbxLanguage", wxComboBox)->Append(langs[i]);
 	}
@@ -126,7 +126,7 @@
 	{
 		int lng = cfg->ReadInt(_T("/locale/language"),-1);
 
-		if (lng >= 0 && static_cast<unsigned int>(lng) < WXSIZEOF(locales))
+		if (lng >= 0 && static_cast<unsigned int>(lng) < LANGUAGES_SIZE)
 		{
 			XRCCTRL(*this, "cbxLanguage", wxComboBox)->SetSelection(lng+1);
 		}
Index: D:/codeblocks/src/src/Makefile.am
===================================================================
--- D:/codeblocks/src/src/Makefile.am	(revision 2051)
+++ D:/codeblocks/src/src/Makefile.am	(working copy)
@@ -14,9 +14,9 @@
 
 codeblocks_LDFLAGS = 
 
-codeblocks_LDADD =  $(WX_LIBS) \
-			-LwxAUI -lwxaui \
+codeblocks_LDADD =  -LwxAUI -lwxaui \
 			-L../sdk -lcodeblocks \
+			$(WX_LIBS) \
 			$(WX_XRC)
 
 codeblocks_SOURCES = app.cpp \
