Author Topic: Can't build static library  (Read 18010 times)

Offline thecheeselover

  • Multiple posting newcomer
  • *
  • Posts: 13
Can't build static library
« on: November 18, 2012, 09:54:56 pm »
Hello,

     Like my title says, I can't build a library. Code::Blocks says ''Nothing to be done'', but no file .a is created in my project's folder. My project also doesn't have object files to link. I don't know where it mights come from, I didn't edit it since two months ago (it was working before).

Thank you,
thecheeselover

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
(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 thecheeselover

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Can't build static library
« Reply #2 on: November 19, 2012, 01:58:00 am »
I just did.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Can't build static library
« Reply #3 on: November 19, 2012, 02:17:07 am »
And?
(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 thecheeselover

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Can't build static library
« Reply #4 on: November 19, 2012, 02:29:39 am »
Same as before. I also reinstalled Mingw and MSYS.

EDIT: It's weird, I created a .c++ file just to test if it would build and it did build.
« Last Edit: November 19, 2012, 02:48:10 am by thecheeselover »

Offline Radek

  • Multiple posting newcomer
  • *
  • Posts: 104
Re: Can't build static library
« Reply #5 on: November 20, 2012, 06:55:29 am »
"Nothing to be done" means that there is a built library (it should be in the project folder) which is "up to date". The makefile found out that all source files (or object files) are older than the library.

(1) Try "Rebuild" instead of "Build".
(2) Delete the library (or move it out of the project folder or its target folder where it should be built) and try "Build".

Offline thecheeselover

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Can't build static library
« Reply #6 on: November 21, 2012, 04:31:40 pm »
"Nothing to be done" means that there is a built library (it should be in the project folder) which is "up to date". The makefile found out that all source files (or object files) are older than the library.

(1) Try "Rebuild" instead of "Build".
(2) Delete the library (or move it out of the project folder or its target folder where it should be built) and try "Build".

My problem was (I fixed it) that CB acted like if there were a built library, but there wasn't. I deleted the library because CB wasn't building it anymore, so it wasn't up to date.
1) I tried many times but it didn't work.
2) That's what I did, but CB didn't rebuild the library.

Anyway, it's not the first CB bug that I found under Windows.

Offline dmoore

  • Developer
  • Lives here!
  • *****
  • Posts: 1576
Re: Can't build static library
« Reply #7 on: November 21, 2012, 04:34:15 pm »
So what did you do to fix the problem? If there's a bug it would be more helpful to share it than keep it to yourself.

Offline thecheeselover

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Can't build static library
« Reply #8 on: December 16, 2012, 03:19:16 am »
So what did you do to fix the problem? If there's a bug it would be more helpful to share it than keep it to yourself.

No I didn't. People stopped to help me and I still need to recreate a new project every time Code::Blocks fucks. I am extremely pissed off of this bug.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: Can't build static library
« Reply #9 on: December 16, 2012, 07:50:58 am »
No I didn't. People stopped to help me and I still need to recreate a new project every time Code::Blocks fucks. I am extremely pissed off of this bug.
Note that you should also check your date settings and compare it to those of the source and lib file. Is the file on a network share or its file date in the future?

C::B checks, if the library is newer than the source. If so, the build will be skipped. This can also happen, if you use a network share were the date differers from those of your computer - meaning if you create a file there its date will be in the past or vice versa.

Also, please post the full build log of a re-build.
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 thecheeselover

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Can't build static library
« Reply #10 on: December 16, 2012, 04:05:22 pm »
Everything is in my hard drive. Also, my source files are old compared to my date settings. By the way, I deleted my .a file to check if CB would rebuild it (it didn't), so I can't really check its date.

Here is the full build log (with full command line enabled):

''-------------- Clean: Debug in UnforeseenCosmosCore (compiler: GNU GCC Compiler)---------------

Cleaned "UnforeseenCosmosCore - Debug"

-------------- Build: Debug in UnforeseenCosmosCore (compiler: GNU GCC Compiler)---------------

Linking stage skipped (build target has no object files to link)
Nothing to be done (all items are up-to-date).''
This ''Nothing to be done (all items are up-to-date)'' is totally false: I don't have a damn .a file!

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Can't build static library
« Reply #11 on: December 16, 2012, 04:25:43 pm »
I don't see any compiling commands in your log.
Can you attach the project-file ?

Offline thecheeselover

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Can't build static library
« Reply #12 on: December 16, 2012, 09:04:26 pm »
With a lot of trouble, I finally found a way to attach my project. Sorry if it's not zipped: http://adf.ly/G2qbm

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: Can't build static library
« Reply #13 on: December 16, 2012, 09:19:19 pm »
You do not have any sources included in the project, just headers.
[...]
I don't know where it mights come from, I didn't edit it since two months ago (it was working before).
[...]

This can not be the truth, sorry.

Anyway, it's not the first CB bug that I found under Windows.

It's obviously not a bug, but a lack of knowledge on your side.

So what did you do to fix the problem? If there's a bug it would be more helpful to share it than keep it to yourself.

No I didn't. People stopped to help me and I still need to recreate a new project every time Code::Blocks fucks. I am extremely pissed off of this bug.

This offending sentence disqualifies yourself.

Everything is in my hard drive. Also, my source files are old compared to my date settings. By the way, I deleted my .a file to check if CB would rebuild it (it didn't), so I can't really check its date.

Here is the full build log (with full command line enabled):

''-------------- Clean: Debug in UnforeseenCosmosCore (compiler: GNU GCC Compiler)---------------

Cleaned "UnforeseenCosmosCore - Debug"

-------------- Build: Debug in UnforeseenCosmosCore (compiler: GNU GCC Compiler)---------------

Linking stage skipped (build target has no object files to link)
Nothing to be done (all items are up-to-date).''
This ''Nothing to be done (all items are up-to-date)'' is totally false: I don't have a damn .a file!


You uploaded a *.a file, so where does it come from, if you really have deleted it ?

And why do you say it's incorrect to state that there is nothing to be done, if there is no source file included in your project, that can be compiled ?


You should learn the basics of programming, before you start to blame software for your lack of knowledge.

And you should learn to use an appropriate language.
« Last Edit: December 16, 2012, 10:02:22 pm by jens »

Offline thecheeselover

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: Can't build static library
« Reply #14 on: December 16, 2012, 11:19:17 pm »
Quote
You uploaded a *.a file, so where does it come from, if you really have deleted it ?

And why do you say it's incorrect to state that there is nothing to be done, if there is no source file included in your project, that can be compiled ?

You should learn the basics of programming, before you start to blame software for your lack of knowledge.

The .a file is a really old file that wasn't deleted when I overwrote the folder with the newest one.

''And why do you say it's incorrect to state that there is nothing to be done, if there is no source file included in your project, that can be compiled ?'' How is then that header-only libraries exist? I've seen one before.

Do you really think I would try to learn C++ without having any knowledge in programming? I first learned C# and then Java because I thought that C++ was too difficult to start. It's bad to jump to conclusion. bAlso, if I stated that it wasn't the first bug I found, it's because there's really another bug. You can't force stop an application on Windows with Code::Blocks (at least with the 10.0.5 version, I didn't check with the newest), so you have to click on the ''X'' button on the window itself to close an application.