奇怪的ar链接错误

时间:2012-02-07 02:38:24

标签: c++ compilation makefile g++ ar

  1. 从头开始制作项目(有效)
  2. 尝试重新制作而不更改任何文件(不起作用)
  3. 删除静态库
  4. 在不更改任何文件(作品)的情况下再次制作
  5. 再次制作而不更改任何文件(不起作用)
  6. 步骤1的格式为:

    User@MacBook-Pro:~/$ make
    g++  -o Install.o -c -m32 -g  Install.cpp
    (same as prev command for all files, abbreviated for conciseness)
    

    以下是步骤2,3和4的输出

    User@MacBook-Pro:~/$ make
    ar rcs ./libRain.a DirectoryMonitor.o Install.o Machines.o Notifications.o RainDirectory.o ResourceShare.o Resources.o RowTransferProtocol.o Server.o Tags.o Transaction.o Triggers.o Util/ArrayList.o Util/ArrayList64.o Util/Buffer.o Util/CPU.o Util/CircularBuffer.o Util/Connection.o Util/DateTime.o Util/Directory.o Util/DownloadManager.o Util/EventHandler.o Util/ExtendibleHashTable.o Util/FILE_buffer.o Util/File.o Util/HttpRequest.o Util/HttpResponse.o Util/Http_Headers.o Util/Http_Message.o Util/Http_client.o Util/Iterator.o Util/JSON.o Util/Log.o Util/MD5.o Util/NetworkDevice.o Util/PosixThreads.o Util/ProgressChecker.o Util/RSA.o Util/Random.o Util/Registry.o Util/SHA1.o Util/SHA2_256.o Util/SSL_Connection.o Util/Security_General.o Util/Sql.o Util/SqlLite.o Util/StaticHashTable.o Util/SymmetricKey.o Util/System.o Util/TCP_Connection.o Util/TCP_Server.o Util/Threading.o Util/Timer.o Util/URL.o Util/UUID.o Util/Utils.o Util/Volumes.o Util/WindowsNetworkDevice.o Util/WindowsThreads.o Util/X509.o Util/X509Request.o Util/linked_list.o Util/network_objects.o Util/regex.o Util/sqlite3.o Util/str.o Util/test.o Util/utf8.o Util/wchar_t.o Util/xml.o delta.o git.o
    /usr/bin/ranlib: file: ./libRain.a(Machines.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(Triggers.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(Registry.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(Utils.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(Volumes.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(WindowsNetworkDevice.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(WindowsThreads.o) has no symbols
    g++  -m32 -g  -L. -o ./Rain Rain.cpp -lRain -lgit2 -liconv -lpthread -lpcap -lm -lssl -lcrypto -lodbc -framework CoreFoundation -framework CoreServices
    warning: (i386) ./libRain.a(Install.o) object file './libRain.a(Install.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Notifications.o) object file './libRain.a(Notifications.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(RainDirectory.o) object file './libRain.a(RainDirectory.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(ResourceShare.o) object file './libRain.a(ResourceShare.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Resources.o) object file './libRain.a(Resources.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Server.o) object file './libRain.a(Server.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Tags.o) object file './libRain.a(Tags.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Transaction.o) object file './libRain.a(Transaction.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(ArrayList.o) object file './libRain.a(ArrayList.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Buffer.o) object file './libRain.a(Buffer.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Connection.o) object file './libRain.a(Connection.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(DateTime.o) object file './libRain.a(DateTime.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Directory.o) object file './libRain.a(Directory.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(EventHandler.o) object file './libRain.a(EventHandler.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(File.o) object file './libRain.a(File.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(HttpRequest.o) object file './libRain.a(HttpRequest.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(HttpResponse.o) object file './libRain.a(HttpResponse.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Http_Headers.o) object file './libRain.a(Http_Headers.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Http_Message.o) object file './libRain.a(Http_Message.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Http_client.o) object file './libRain.a(Http_client.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Iterator.o) object file './libRain.a(Iterator.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(NetworkDevice.o) object file './libRain.a(NetworkDevice.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(PosixThreads.o) object file './libRain.a(PosixThreads.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(RSA.o) object file './libRain.a(RSA.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Random.o) object file './libRain.a(Random.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(SHA1.o) object file './libRain.a(SHA1.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Sql.o) object file './libRain.a(Sql.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(SqlLite.o) object file './libRain.a(SqlLite.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(TCP_Server.o) object file './libRain.a(TCP_Server.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Threading.o) object file './libRain.a(Threading.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(Timer.o) object file './libRain.a(Timer.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(URL.o) object file './libRain.a(URL.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(UUID.o) object file './libRain.a(UUID.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(linked_list.o) object file './libRain.a(linked_list.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(regex.o) object file './libRain.a(regex.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(sqlite3.o) object file './libRain.a(sqlite3.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(str.o) object file './libRain.a(str.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(utf8.o) object file './libRain.a(utf8.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(wchar_t.o) object file './libRain.a(wchar_t.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(delta.o) object file './libRain.a(delta.o)' doesn't contain architecture information for i386.
    warning: (i386) ./libRain.a(git.o) object file './libRain.a(git.o)' doesn't contain architecture information for i386.
    
    User@MacBook-Pro:~/$ rm libRain.a
    
    User@MacBook-Pro:~/$ make
    ar rcs ./libRain.a DirectoryMonitor.o Install.o Machines.o Notifications.o RainDirectory.o ResourceShare.o Resources.o RowTransferProtocol.o Server.o Tags.o Transaction.o Triggers.o Util/ArrayList.o Util/ArrayList64.o Util/Buffer.o Util/CPU.o Util/CircularBuffer.o Util/Connection.o Util/DateTime.o Util/Directory.o Util/DownloadManager.o Util/EventHandler.o Util/ExtendibleHashTable.o Util/FILE_buffer.o Util/File.o Util/HttpRequest.o Util/HttpResponse.o Util/Http_Headers.o Util/Http_Message.o Util/Http_client.o Util/Iterator.o Util/JSON.o Util/Log.o Util/MD5.o Util/NetworkDevice.o Util/PosixThreads.o Util/ProgressChecker.o Util/RSA.o Util/Random.o Util/Registry.o Util/SHA1.o Util/SHA2_256.o Util/SSL_Connection.o Util/Security_General.o Util/Sql.o Util/SqlLite.o Util/StaticHashTable.o Util/SymmetricKey.o Util/System.o Util/TCP_Connection.o Util/TCP_Server.o Util/Threading.o Util/Timer.o Util/URL.o Util/UUID.o Util/Utils.o Util/Volumes.o Util/WindowsNetworkDevice.o Util/WindowsThreads.o Util/X509.o Util/X509Request.o Util/linked_list.o Util/network_objects.o Util/regex.o Util/sqlite3.o Util/str.o Util/test.o Util/utf8.o Util/wchar_t.o Util/xml.o delta.o git.o
    /usr/bin/ranlib: file: ./libRain.a(Machines.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(Triggers.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(Registry.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(Utils.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(Volumes.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(WindowsNetworkDevice.o) has no symbols
    /usr/bin/ranlib: file: ./libRain.a(WindowsThreads.o) has no symbols
    g++  -m32 -g  -L. -o ./Rain Rain.cpp -lRain -lgit2 -liconv -lpthread -lpcap -lm -lssl -lcrypto -lodbc -framework CoreFoundation -framework CoreServices
    

0 个答案:

没有答案