Menu

problem linking many files

2002-08-24
2012-09-26
  • Nobody/Anonymous

    Hi,

    Im currently writing a vertical shooter with Dev-Cpp/allegro. When doing a complete rebuild, a linking error occurs. First all .cpp files are compiled, one by one to .o files, then I get this result:

    [...]
    g++.exe -c source/ThreadRunner.cpp -o o/ThreadRunner.o -I"E:\DEV-CPP\include"  -I"E:\DEV-CPP\include\g++-3"  -I"E:\DEV-CPP\include"  -I"E:\allegro\include"  -I"C:\len\dream\tinyxml"   -g3 -mwindows
    windres.exe -i DREAM.RC -I rc -o dream.res -O coff
    g++.exe o/Animation.o o/BaseClass.o o/BulletInterface.o o/dream.o o/DummyGrObj.o o/Enemy.o o/EnemyInterface.o o/GrObj.o o/Gun.o o/GunInterface.o o/Lightning.o o/Missile.o o/Player.o o/RotateGun.o o/Score.o o/TargetingGun.o o/Utils.o o/ObjectList.o o/HomingMissile.o o/Thread.o o/Bullet.o o/Instruction.o o/InstructionSet.o o/Exception.o o/Game.o o/ThreadRunner.o dream.res -o "system\dream.exe" -L"E:\DEV-CPP\lib" -L"E:\allegro\lib\mingw32" -L"C:\len\dream\tinyxml\lib" -lalleg -lTinyXmlLib -I"E:\DEV-CPP\include"  -I"E:\DEV-CPP\include\g++-3"  -I"E:\DEV-CPP\include"  -I"E:\allegro\include"  -I"C:\len\dream\tinyxml"   -g3 -mwindows
    Bad command or file name
    Execution terminated
    Compilation successful

    And I get a message, the compilation was not succesfull. If I relink in the DOS command line:

    g++ o/*.o dream.res -o "system\dream.exe" -L"E:\DEV-CPP\lib" -L"E:\allegro\lib\mingw32" -L"C:\len\dream\tinyxml\lib" -lalleg -lTinyXmlLib -I"E:\DEV-CPP\include"  -I"E:\DEV-CPP\include\g++-3"  -I"E:\DEV-CPP\include"  -I"E:\allegro\include"  -I"C:\len\dream\tinyxml"   -g3 -mwindows

    It does work. I think the problem probably is the size of the argument list of g++ when linking. Is there any way around this, apart from manually relinking after each compile?

    Greetings,

    Lennaert van der Linden

     
    • Nobody/Anonymous

      What about linking them one by one (one new file per version) ? Errors are easier to spot this way.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.