小编Jac*_*lly的帖子

Apple Mach-O Librarian(libtool)错误,没有特定错误

我以前不得不处理大量的libtool错误,但我真的不知道如何处理一个没有给我提示的错误.

这是完整的错误:

 Libtool /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos/libRZFramework.a normal armv7
                        cd /Users/programmingstation7/Documents/CleanedFramework
                        setenv IPHONEOS_DEPLOYMENT_TARGET 5.0
                        setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
                        /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool -static -arch_only armv7 -syslibroot /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -L/Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos -L/Users/programmingstation7/Documents/CleanedFramework/.. -filelist /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Intermediates/RZFramework.build/Debug-iphoneos/RZFramework.build/Objects-normal/armv7/RZFramework.LinkFileList -lxml2 -ObjC -all_load -framework CoreData /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos/libarc.a /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos/libEISRenderHelpful.a -framework CFNetwork -framework MobileCoreServices -framework Security /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/libxml2.dylib /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/libz.dylib -framework CoreLocation -framework CoreText -framework UIKit -framework Foundation -framework CoreGraphics -framework MediaPlayer -framework QuartzCore -framework AVFoundation -framework OpenGLES -framework MapKit -framework MessageUI -framework SystemConfiguration -framework EventKit -framework EventKitUI -o /Users/programmingstation7/Library/Developer/Xcode/DerivedData/RZFramework-fglhxeoyynfgoxgrgpqwrywuaexk/Build/Products/Debug-iphoneos/libRZFramework.a

                        Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/libtool failed with exit code 1
Run Code Online (Sandbox Code Playgroud)

我正在使用链接器标志-lxml2 -ObjC -all_load

有关导致无异常libtool失败的原因的任何想法? …

xcode linker mach-o

5
推荐指数
1
解决办法
6162
查看次数

elisp:以批处理模式静音"正在加载"消息

即使我调用emacs -batch(即批处理模式而没有实际执行任何操作),emacs也会呕吐出一大堆消息:

$ emacs -batch
Loading 00debian-vars...
Loading /etc/emacs/site-start.d/50autoconf.el (source)...
Loading /etc/emacs/site-start.d/50cmake-data.el (source)...
Loading /etc/emacs/site-start.d/50devhelp.el (source)...
Loading /etc/emacs/site-start.d/50dictionaries-common.el (source)...
Loading debian-ispell...
Loading /var/cache/dictionaries-common/emacsen-ispell-default.el (source)...
Loading /var/cache/dictionaries-common/emacsen-ispell-dicts.el (source)...
Loading /etc/emacs/site-start.d/50psvn.el (source)...
Run Code Online (Sandbox Code Playgroud)

有没有办法让这些消息沉默?谷歌对此并没有太大的帮助.

emacs elisp

5
推荐指数
1
解决办法
996
查看次数

elisp中的match-string没有返回字符串匹配的字符串

我有一个问题,我在字符串匹配后无法获得匹配字符串.我认为字符串匹配有效,至少它返回非nil,但是当我尝试获取match-string时出现错误.我该怎么办?

失败的功能:

(defun small-test ()
  (string-match "\\([0-9]+\\)-v\\([0-9]+\\).txt" "2011-v9.txt")
  (message (match-string 1))
  )
Run Code Online (Sandbox Code Playgroud)

regex elisp

4
推荐指数
1
解决办法
1815
查看次数

C++::: ntohs()在更高的优化级别上失败

我有一个.cpp档案:htonstest.cpp.我g++用来编译它:

$ g++ -o test htonstest.cpp
Run Code Online (Sandbox Code Playgroud)

它工作,程序./test也有效.

但是,当我使用automake编译它时,有一个编译错误:

 htonstest.cpp: In function ‘int main()’: 
 htonstest.cpp:6: error?expected id-expression before ‘(’ token.
Run Code Online (Sandbox Code Playgroud)

我的操作系统是CentOS,gcc的版本是4.1.2 20080704,autoconf的版本是2.59,automake的版本是1.9.6.

重现:

$ aclocal
$ autoheader
$ autoconf
$ automake -a
$ ./configure
$ make
Run Code Online (Sandbox Code Playgroud)

ntohstest.cpp:

 #include <netinet/in.h>
 #include <iostream>

 int main()
 {
     short a = ::ntohs(3);
     std::cout << a << std::endl;
     std::cin.get();
     return 0;
 }
Run Code Online (Sandbox Code Playgroud)

configure.ac:

 AC_PREREQ(2.59)
 AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS)
 AC_CONFIG_SRCDIR([htonstest.cpp])
 AC_CONFIG_HEADER([config.h])
 AM_INIT_AUTOMAKE([foreign])
 # Checks for programs.
 AC_PROG_CXX

 # Checks for …
Run Code Online (Sandbox Code Playgroud)

c++ linux automake autoconf

4
推荐指数
1
解决办法
1842
查看次数

Makefile - 模式规则

我是编写 makefile 的新手。最近我在 makefile 中看到了模式规则。例如:

%.o: %.cc
        # command to compile comes here
Run Code Online (Sandbox Code Playgroud)

经过在网上的严格搜索,我发现了上面的语句的作用,但是我遇到了下面的另一个语句。

%: %.o
        # Command to link lies here
Run Code Online (Sandbox Code Playgroud)

我不明白这个规则。谁能解释一下第二个模式规则?

makefile

3
推荐指数
1
解决办法
461
查看次数

使用单个安装生成静态库和可执行文件(autoconf)

我知道如何构建项目或如何使用autoconf创建库.

我想要实现的是生成一个静态库并使用该库在单个configure/make/make install运行中构建项目.

我想将一些源文件放入库中,其余的要使用这个库进行编译.

如何修改makefile.am文件和configure.ac以使其正常工作?

c++ automake autoconf static

2
推荐指数
1
解决办法
4394
查看次数

错误预期';' 在实例之前

快速概述我是如何做到这一点的.

  1. 创建了结构
  2. 创建.cpp文件
  3. 使用CMake创建Make文件
  4. 使接收的错误

我正在尝试编译以下代码:

#include <iostream>
using namespace std;

enum UnitType { Meter, Inch };
class Meter {
    double value;

    public:
        Meter(double value) : value(value) {}
        double convertTo(UnitType unit) {
            if (unit == Inch) {
                return value * 39.3700787;
            }   
        };  
};

int main (int argc, char *argv[])
{
    try 
    {   
        Meter meter(1.0);
    }
    catch (int e) {
        cout << "exception " << e << endl;
    }

    return 0;
} …
Run Code Online (Sandbox Code Playgroud)

c++

2
推荐指数
1
解决办法
1313
查看次数

如何在MS DOS批处理文件(Windows 7)中将变量用作目录名的一部分?

例如,如果我在批处理文件中设置变量var等于20110804(SET var = 20110804),那么我想使用此变量导航到C:\ folder\20110804之类的目录.

我的想法是写一个这样的批处理文件:

SET var = 20110804

c:
cd \folder\%var%
Run Code Online (Sandbox Code Playgroud)

但是,当我运行这个程序时,批处理文件实际上只是忽略了%var%部分并将我发送给了C:\folder\.

有小费吗?

dos

1
推荐指数
1
解决办法
1844
查看次数

如何验证是否定义了宏,否则停止make?

由于未定义的变量只是简单地用空文本替换(考虑目标目录),因此可能导致意外行为,是否有办法检查变量是否未定义并在这种情况下停止并出现错误?

可以使用条件检测条件,但是如何停止执行?

ifeq ($(strip $(notdefinedforsure_man)),)
out = Undefined variable detected
endif
Run Code Online (Sandbox Code Playgroud)

我正在寻找像requiredef var1,var2这样的东西

或者在上述条件中使用的带有错误陈述的简单回报

gnu-make

1
推荐指数
1
解决办法
248
查看次数

如果我将字符串复制到NULL指针上,为什么C++不会打印任何内容?

我只是想试试这段代码......

#include <iostream>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>

using namespace std;

int main() {
      char *outFile1 = NULL;
      char *outFile2 = NULL;
      cout << "HI";
      outFile1 = "//tmp//Softwares//v//vdisk";
      strcpy(outFile2, outFile1);
      cout << "HI";
}
Run Code Online (Sandbox Code Playgroud)

如果我运行此代码......没有任何内容被打印.如果我评论"strcpy(outFile2,outFile1);"......两个"HI"都被打印出来.为什么这样?它并没有给我任何错误.

c++ string pointers

0
推荐指数
1
解决办法
131
查看次数

标签 统计

c++ ×4

autoconf ×2

automake ×2

elisp ×2

dos ×1

emacs ×1

gnu-make ×1

linker ×1

linux ×1

mach-o ×1

makefile ×1

pointers ×1

regex ×1

static ×1

string ×1

xcode ×1