project-navigation
Personal tools

Author Topic: CodeBlocks problem  (Read 24494 times)

Offline criusmac

  • Squad Leader
  • ****
  • Posts: 168
    • View Profile
CodeBlocks problem
« on: December 11, 2009, 09:25:48 am »
I posted this somewhere before, but now I have some proof.

The problem is CodeBlocks sometimes deletes files on me, removing all of my changes. Attached is a file that causes a compile error in CodeBlocks.

The errors I get are:
.objs\game\src\game\g_actor.o||In function `G_ActorDamage':C:/cprogs/UFOAI-2.3-dev-medikits/src/game/g_actor.c:213: undefined reference to `LIST_AddPointer'|
.objs\game\src\game\g_actor.o||In function `G_ActorTreat':C:/cprogs/UFOAI-2.3-dev-medikits/src/game/g_actor.c:404: undefined reference to `LIST_GetByIdx'|
:C:\cprogs\UFOAI-2.3-dev-medikits\src\game\g_actor.c|419|undefined reference to `LIST_Remove|

These errors are expected since I lost my linked list file additions to the workspace upon updating my project with the repository's.
Now, when I click on these errors, nothing happens until I click on the last one, which opens an empty file, with nothing in it, which has the same name and location as the file with the error.

I probably clicked save all or something without noticing this originally. Upon saving this file, which I successfully did in my test just a couple minutes ago, I lost the entire contents of the file. Luckily, I made a backup of the file before trying to save it, so I was able to replace the file.

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: CodeBlocks problem
« Reply #1 on: December 11, 2009, 09:20:43 pm »
Hmm. Was there also some svn update involved ?

I never used 'Save all'. Instead I let 'build' do that for me. But I assume the same code is used there.

Offline criusmac

  • Squad Leader
  • ****
  • Posts: 168
    • View Profile
Re: CodeBlocks problem
« Reply #2 on: December 11, 2009, 09:43:45 pm »
Yes, I did a full svn update since I was preparing to start coding the medikits project again.

Ok, I tested with build, without using save all, and build wiped out the file too. The file became empty, and I got a *ton* more new errors.

Sadly, I forgot I removed the file from my backup location after I restored it, and all my changes to this file were lost. Thank goodness I uploaded it here, or I'd have lost it.
« Last Edit: December 11, 2009, 09:45:40 pm by criusmac »

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: CodeBlocks problem
« Reply #3 on: December 11, 2009, 10:13:40 pm »
I asked for svn update because if a file you edited is also updated via svn, C::B comes up with a box with three buttons. One can easily click the wrong one. But that might kill your changes, not the entire file.

Are you on Win or *nix ?

The file in question is g_actor.c ?

Offline criusmac

  • Squad Leader
  • ****
  • Posts: 168
    • View Profile
Re: CodeBlocks problem
« Reply #4 on: December 12, 2009, 12:41:05 am »
I never update via svn while the project or any files are open in CodeBlocks, so I probably skirt around that issue.

I'm on
OS Name   Microsoft Windows XP Home Edition
Version   5.1.2600 Service Pack 3 Build 2600

The file in question in this case is g_actor.c, though I've lost g_combat.c several times too, and, oddly, I don't recall losing any files that didn't start with g_ before... It's always g_ files I lose...

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: CodeBlocks problem
« Reply #5 on: December 12, 2009, 12:59:28 am »
I've been running CB on XP and Vista for more than a year now, but I never experienced loss of data (except by misclicking maybe). And no other user afaik complained about such.

Are you sure your HW is ok ? Especially HD and mem ? Did you experience other things that might be associated with a HW defect ?

Offline criusmac

  • Squad Leader
  • ****
  • Posts: 168
    • View Profile
Re: CodeBlocks problem
« Reply #6 on: December 12, 2009, 04:21:53 am »
So, I take it the error could not be reproduced on your system with that file.

Did you download the file and try to compile it, and then double click on the last error to see what happens?

I can't guarantee my HD and mem are ok, but my POST has never indicated a problem.

The error is 100% reproducible for me, and very easy to do, every time I try, exiting CodeBlocks and restarting it doesn't make a difference.. This suggests memory isn't my problem since memory errors tend to be a bit more random.

The file can be opened up properly and contains all the information if I open it up via the project interface. It is only blank if I open it up by double clicking on the error message itself. This suggests it's not a HD problem since the file can be opened up properly through other methods. Also, there is no error of any kind when double clicking the compile/linking errors. This suggests it's not a HD problem.

Since I can reproduce this problem through very easy to follow steps, and it is 100% reproducible, this suggests it is a bug. The location is the bug is most likely CodeBlocks, but it could also be the operating system, or something else.

I am not seeing any symptoms of any hardware defects or problems.

When I first downloaded CodeBlocks as requested on these forums, I downloaded the package from the CodeBlocks web page, and I manually downloaded all the dependencies and installed them myself. I probably also got some plugins for CodeBlocks, but I don't know which ones or where they are. So, it is possible one of the plugins I grabbed originally is doing this.

In any case, what I am seeing suggests a software glitch since there are no errors reported at any stage, and it is 100% reproducible. Since I have overwritten my original install with the CodeBlocks package supplied by UFO: AI several times now, there may be some problem that came to surface in this way as well. -- The only way to be certain is to see if the problem can be reproduced on someone else's computer, hence this post. Since there has been no mention that this problem could not be reproduced yet, I can't eliminate my setup as a problem yet.

Offline criusmac

  • Squad Leader
  • ****
  • Posts: 168
    • View Profile
Re: CodeBlocks problem
« Reply #7 on: December 12, 2009, 04:36:36 am »
These are my plugins:
12/11/2009  10:32 PM           264,834 astyle-1.2.cbplugin
12/11/2009  10:32 PM            67,488 autosave-0.1.cbplugin
12/11/2009  10:32 PM           114,533 AutoVersioning-1.2.cbplugin
12/11/2009  10:32 PM            99,822 BrowseTracker-1.2.74_2008_03_15.cbplugin
12/11/2009  10:32 PM            75,600 byogames-1.0.cbplugin
12/11/2009  10:32 PM            51,694 cb_koders-0.1.cbplugin
12/11/2009  10:32 PM            69,509 classwizard-0.3.cbplugin
12/11/2009  10:32 PM           237,852 codecompletion-0.7.cbplugin
12/11/2009  10:32 PM           548,851 codesnippets-1_3.92_2008_08_23.cbplugin
12/11/2009  10:32 PM            54,120 codestat-0.5.cbplugin
12/11/2009  10:32 PM           512,609 compiler-0.99.cbplugin
12/11/2009  10:32 PM            47,717 copystrings-1.00.cbplugin
12/11/2009  10:32 PM           251,126 debugger-0.3.cbplugin
12/11/2009  10:32 PM            54,765 defaultmimehandler-1.0.cbplugin
12/11/2009  10:32 PM            96,402 devpakupdater-0.2.cbplugin
12/11/2009  10:32 PM            85,530 DragScroll-1.3.23_2008_08_26.cbplugin
12/11/2009  10:32 PM            76,993 envvars-0.97.cbplugin
12/11/2009  10:32 PM           401,642 Exporter-1.0.cbplugin
12/11/2009  10:32 PM           272,632 headerfixup-0.80.cbplugin
12/11/2009  10:32 PM           342,273 help_plugin-1.1.cbplugin
12/11/2009  10:32 PM           324,077 HexEditor-0.5.cbplugin
12/11/2009  10:32 PM            74,383 IncrementalSearch-0.5.cbplugin
12/11/2009  10:32 PM            91,673 keybinder-1.0.46_2008_02_12.cbplugin
12/11/2009  10:32 PM           190,423 lib_finder-2.0.cbplugin
12/11/2009  10:32 PM            41,179 openfileslist-1.0.cbplugin
12/11/2009  10:32 PM            83,715 Profiler-1.0RC2.cbplugin
12/11/2009  10:32 PM            84,180 projectsimporter-1.0.cbplugin
12/11/2009  10:32 PM            44,715 RegExTestbed-0.2.cbplugin
12/11/2009  10:32 PM           127,419 scriptedwizard-0.9.cbplugin
12/11/2009  10:32 PM            61,883 SymTab-1.0.cbplugin
12/11/2009  10:32 PM           116,285 ThreadSearch-1.11.cbplugin
12/11/2009  10:32 PM           114,482 todo-0.2.cbplugin
12/11/2009  10:32 PM            63,579 wxsmith-1.0.cbplugin
12/11/2009  10:32 PM           116,264 wxSmithContribItems-0.1.cbplugin
12/11/2009  10:32 PM            37,114 xpmanifest-1.0.cbplugin

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: CodeBlocks problem
« Reply #8 on: December 12, 2009, 04:17:28 pm »
So, I take it the error could not be reproduced on your system with that file.

Did you download the file and try to compile it, and then double click on the last error to see what happens?
Actually I had not tried with your file because I can't believe that it's the content of the file.

But now I tried and got a lot of compiler errors along the lines of WOUND_* undeclared. So I didn't get to the linker errors you are experiening.

Offline criusmac

  • Squad Leader
  • ****
  • Posts: 168
    • View Profile
Re: CodeBlocks problem
« Reply #9 on: December 12, 2009, 10:01:36 pm »
Ah, hmm, I was worried that might be the case.

http://ufoai.ninex.info/forum/index.php?topic=2216.msg32609#new contains my medikits.diff file which is all of the differences I'm working with. As long as you don't modify the project files (adding the g_linkedlist.c), the exact errors I'm seeing should appear.

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: CodeBlocks problem
« Reply #10 on: December 13, 2009, 12:38:03 am »
Uhm...just to be sure: you're talking about the medikit.diff in the SF patch tracker ID: 2891685 ?

Offline criusmac

  • Squad Leader
  • ****
  • Posts: 168
    • View Profile

Offline Duke

  • Administrator
  • PHALANX veteran
  • *****
  • Posts: 1037
    • View Profile
Re: CodeBlocks problem
« Reply #12 on: December 13, 2009, 09:20:50 pm »
I applied that patch. Got some conflicts but could resolve them. Sooner or later you should create a patch based on a recent rev.

I still got compile errors:
Code: [Select]
C:\UFO\src\game\g_round.c: In function 'G_ActorsBleed':
C:\UFO\src\game\g_round.c:159: warning: unused variable 'regen'
C:\UFO\src\game\g_round.c: In function 'G_ClientEndRound':
C:\UFO\src\game\g_round.c:211: warning: implicit declaration of function 'G_GetNextActiveTeam'
C:\UFO\src\game\g_round.c:213: error: 'lastTeam' undeclared (first use in this function)
C:\UFO\src\game\g_round.c:213: error: (Each undeclared identifier is reported only once
C:\UFO\src\game\g_round.c:213: error: for each function it appears in.)
C:\UFO\src\game\g_round.c:219: warning: unused variable 'nextTeam'
C:\UFO\src\game\g_round.c:253: error: expected declaration or statement at end of input

Offline Mattn

  • Administrator
  • PHALANX Commander
  • *****
  • Posts: 4831
  • https://github.com/mgerhardy/vengi
    • View Profile
    • Vengi Voxel Tools
Re: CodeBlocks problem
« Reply #13 on: December 13, 2009, 10:53:02 pm »
i've attached an updated version to the tracker item

Offline criusmac

  • Squad Leader
  • ****
  • Posts: 168
    • View Profile
Re: CodeBlocks problem
« Reply #14 on: December 13, 2009, 11:52:09 pm »
I had no errors when I applied the patch to the most recent revision that I got from svn 3 days ago, save for the one when I threw out the project and workspace file modification (since they conflicted).

It's starting to look like chasing this down will be a waste of time. I can work around this as long as I never double click an error, or if I do, I don't save all or build afterwards. Since I can avoid the error, it's probably not worth the time to continue confirming there is an error.

I'll label it up as "I finally figured out why my files are getting deleted", and I will just backup everything before I start testing again. That's life. Very sorry to have caused so many problems with this.