当我尝试在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:所以我缩小了我的问题,发现它 …
运用
gcc -m32 myprog.c
Run Code Online (Sandbox Code Playgroud)
应该在32位版本中编译该文件myprog.c.
不幸的是我收到此错误:
In file included from /usr/include/stdio.h:27:0,
from myprog.c:1:
/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
#include <sys/cdefs.h>
Run Code Online (Sandbox Code Playgroud)
我怎么能解决这个问题?
如果我不使用-m32它工作,但使用64位指令.
尝试在登录期间使用send_keys()方法输入用户名.我想它能够找到输入元素,就像我跑到send_keys它工作之前一样.通过发送字符串值send_keys,它会引发错误.
selenium.common.exceptions.WebDriverException:消息:预期[对象未定义]未定义为字符串
我错过了什么?
Python:3.5
Selenium 3.3.1
Firefox Developer Edition或Nightly(当前版本> 52)
我的代码片段:
login_url = "https://korunet.co.nz/"
driver = webdriver.Firefox()
driver.get(login_url)
WebDriverWait(driver, 30).until(ec.visibility_of_element_located((By.CSS_SELECTOR, '#IDToken1')))
elem = driver.find_element_by_css_selector('#IDToken1')
elem.click()
elem.clear()
elem.send_keys("10101")
Run Code Online (Sandbox Code Playgroud)
Traceback(最近一次调用最后一次):
文件"D:/PycharmProjects/JCBbidEntry/tests/loop2.py",第29行,在elem.send_keys("10101")
文件"C:\ Users\BaruaR\AppData\Roaming\Python\Python35\site-packages\selenium\webdriver\remote\webelement.py",第347行,在send_keys中自我._execute(Command.SEND_KEYS_TO_ELEMENT,{'value':keys_to_typing(value)})
文件"C:\ Users\BaruaR\AppData\Roaming\Python\Python35\site-packages\selenium\webdriver\remote\webelement.py",第491行,在_execute中返回self._parent.execute(command,params)
文件"C:\ Users\BaruaR\AppData\Roaming\Python\Python35\site -packages\selenium\webdriver\remote\webdriver.py",第238行,执行self.error_handler.check_response(响应)
文件"C:\ Users\BaruaR\AppData\Roaming\Python\Python35\site-packages\selenium\webdriver\remote\errorhandler.py",第193行,在check_response中
引发exception_class(消息,屏幕,堆栈跟踪)
python-3.x selenium-firefoxdriver selenium-webdriver geckodriver
我面临的问题是,添加新项目时,计算的observable数组不会更新.
self.FilteredCityList = ko.computed(function() {
var filteredCollection = ko.utils.arrayFilter(self.CityListCollection(), function(r) {
var matchingItem = ko.utils.arrayFilter(self.LocationCollection(), function(r1) {
return r1.LocationCode() == r.LocationCode();
});
if (matchingItem.length > 0) {
return false;
}
return true;
});
return filteredCollection;
}, this);
Run Code Online (Sandbox Code Playgroud)
当我在self.LocationCollection()计算数组中添加项目时,不会更新.
例如:
item =['the dog is gone', 'the dog and cat is gone']
words= ['dog','cat']
Run Code Online (Sandbox Code Playgroud)
我希望能够过滤掉它dog,cat所以它会读取:
item=['the is gone', 'the and is gone']
Run Code Online (Sandbox Code Playgroud)
item1=[]
for w in words:
for line in item:
if w in line:
j=gg.replace(it,'')
item1.append(j)
Run Code Online (Sandbox Code Playgroud)
我得到以下内容:
['the is gone', 'the cat and is gone', 'the and dog is gone']
Run Code Online (Sandbox Code Playgroud) 我在c#中使用linq编写了这个代码用于日期范围过滤器.但是在服务器上得到这样的错误.我的本地代码工作得非常好,但在服务器上部署得到错误.
在这里我试试这段代码:
string fromDate = "15-03-2017";
string toDate = "17-03-2017";
DateTime FromDate = Convert.ToDateTime(fromDate);
DateTime ToDate = Convert.ToDateTime(toDate);
UserList = db.Users
.Where(t => DbFunctions.TruncateTime(t.datetime) >= FromDate
&& DbFunctions.TruncateTime(t.datetime) <= ToDate)
.OrderByDescending(a => a.datetime)
.ToList();
Run Code Online (Sandbox Code Playgroud)
我不知道我的错误在这个查询中的任何人都知道然后请让我知道如何解决这个问题.本地代码工作得很好,但服务器收到错误.
c++ ×2
c ×1
c# ×1
geckodriver ×1
knockout.js ×1
linux ×1
python ×1
python-3.x ×1
sorting ×1
string ×1
ubuntu ×1
visual-c++ ×1