Author Topic: Can't read files timestamp  (Read 5609 times)

Offline jonas thomas

  • Multiple posting newcomer
  • *
  • Posts: 18
Can't read files timestamp
« on: May 28, 2011, 06:04:42 pm »
I've working my way through the ogre tutorials and tried to build my own code::blocks project rather than using the cmake system.

I ran into this weird situation that I don't understand.  Here the build log.
Quote
------------- Build: Debug in tutorial3a ---------------

g++ -I/usr/local/include -I/usr/local/include/OGRE    -Wall -fexceptions  -g    -I/usr/local/include/OIS/  -c /home/jonas/OgreTutorials/BasicTutorial3a/BaseApplication.cpp -o obj/Debug/BaseApplication.o
g++ -I/usr/local/include -I/usr/local/include/OGRE    -Wall -fexceptions  -g    -I/usr/local/include/OIS/  -c /home/jonas/OgreTutorials/BasicTutorial3a/BasicTutorial3.cpp -o obj/Debug/BasicTutorial3.o
g++ -I/usr/local/include -I/usr/local/include/OGRE    -Wall -fexceptions  -g    -I/usr/local/include/OIS/  -c /home/jonas/OgreTutorials/BasicTutorial3a/main.cpp -o obj/Debug/main.o
WARNING: Can't read file's timestamp: /home/jonas/OgreTutorials/BasicTutorial3a/tutorial3a/main.cpp
g++ -L/bin/Debug -L/bin/Release  -o ./tutorial3a obj/Debug/BaseApplication.o obj/Debug/BasicTutorial3.o obj/Debug/main.o obj/Debug/main.o   -L/usr/local/lib -lOgreMain     -lGL -lOIS -lOgreTerrain -lOgreMain
obj/Debug/main.o: In function `main':
/home/jonas/OgreTutorials/BasicTutorial3a/main.cpp:17: multiple definition of `main'
obj/Debug/main.o:/home/jonas/OgreTutorials/BasicTutorial3a/main.cpp:17: first defined here
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 20 seconds)
2 errors, 0 warnings (0 minutes, 20 seconds)

The first complaint is that about a timestamp... What's the deal with that??
I renamed the file and create a new main.cpp, cleaned the project and yet this still persists. Permissions seem ok.
Quote
[email protected]:~/OgreTutorials/BasicTutorial3a$ ls -l
total 44
-rw-r--r-- 1 jonas jonas 13504 2010-12-31 19:37 BaseApplication.cpp
-rw-r--r-- 1 jonas jonas  3158 2010-12-31 19:37 BaseApplication.h
-rw-r--r-- 1 jonas jonas  6355 2011-05-28 08:40 BasicTutorial3.cpp
-rw-r--r-- 1 jonas jonas   748 2011-05-28 10:12 BasicTutorial3.h
-rw-r--r-- 1 jonas jonas   777 2011-05-28 10:25 maina.cpp
-rw-r--r-- 1 jonas jonas   776 2011-05-28 10:29 main.cpp
drwxr-xr-x 3 jonas jonas  4096 2011-05-28 10:30 tutorial3a
[email protected]:~/OgreTutorials/BasicTutorial3a$


I don't think I've screwed anything with the structure with the code, which has me really befuddled why this mult defination of main thing is occurring.
Is the time stamp thing hosing something up with the linker??  Or am I'm doing something stupid here(which is what I suspect)? I could use some pointing in the correct direction.
(Btw... using SVN 7154 Build: May 21 2011 -wx2.8.10 (Linux,unicode)-32bit

I had created a new Ogre project  and I deleted the main.cpp and then included my in a seperate folder.  It appears that there was some residue left over

Quote
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<CodeBlocks_project_file>
   <FileVersion major="1" minor="6" />
   <Project>
      <Option title="tutorial3a" />
      <Option pch_mode="2" />
      <Option compiler="gcc" />
      <Build>
         <Target title="Debug">
            <Option output="./tutorial3a" prefix_auto="1" extension_auto="1" />
            <Option object_output="obj/Debug/" />
            <Option type="1" />
            <Option compiler="gcc" />
            <Compiler>
               <Add option="-g" />
               <Add directory="/usr/local/include/OIS/" />
            </Compiler>
            <Linker>
               <Add library="OIS" />
               <Add library="OgreTerrain" />
               <Add library="OgreMain" />
            </Linker>
         </Target>
         <Target title="Release">
            <Option output="./tutorial3a" prefix_auto="1" extension_auto="1" />
            <Option object_output="obj/Release/" />
            <Option type="0" />
            <Option compiler="gcc" />
            <Compiler>
               <Add option="-O2" />
            </Compiler>
            <Linker>
               <Add option="-s" />
               <Add library="OgreMain" />
               <Add library="OIS" />
            </Linker>
         </Target>
      </Build>
      <Compiler>
         <Add option="`pkg-config --cflags OGRE`" />
         <Add option="-Wall" />
         <Add option="-fexceptions" />
      </Compiler>
      <Linker>
         <Add option="`pkg-config --libs OGRE`" />
         <Add library="GL" />
         <Add directory="/bin/Debug" />
         <Add directory="/bin/Release" />
      </Linker>
      <Unit filename="../BaseApplication.cpp" />
      <Unit filename="../BaseApplication.h" />
      <Unit filename="../BasicTutorial3.cpp" />
      <Unit filename="../BasicTutorial3.h" />
      <Unit filename="../main.cpp" />
      <Unit filename="main.cpp" />
      <Extensions>
         <code_completion />
         <debugger />
      </Extensions>
   </Project>
</CodeBlocks_project_file>

When I manually deleted  "<Unit filename="main.cpp" />" everthing worked fine.  It appears that when the file was removed from the project via the code::blocks gui, this line was not removed from the list.   (Is this a code::blocks bug that needs to be reported?)






« Last Edit: May 28, 2011, 06:33:23 pm by jonas thomas »