Author Topic: How can I biuld codeblocks with codeblocks on linux  (Read 42591 times)

Offline ccsee

  • Single posting newcomer
  • *
  • Posts: 5
How can I biuld codeblocks with codeblocks on linux
« on: May 08, 2009, 06:24:20 am »
I have downloaded both codeblocks8.0.2 source code and release version.
And i use codeblocks to open CodeBlocks-unix.cbp which is in src directory.
When tried to compile it, I got errors below. Forget the irrecognized characters,they are not english.

/home/ccsee/develop/wxGTK-2.8.10/include/wx/defs.h|42|閿欒锛?#error "No Target! You should use wx-config program for compilation flags!"|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/cursor.h|40|閿欒锛?ISO C++ 涓嶅厑璁稿0鏄庢棤绫诲瀷鐨勨€楪dkCursor鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/cursor.h|40|閿欒锛?expected 鈥?鈥?before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/app.h|55|閿欒锛?鈥榞uint鈥欐病鏈夊懡鍚嶄竴涓被鍨媩
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/app.h|65|閿欒锛?ISO C++ 涓嶅厑璁稿0鏄庢棤绫诲瀷鐨勨€楪dkVisual鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/app.h|65|閿欒锛?expected 鈥?鈥?before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/colour.h|26|閿欒锛?expected 鈥?鈥?or 鈥?..鈥?before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/colour.h|26|閿欒锛?ISO C++ 涓嶅厑璁稿0鏄庢棤绫诲瀷鐨勨€楪dkColor鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/colour.h|42|閿欒锛?鈥楪dkColormap鈥欐湭澹版槑|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/colour.h|45|閿欒锛?ISO C++ 涓嶅厑璁稿0鏄庢棤绫诲瀷鐨勨€楪dkColor鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/colour.h|45|閿欒锛?expected 鈥?鈥?before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/region.h|59|閿欒锛?expected `)' before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/region.h|61|閿欒锛?ISO C++ 涓嶅厑璁稿0鏄庢棤绫诲瀷鐨勨€楪dkRegion鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/region.h|61|閿欒锛?expected 鈥?鈥?before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/window.h|1133|閿欒锛?鈥榃XWidget鈥欐病鏈夊懡鍚嶄竴涓被鍨媩
/home/ccsee/develop/wxGTK-2.8.10/include/wx/window.h|1135|閿欒锛?鈥榃XWidget鈥欐湭澹版槑|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/window.h|1293|閿欒锛?瀛楁鈥榤_palette鈥欑被鍨嬩笉瀹屽叏|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/window.h||In member function 鈥榳xPalette wxWindowBase::GetPalette() const鈥?|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/window.h|1142|閿欒锛?杩斿洖鍊肩被鍨嬧€榮truct wxPalette鈥欎笉瀹屽叏|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/window.h|1142|閿欒锛?鈥榤_palette鈥欏湪姝や綔鐢ㄥ煙涓皻鏈0鏄巪
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?expected initializer before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欏湪姝や綔鐢ㄥ煙涓皻鏈0鏄巪
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?typedef鈥楥MPFUNC_wxArraywxArrayGdkWindows鈥欒鍒濆鍖?鏀圭敤 __typeof__)|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欏湪姝や綔鐢ㄥ煙涓皻鏈0鏄巪
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榩Item1鈥欏湪姝や綔鐢ㄥ煙涓皻鏈0鏄巪
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欏湪姝や綔鐢ㄥ煙涓皻鏈0鏄巪
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榩Item2鈥欏湪姝や綔鐢ㄥ煙涓皻鏈0鏄巪
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?ISO C++ 涓嶅厑璁稿0鏄庢棤绫诲瀷鐨勨€榑wxArraywxArrayGdkWindows鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?expected 鈥?鈥?before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?expected `;' before 鈥榑wxArraywxArrayGdkWindows鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?ISO C++ 涓嶅厑璁稿0鏄庢棤绫诲瀷鐨勨€榑wxArraywxArrayGdkWindows鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?expected 鈥?鈥?before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?expected `;' before 鈥榑wxArraywxArrayGdkWindows鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?ISO C++ 涓嶅厑璁稿0鏄庢棤绫诲瀷鐨勨€榑wxArraywxArrayGdkWindows鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?expected 鈥?鈥?before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?expected `;' before 鈥榠nt鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欐湭澹版槑|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欐湭澹版槑|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欐湭澹版槑|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欐湭澹版槑|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥楥MPFUNC_wxArraywxArrayGdkWindows鈥欐湭澹版槑|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欐病鏈夊懡鍚嶄竴涓被鍨媩
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欐病鏈夊懡鍚嶄竴涓被鍨媩
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|19|閿欒锛?鈥榑wxArraywxArrayGdkWindows鈥欐病鏈夊懡鍚嶄竴涓被鍨媩
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|132|閿欒锛?鈥榃XWidget鈥欐病鏈夊懡鍚嶄竴涓被鍨媩
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|171|閿欒锛?ISO C++ 涓嶅厑璁稿0鏄庢棤绫诲瀷鐨勨€楪tkWidget鈥檤
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|171|閿欒锛?鈥楪tkWidget鈥欏0鏄庝负鈥榲irtual鈥檉ield|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|171|閿欒锛?expected 鈥?鈥?before 鈥?鈥?token|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|172|閿欒锛?鈥楪tkWidget鈥欐湭澹版槑|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|186|閿欒锛?鈥楪tkWidget鈥欐湭澹版槑|
/home/ccsee/develop/wxGTK-2.8.10/include/wx/gtk/window.h|187|閿欒锛?鈥楪tkWidget鈥欐湭澹版槑|
||More errors follow but not being shown.|
||Edit the max errors limit in compiler options...|
||=== Build finished: 50 errors, 0 warnings ===|

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #1 on: May 08, 2009, 06:49:00 am »
Please use english language, so that people can understand the compiler output.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ccsee

  • Single posting newcomer
  • *
  • Posts: 5
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #2 on: May 08, 2009, 07:48:26 am »
mainly error  "No Target! You should use wx-config program for compilation flags!"


The error is caused by wxWidget.
What can I do?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #3 on: May 08, 2009, 08:05:10 am »
What can I do?
Ask in a wxWidgets forum?

If I look into def.h (on windows) I see:
Code
/*  Make sure the environment is set correctly */
#   if defined(__WXMSW__) && defined(__X__)
#       error "Target can't be both X and Windows"
#   elif defined(__WXMSW__) && defined(__PALMOS__)
#       error "Target can't be both PalmOS and Windows"
#   elif !defined(__WXMOTIF__) && \
         !defined(__WXMSW__)   && \
         !defined(__WXPALMOS__)&& \
         !defined(__WXGTK__)   && \
         !defined(__WXPM__)    && \
         !defined(__WXOSX_CARBON__)   && \
         !defined(__WXOSX_COCOA__)   && \
         !defined(__WXOSX_IPHONE__)   && \
         !defined(__WXCOCOA__) && \
         !defined(__X__)       && \
         !defined(__WXMGL__)   && \
         !defined(__WXDFB__)   && \
         !defined(__WXX11__)   && \
          wxUSE_GUI
#       ifdef __UNIX__
#           error "No Target! You should use wx-config program for compilation flags!"
#       else /*  !Unix */
#           error "No Target! You should use supplied makefiles for compilation!"
#       endif /*  Unix/!Unix */
#   endif
#endif /*__cplusplus*/
So you see what causes the error... probably (I don't have wxGTK on Windows).

In addition: Without the compilation command (thus full compile log) we can't help you much. See my sig on how to enable full compiler logging and post again the full log.
« Last Edit: May 08, 2009, 08:09:36 am by MortenMacFly »
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline ccsee

  • Single posting newcomer
  • *
  • Posts: 5
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #4 on: May 11, 2009, 03:32:24 am »
Thank you for your reply!
        I tried to build codeblocks in the terminal.This time, i successed.
        But  How can I build codeblocks with codeblocks on linux?

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #5 on: May 11, 2009, 07:54:07 am »
        But  How can I build codeblocks with codeblocks on linux?
Open the unix workspace file and hit compile. In addition you might want to open the (unix) plugins workspace file and hit compile, too.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #6 on: May 11, 2009, 10:44:27 am »
After compiling "CodeBlocks-unix.cbp" and (if wanted) "ContribPlugins-unix.workspace", you have to run "./update" from the commandline (it's in the same directory as the main project/workspace-files), even if you want to start C::B from inside C::B, because otherwise you are missing some resource-files.

Offline ccsee

  • Single posting newcomer
  • *
  • Posts: 5
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #7 on: May 13, 2009, 04:11:22 am »
Successly build.I think that it works correctly  after “apt-get update” .
Thank you!

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #8 on: May 29, 2009, 06:55:10 pm »
Hello,
How can I debug the code-completion plugin inside C::B?
I've remove the stripping from the update script,
added -g to the code-completion target,
rebuild it
and executed the update script again.

But I still can't debug it?
If I debug code from the sdk(inside cbeditor.cpp) it works.

Here is one of the error messages:
No line 784 in file "/home/obfuscated/projects/codeblocks/brances/wxfnb_to_wxaui/src/plugins/codecompletion/parser/parser.cpp".
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #9 on: May 30, 2009, 03:14:15 am »
Hello,
How can I debug the code-completion plugin inside C::B?
I've remove the stripping from the update script,
added -g to the code-completion target,
rebuild it
and executed the update script again.

But I still can't debug it?
If I debug code from the sdk(inside cbeditor.cpp) it works.

Here is one of the error messages:
No line 784 in file "/home/obfuscated/projects/codeblocks/brances/wxfnb_to_wxaui/src/plugins/codecompletion/parser/parser.cpp".

For me, I just log out some thing to "Debug log" panel. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #10 on: May 30, 2009, 09:55:02 am »
I tried to log with LogError, but it crashed :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #11 on: May 30, 2009, 10:00:15 am »
I tried to log with LogError, but it crashed :(

No, you should use this way I wrote in wiki page:

http://wiki.codeblocks.org/index.php?title=Code_Completion_Design#Debug_Log_output
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #12 on: May 31, 2009, 02:07:03 pm »
DebugLog crashed too :(

I've taken a look at the code and I think the crash is caused by a race condition.
I could not find any thread safety protection mechanisms for the logging class.

There are ::temp_string and ::newline_string which are global.
I've replaced them with local variables, but again got a crash, this time it was AppendText.
Do you know if this method can be called from two threads simultaneously?
I've added a wxMutex, but still got the crash
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 5916
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #13 on: May 31, 2009, 02:25:17 pm »
In Windows, I didn't encounter any crash. I'm not sure this DebugLog can be called from different thread, but it seems it can. :D

You need a more sophisticated dev to tell you the details. :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: How can I biuld codeblocks with codeblocks on linux
« Reply #14 on: May 31, 2009, 02:44:15 pm »
It might be something different in wxGTK, than wxMSW (or its proper name). So you are lucky.

Do someone now if I can disable the precompiled header?
I'm 100% sure that it is the cause of the broken debugging and strange error messages that I receive:

Code
In file included from /home/obfuscated/projects/codeblocks/brances/wxfnb_to_wxaui/src/include/sdk_precomp.h:10:
include/editorbase.h: In member function ‘wxArrayString Parser::FindFileInIncludeDirs(const wxString&, bool)’:
include/editorbase.h:1092: error: ‘_1’ was not declared in this scope
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]