我有大量的功能,总共大约2.8 GB的目标代码(遗憾的是,没有办法,科学计算......)
当我尝试链接它们时,我得到(预期的)relocation truncated to fit: R_X86_64_32S错误,我希望通过指定编译器标志来避免这些错误-mcmodel=medium.我控制的所有链接的库都使用该-fpic标志进行编译.
仍然,错误仍然存在,我认为我链接到的一些库不是用PIC编译的.
这是错误:
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x12): relocation truncated to fit: R_X86_64_32S against symbol `__libc_csu_fini' defined in .text section in /usr/lib64/libc_nonshared.a(elf-init.oS)
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x19): relocation truncated to fit: R_X86_64_32S against symbol `__libc_csu_init' defined in .text section in /usr/lib64/libc_nonshared.a(elf-init.oS)
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib64/crti.o: In function `call_gmon_start':
(.text+0x7): relocation truncated to fit: R_X86_64_GOTPCREL against undefined symbol `__gmon_start__'
/usr/lib/gcc/x86_64-redhat-linux/4.1.2/crtbegin.o: In function `__do_global_dtors_aux': …Run Code Online (Sandbox Code Playgroud) 用Java构建多语言应用程序.从R.string资源XML文件插入String值时出错:
public static final String TTT = (String) getText(R.string.TTT);
Run Code Online (Sandbox Code Playgroud)
这是错误消息:
错误:无法从Context类型对非静态方法getText(int)进行静态引用
这是怎么造成的,我该如何解决?
我经常在我的代码中使用null传播运算符,因为它给了我更多可读代码,特别是在长查询中我不必对每个使用的类进行空值检查.
以下代码抛出一个编译错误,我们不能在lambda中使用null传播运算符.
var cnt = humans.AsQueryable().Count(a => a.House?[0].Price == 5000);
Run Code Online (Sandbox Code Playgroud)
错误 :
错误CS8072表达式树lambda可能不包含空传播运算符.
C#如果真的不能做任何其他事情,可以轻松地将上面的代码转换为代码到下面的代码!
var cnt = humans.AsQueryable().Count(a => a.House != null && a.House[0].Price == 5000);
Run Code Online (Sandbox Code Playgroud)
我很好奇为什么C#什么也不做,只是抛出一个编译器错误?
我有一些测试工作正常.然后,我将它移动到另一个包,现在我遇到了错误.这是代码:
import static org.junit.Assert.*;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import org.jgrapht.Graphs;
import org.jgrapht.WeightedGraph;
import org.jgrapht.graph.DefaultWeightedEdge;
import org.jgrapht.graph.SimpleWeightedGraph;
import org.junit.*;
@Test
public void testEccentricity() {
WeightedGraph<String, DefaultWeightedEdge> g = generateSimpleCaseGraph();
Map<String, Double> eccen = JGraphtUtilities.eccentricities(g);
assertEquals(70, eccen.get("alpha"));
assertEquals(80, eccen.get("l"));
assertEquals(130, eccen.get("l-0"));
assertEquals(100, eccen.get("l-1"));
assertEquals(90, eccen.get("r"));
assertEquals(120, eccen.get("r-0"));
assertEquals(130, eccen.get("r-1"));
}
Run Code Online (Sandbox Code Playgroud)
错误消息是这样的:
方法assertEquals(Object,Object)对于JGraphtUtilitiesTest类型是不明确的
我怎样才能解决这个问题?为什么在将类移到另一个包时会出现此问题?
所以我正在编写一个需要访问注册表的应用程序.我没有触及任何构建设置,希望在添加其他触摸(例如描述或名称)之前让事情正常工作.
出乎意料的是,我得到了一个不会消失的错误.ClickOnce does not support the request execution level 'requireAdministrator'.现在,我没有在这个应用程序中触及ClickOnce.我所做的就是包括一个请求这些权限的清单文件.
我现在的问题是这个错误不会消失,我无法编译我的程序.关于该怎么做的任何建议?(旁注:我准备去睡觉了,明天下午我会检查一下).
我正在使用Ubuntu并安装了Python 2.7.5和3.4.0.在Python 2.7.5中,我能够成功分配变量x = Value('i', 2),但不能在3.4.0中分配.我正进入(状态:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.4/multiprocessing/context.py", line 132, in Value
from .sharedctypes import Value
File "/usr/local/lib/python3.4/multiprocessing/sharedctypes.py", line 10, in <
module>
import ctypes
File "/usr/local/lib/python3.4/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ImportError: No module named '_ctypes'
Run Code Online (Sandbox Code Playgroud)
我刚刚通过安装3.4.0的源代码更新到3.3.2.它安装在/usr/local/lib/python3.4中.
我是否正确更新到Python 3.4?
有一点我注意到Python 3.4安装在usr/local/lib中,而Python 3.3.2仍然安装在usr/lib中,所以它没有被覆盖.
python install compiler-errors failed-installation python-3.4
Java中的代码是否有任何最大大小?我写了一个超过10,000行的函数.实际上,每一行都为数组变量赋值.
arts_bag[10792]="newyorkartworld";
arts_bag[10793]="leningradschool";
arts_bag[10794]="mailart";
arts_bag[10795]="artspan";
arts_bag[10796]="watercolor";
arts_bag[10797]="sculptures";
arts_bag[10798]="stonesculpture";
Run Code Online (Sandbox Code Playgroud)
在编译时,我收到了这个错误:代码太大了
我该如何克服这个问题?
我正在尝试编译使用g++和-std=c++11或c++0x标志.
但是,我收到此错误
cc1plus: error: unrecognized command line option "-std=c++11"
Run Code Online (Sandbox Code Playgroud)
g ++ --version
g++ (GCC) 4.1.2 20080704 (Red Hat 4.1.2-54)
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Run Code Online (Sandbox Code Playgroud) 当我尝试在Win32或x64模式下使用Visual Studio 2010编译我的c ++项目时,我收到以下错误:
>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(135): fatal error C1189: #error : "No Target Architecture"
我的预处理器定义说WIN32; _DEBUG; _CONSOLE;%(PreprocessorDefinitions)
导致此错误的原因是什么?如何解决?
// winnt.h: lines 127-136, MSVS says this is an inactive preprocessor block
#if defined(_WIN64)
#if defined(_AMD64_)
#define PROBE_ALIGNMENT( _s ) TYPE_ALIGNMENT( DWORD )
#elif defined(_IA64_)
#define PROBE_ALIGNMENT( _s ) (TYPE_ALIGNMENT( _s ) > TYPE_ALIGNMENT( DWORD ) ? \
TYPE_ALIGNMENT( _s ) : TYPE_ALIGNMENT( DWORD ))
#else
#error "No Target Architecture"
#endif
Run Code Online (Sandbox Code Playgroud)
更新:我创建了一个新的msvs项目并将我的代码复制到它.我不再拥有error : "No Target Architecture",但现在我有一堆涉及winnt.h和winbase.h的编译错误,并且没有涉及我的任何文件的编译错误.这些文件是否可能已损坏?我需要重新安装MSVS 2010吗?
更新2:所以我缩小了我的问题,发现它 …