我以前不得不处理大量的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失败的原因的任何想法? …
即使我调用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)
有没有办法让这些消息沉默?谷歌对此并没有太大的帮助.
我有一个问题,我在字符串匹配后无法获得匹配字符串.我认为字符串匹配有效,至少它返回非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) 我有一个.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) 我是编写 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)
我不明白这个规则。谁能解释一下第二个模式规则?
我知道如何构建项目或如何使用autoconf创建库.
我想要实现的是生成一个静态库并使用该库在单个configure/make/make install运行中构建项目.
我想将一些源文件放入库中,其余的要使用这个库进行编译.
如何修改makefile.am文件和configure.ac以使其正常工作?
快速概述我是如何做到这一点的.
我正在尝试编译以下代码:
#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) 例如,如果我在批处理文件中设置变量var等于20110804(SET var = 20110804),那么我想使用此变量导航到C:\ folder\20110804之类的目录.
我的想法是写一个这样的批处理文件:
SET var = 20110804
c:
cd \folder\%var%
Run Code Online (Sandbox Code Playgroud)
但是,当我运行这个程序时,批处理文件实际上只是忽略了%var%部分并将我发送给了C:\folder\.
有小费吗?
由于未定义的变量只是简单地用空文本替换(考虑目标目录),因此可能导致意外行为,是否有办法检查变量是否未定义并在这种情况下停止并出现错误?
可以使用条件检测条件,但是如何停止执行?
ifeq ($(strip $(notdefinedforsure_man)),)
out = Undefined variable detected
endif
Run Code Online (Sandbox Code Playgroud)
我正在寻找像requiredef var1,var2这样的东西
或者在上述条件中使用的带有错误陈述的简单回报
我只是想试试这段代码......
#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"都被打印出来.为什么这样?它并没有给我任何错误.