porting

extern “C” char** environ - Windows - C++/CLI

半城伤御伤魂 提交于 2019-12-08 03:15:23
问题 I have some old linux code I'm trying to port to Windows. When I first built it as a straight native DLL, I go no issues with this piece of code, but when I tried making it a mixed-mode C++/CLI DLL, I got an unresolved external object error on this: extern "C" char** environ; Why would this work for native and not CLI? Any idea how to work around this, or what it even does? 回答1: That holds the environment variables (PATH, etc, etc). The C standard (if i recall correctly) requires environ to

Porting a sub-class of python2 'file' class to python3

走远了吗. 提交于 2019-12-08 02:36:33
问题 I have a legacy code that calls class TiffFile(file) . What is the python3 way to call it? I tried to replace following in python2: class TiffFile(file): def __init__(self, path): file.__init__(self, path, 'r+b') By this in python3: class TiffFile(RawIOBase): def __init__(self, path): super(TiffFile, self).__init__(path, 'r+b') But now I am getting TypeError: object.__init__() takes no parameters 回答1: RawIOBase.__init__ does not take any arguments, that is where you error is. Your TiffFile

Good LDAP library for BlackBerry?

流过昼夜 提交于 2019-12-07 23:32:34
I am looking for nice Java LDAP library suitable for using on BlackBerry. There is some basic support for LDAP in BlackBerry Java SDK, however it is too basic and I would like to use direct TCP connections instead of MDS (MDS is the only transport option when using LDAP classes from standard BB SDK). Regarding features I basically want to search some users and their attributes. To put it simple we can assume I am building a telephone book, but the clients are only reading entries from the server, not adding anything. If there is no LDAP lib ready-to-run on BlackBerry, a Java library could work

Porting to Python3: PyPDF2 mergePage() gives TypeError

↘锁芯ラ 提交于 2019-12-07 16:29:29
问题 I'm using Python 3.4.2 and PyPDF2 1.24 (also using reportlab 3.1.44 in case that helps) on windows 7. I recently upgraded from Python 2.7 to 3.4, and am in the process of porting my code. This code is used to create a blank pdf page with links embedded in it (using reportlab) and merge it (using PyPDF2) with an existing pdf page. I had an issue with reportlab in that saving the canvas used StringIO which needed to be changed to BytesIO, but after doing that I ran into this error: Traceback

Porting Qt4 to Qt5: unresolved external symbols

牧云@^-^@ 提交于 2019-12-07 12:58:46
问题 Qt5 is the new generation of Qt and it has some changes. I have a project building well with Qt4. I've downloaded Qt5-VisualStudio2010 package and I'm trying to port my project from Qt4 to Qt5. Problems arise. All 'include' paths have been fixed well. However, the compiler now reports hundreds of 'unresolved external symbols' (almost all function calls, sounds like the compiler can't find any .lib file). I even tried to add all .lib files found in the Qt SDK folder, but useless. The most

How to get 'file creation time' in Linux

微笑、不失礼 提交于 2019-12-07 10:41:00
问题 I need to find out at what time and date a file has been created using C++ in Linux. 回答1: How do I get the date a file was last modified?. struct stat attrib; //1. create a file attribute structure stat("file_name", &attrib); //2. get the attributes of afile.txt clock = gmtime(&(attrib.st_mtime)); //3. Get the last modified time and // put it into the time structure 4.8 File Times Update: In Linux: three distinct timestamps associated with a file: time of last access of contents ( atime ),

C++ - Defining class template (header/source file)

大城市里の小女人 提交于 2019-12-06 13:29:46
问题 I want to create a processor in voreen (like this one .cpp | .h) porting this OTB-Application: http://hg.orfeo-toolbox.org/OTB/file/ca4366bb972e/Applications/Segmentation/otbSegmentation.cxx I have coded almost all the parameters into properties, etc but.. If you look at like 376, you'll see a class template of FloatVectorImageType::SizeType, a typedef type. Im not familiar with c++ templates so my first question was where should I put this template's implementation, in the .cpp or .h file of

Porting Visual C/C++ to Android

泪湿孤枕 提交于 2019-12-06 11:53:09
问题 In my recently started internship (I'm studying computer science), I have to port a somewhat big existing Project to Android. It is a Visual C/C++ Project which in the end should run on Android using of course the NDK. The problem is that I don't know a thing about porting software, since this is not covered in my studies... I had a few days to get to know the project I will be working with a little. A few words about the complexity: It is a Visual Studio solution which consists of 28

Porting Chrome Extension with multiple app pages to Firefox

ぃ、小莉子 提交于 2019-12-06 09:09:35
问题 Chrome I have a Chrome Extension that behaves like a web app (apart from using chrome.* APIs and Cross-Origin Requests) with multiple html pages which all use the background.html to communicate with a NPAPI plugin. The extension's structure (from the extension's root) is as follows: background.html plugin/ (NPAPI plugin bundles) frontend/ main.html foo.html bar.html .. The background.html is loaded upon extension install and loads the NPAPI plugin, running indefinitely (until browser closes

glibc not supported by Cygwin

被刻印的时光 ゝ 提交于 2019-12-06 05:37:11
问题 Cygwin FAQ has the following info for 'Where is glibc?' : Cygwin does not provide glibc. It uses newlib instead, which provides much (but not all) of the same functionality. Porting glibc to Cygwin would be difficult. I was surprised and checked out the release packages as i had earlier used it. While i checked the repositories, it appears that glibc was actually indeed part of cygwin until version 2.10. Can anyone tell of the porting difficulty for the subsequent versions of glibc ? 回答1: The