News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

Building CodeBlock

Started by puneet_m, August 20, 2007, 07:13:12 PM

Previous topic - Next topic

puneet_m

After building the codeblock successfully, I execute it. Then I try to open a .cbp file using the new executable. It says "Deactivating the compiler plugin is most unwise. If you intend to open a project, you have to re-activate the compiler plugin first".

I also tried enable compiler from Plugins->Manage Plugins. But it does not show me any options for enabling compiler. Please suggest me something to fix this.


thomas

Compile the plugins, too, not just the application. And then run update.bat.
You should do that anyway, or it will crash soon enough when you open a dialog.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

puneet_m

I am building the whole project. What do you mean by compile plugins too? Isnt the plugins included in CodeBlock.cbp?

I am running update.bat too.

This is the build log

WARNING: Can't read file's timestamp: C:\codeblocks-1.0svn4360.tar\src\plugins\compilergcc\depslib\src\main.c
Linking static library: plugins\compilergcc\depslib\libdepslib.a
ar.exe: .objs\plugins\compilergcc\depslib\src\main.o: No such file or directory
Process terminated with status 1 (0 minutes, 4 seconds)
0 errors, 0 warnings


Is the error because of the above warning that is generated?

TDragon

The "Can't read file's timestamp" error occurs when the depslib component of the C::B executable that you're currently running was built with -O2 optimization under GCC 4.2. When building C::B with GCC 4.2, add "-fno-strict-aliasing" to fix this problem. Otherwise, wait for the next 4.2 release in which this compiler bug was fixed.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

puneet_m

How do I compile the plugins separately? I have built the CodeBlocks.cbp file. But when I execute the executable, there is just one plugin installed i.e. AyStyle. I cannot see any other plugin installed. Also when I click Help->About, it shows SVN 0. Why is that the case?


raph

#5
For core plugins:
Either build target "all" or choose your plugin as build target.
For contributed plugins:
Open ContribPlugins.workspace, point global variable "cb" to your codeblocks\src dir and hit Build->Build workspace.

puneet_m

I did build target "all", but it seems like that plugins are not getting built properly.
The build log is as follows -

-------------- Build: Compiler depslib in Code::Blocks ---------------
WARNING: Can't read file's timestamp: C:\codeblocks-1.0svn4360.tar\src\plugins\compilergcc\depslib\src\main.c
Linking static library: plugins\compilergcc\depslib\libdepslib.a
ar.exe: .objs\plugins\compilergcc\depslib\src\main.o: No such file or directory
Process terminated with status 1 (0 minutes, 5 seconds)
0 errors, 0 warnings

puneet_m

The build log for depslib is

Build: Compiler depslib in Code::Blocks ---------------
Compiling: plugins\compilergcc\depslib\src\alloc.c
Compiling: plugins\compilergcc\depslib\src\cache.c
Compiling: plugins\compilergcc\depslib\src\depslib.c
Compiling: plugins\compilergcc\depslib\src\filent.c
Compiling: plugins\compilergcc\depslib\src\fileunix.c
Compiling: plugins\compilergcc\depslib\src\hash.c
Compiling: plugins\compilergcc\depslib\src\headers.c
Compiling: plugins\compilergcc\depslib\src\lists.c
WARNING: Can't read file's timestamp: C:\codeblocks-1.0svn4360.tar\src\plugins\compilergcc\depslib\src\main.c
Compiling: plugins\compilergcc\depslib\src\newstr.c
Compiling: plugins\compilergcc\depslib\src\pathsplit.c
Compiling: plugins\compilergcc\depslib\src\pathunix.c
Compiling: plugins\compilergcc\depslib\src\regexp.c
Compiling: plugins\compilergcc\depslib\src\search.c
Compiling: plugins\compilergcc\depslib\src\timestamp.c
Linking static library: plugins\compilergcc\depslib\libdepslib.a
ar.exe: creating plugins\compilergcc\depslib\libdepslib.a
ar.exe: .objs\plugins\compilergcc\depslib\src\main.o: No such file or directory
Process terminated with status 1 (11 minutes, 4 seconds)
0 errors, 0 warnings


Why is it looking for main.o, when there is no main.c defined in plugins\compilergcc\depslib\src??

Ceniza

QuoteWhy is it looking for main.o, when there is no main.c defined in plugins\compilergcc\depslib\src??

That's the way the plugin was designed. If it cannot read the timestamp, it'll try to link the .o file anyway, even if it doesn't exist. I modified that section of the plugin by adding a check for file existence. If the file exists it forces compilation, if it doesn't then it continues with the old behavior, and the svn version you're trying to compile has that change already (it was introduced in revision 4326).

Please find that main.c in the project tree and delete it. If you say it doesn't exist in that directory, it should be in the project tree with a different icon. If it doesn't even show up in the project tree then something strange is going on with the .cbp file. If that's the case, please upload the project file so we can check it.

puneet_m

Attached is the depslib folder which is giving errors. Please suggest me  suitable changes to be made.



[attachment deleted by admin]

puneet_m

Where did you add the check for file existence?

Biplab

The tarball you downloaded is damaged or not extracted properly. main.c file is missing from your package and that is the reason C::B is complaining.

Try to download the source from svn. :)
Be a part of the solution, not a part of the problem.