我正在编写一个 CMakeLists.txt 文件来构建我的 C++ 项目,该项目由
问题是,libhybris.so 依赖于 libpcre (用于正则表达式功能),所以我有以下语句:
# libhybris.so generation
add_library( libhybris
SHARED
${LIB_SOURCES} )
...
# Needed libraries
target_link_libraries( libhybris
dl
pcre
pthread
readline )
Run Code Online (Sandbox Code Playgroud)
第 3 点中的共享库之一称为 pcre.so,因此我也有以下内容:
add_library( pcre SHARED ${PCRE_SOURCES} )
...
target_link_libraries( pcre
dl
pcre
curl
pthread
readline
ffi
libhybris )
Run Code Online (Sandbox Code Playgroud)
因此,当我运行“cmake .”时,出现以下错误:
-- Configuring done
CMake Error: The inter-target dependency graph contains the following strongly connected component (cycle):
"libhybris" of type SHARED_LIBRARY
depends on "pcre" …Run Code Online (Sandbox Code Playgroud) 我将开发一个项目,该项目使用JDepend自动生成循环包依赖关系的报告,作为CI构建的一部分.(我主要对包级依赖性感兴趣,所以我一直在使用XSLT的减少版本来获得更有针对性的报告 - 否则,它是vanilla JDepend.)
但是我们即将把项目移到Java 8,我发现JDepend对使用JDK 1.8编译器编译的代码不起作用.JDepend似乎不再正在积极更新.
我正试图找到一个替代品:
我正在使用"打结"技术研究Haskell中的图形式事物处理.我想,循环列表只是一种无限列表内部实现,所以在理想世界中我们不应该关心subj.但它可能会对计算复杂性产生巨大影响,请考虑具有循环世界的一维元胞自动机示例:
ribbon = let x = 0 : y
y = 1 : x
in x
update_cycle :: Num a => [a] -> [a]
update_cycle lst@(_:xs) = ( f lst : update_cycle xs)
update_cycle [] = error "infinite cycle assumed"
f :: Num a => [a] -> a -- some arbitrary list reduction
f (x:(y:_)) = traceShow "f called" $ x - y
Run Code Online (Sandbox Code Playgroud)
这是一个只有两个单元格的循环.让我们迈出一步:
*Main> take 2 $ update_cycle ribbon
[-1,1]
"f called"
"f called"
Run Code Online (Sandbox Code Playgroud)
多数民众赞成,现在有两个步骤:
*Main> take 2 $ …Run Code Online (Sandbox Code Playgroud) haskell graph time-complexity tying-the-knot cyclic-dependency
是否有任何包或解决方案来检测 react native 中的循环依赖项导入?
[或者]
运行应用程序时,我可以获得循环导入的堆栈跟踪吗?
目前,循环依赖导入返回未定义的值,没有说明确切的问题。
谢谢!
我已经在不同的Angular版本中多次发现此问题,但是有多个消息来源说它已经得到解决,例如,关于Stackoverflow的另一个类似问题是有这个答案,它说它已在Angular 5.2中解决,在Github上还有其他问题在说在6.0.2中解决,我正在使用Angular 6.0.3,但是每当我尝试在HttpInterceptor类中注入使用HttpClient的服务时(仍然会收到一个问题)(如果在该请求中接收到jwt,则应该在请求中添加jwt令牌)服务)
我没有收到具有周期性依赖关系的警告或错误,请在浏览器控制台中看到数千个Interceptor正在调用服务的请求,反之亦然。
解决此问题的正确方法是什么?(最好不将jwt存储在本地存储中)
(即使用拦截器并从服务中获取jwt)
我的服务:
....
// only showing parts that matter, HttpClient is injected here
// to be used in calling the API services
constructor(public http: HttpClient, private route: ActivatedRoute,
public translate: TranslateService, private router: Router,
public snackBar: MatSnackBar, private notification: NotificationService) {
//
Run Code Online (Sandbox Code Playgroud)
我的HttpInterceptor:
import { Observable } from 'rxjs';
import { Location } from '@angular/common';
import { Injectable, Injector } from '@angular/core';
import { HttpInterceptor } from '@angular/common/http';
import { …Run Code Online (Sandbox Code Playgroud) javascript cyclic-dependency angular-http-interceptors angular angular6
我最近开始开发一个 Java 项目,其中包含一些子项目。他们都是gradle。因此,假设有两个项目 A 和 B 已经实施。而且我要介绍另一个gradle项目C,依赖是这样的。
所以我需要在没有循环依赖错误的情况下实现这个项目 C,因为它是我尝试用 gradle 构建项目时给出的。我看到一些答案,Interface 是一个解决方案。但就我而言,项目 A 和 B 是大型项目,我无法考虑如何为它们引入接口。我唯一能做的就是为项目 C 引入接口。那么有没有办法解决我在这些情况下的问题?如果没有,有什么方法可以拥有这样的一个?请注意,这些 A、B、C 项目是单独的项目,因此不能合并为一个项目。
我正在阅读Guice文档,并且遇到了一个标记为" 消除循环(推荐)"的部分,这一部分引起了我的兴趣,因为这正是导致我今天阅读文档的问题.
基本上,为了消除循环依赖关系,您可以"将依赖关系案例提取到一个单独的类中".好的,那里没什么新鲜的.
所以,在这个例子中,我们有.
public class Store {
private final Boss boss;
private final CustomerLine line;
//...
@Inject public Store(Boss boss, CustomerLine line) {
this.boss = boss;
this.line = line;
//...
}
public void incomingCustomer(Customer customer) { line.add(customer); }
}
public class Boss {
private final Clerk clerk;
@Inject public Boss(Clerk clerk) {
this.clerk = clerk;
}
}
public class Clerk {
private final CustomerLine line;
@Inject Clerk(CustomerLine line) {
this.line = line;
}
void doSale() {
Customer …Run Code Online (Sandbox Code Playgroud) 我的老师给了我一个学习的代码,我无法弄清楚我何时typedef在地图上(正如我在代码中评论的那样)它工作得很好但是当我定义没有typedef它似乎不起作用.如果有人能够善意解释我会很感激!我读了一些关于"循环依赖"的内容,但不确定是否就是这种情况.
int main (){
map <string, string> ri; // typedef map<string, string> maps;
//maps ri;
ri.insert(pair<string, string>{"Smoljan", "Dragan"});
ri.insert(pair<string, string>{"Smolver", "Tina"});
ri.insert(pair<string, string>{"Mirkovic", "Sonja"});
string in;
cout<<"Input:";
cin>>in;
string high(in);
high.back()++;
auto low = ri.lower_bound(in);
/*(maps)*/ ri::key_compare comp; //<----- here is the error
//....
}
Run Code Online (Sandbox Code Playgroud) c++ ×2
java ×2
angular ×1
angular6 ×1
cmake ×1
gradle ×1
graph ×1
guice ×1
haskell ×1
java-8 ×1
javascript ×1
jdepend ×1
npm-scripts ×1
react-native ×1