Build z3 as static library instead of DLL - z3

How can I build Z3 as an static library? I have seen that there is
--staticlib build Z3 static library.
in the python mk_util.py but it seems that it doesn't do anything.
It still creates the dll (almost 11Mb) and the lib that doesn't have all the code since it's only 145Kb.
Thank you

Yes, that's a known issue. Try deleting the .lib and .dll and run nmake again. In some cases it works the second time around.
Edit: I added a new entry in our issue tracker so we don't forget to fix this (here).

Related

recompile existing objective c library to support arm8

One of the project we are currently working on uses a static objective-c library created by an ex employee.
The problem we have is that the library was built for arm7 which has 32 bit architecture. Is there a way to recompile for new architecture. It seems like a long shot though.
___Edited I don't have the source code.
Do you have the source code and Xcode project? If so, the answer is yes. As mah says, you may have to refactor the project for the latest IDE.
If you don't have the source code then the answer is a resounding "NO!" Compiling means converting source code into machine code. No source code = nothing to compile. You might be able to analyze the machine code and reverse-engineer it, but that's a horrific amount of work.

Missing opencv_core248d.dll

I'm trying to install OpenCV 2.4.8. Turns out this is far more complicated as expected. The tutorials are all outdated. Here is my current problem:
I'm running on a 64 bit machine, and am trying just a simple sample code:
#include <opencv\cv.h>
#include <opencv\highgui.h>
using namespace cv;
int main() {
Mat image;
VideoCapture cap;
cap.open(0);
namedWindow("window",1);
while(true) {
cap >> image;
imshow("window", image);
waitKey(33);
}
return 0;
}
When I run this, I get an error stating that opencv_core248d.dll is missing. Checking the bin directory, it's there. How do I fix this?
Regards
Edit: I've been on this issue for the past 3 hours. Whoever can help me solve this issue will get so much rep and love from me...seriously I'm getting desperate
Edit2: Picture of some settings:
OPENCV_BUILD = C:\OpenCV\build\
You are running into OpenCV dll issues, similar to here. Three ways to fix dll-related issues about OpenCV, also works for other dll related issues.
copy the required dlls into the same folder with your application. This is a little better because it kind of prepares you for when you'll need to deploy your application on systems that don't have OpenCV installed (for then don't forget to build the release version of your application).
add the dll path to Debugging Environment: Project –> Properties –> Configuration Properties –> Debugging –> Environment –> add dlls' paths here. The syntax is NAME=VALUE and macros can be used (for example, $(OutDir)).
For example, to prepend C:\Windows\Temp to the PATH: PATH=C:\WINDOWS\Temp;%PATH%
Similarly, to append $(SolutionDir)\DLLS to the PATH: PATH=%PATH%;$(SolutionDir)\DLLS
add the dll path to Environment Variables (be careful that the path in there are separated by ;)
EDIT: Among the three methods, the first two will only work for this project (local) and the last one works for all projects in your PC (global).
Have you tried adding C:\OpenCV2.0\bin to your PATH variables? Yup, installing OpenCV can be a chore :/
Have you done the proper project setup, like adding source library, source directories etc? Anyway, if my guess if right, the following will resolve that particular error:
Go to your project properties, Linker -> Input -> Additional Dependencies, add opencv_core248d.dll in and compile. If a new error appears, means you have yet to do the proper configurations.
EDIT: to comments
Here, the include directories and library directories. Did you add the relevant build/include & \lib into to the include and library directory respectively? This are some of the "configuration" that need to be done.
EDIT2: TO answer your edit
Yup, looks like you did do the configurations. Was confused by your comments.
1) I am not really sure if $(OPENCV_BUILD) will work. Maybe you would like to try C:\OpenCV2.4\lib, (link directly) etc instead of that.
2)Go to your linker input and edit the additional dependencies to this (image from one of the books I have):
Hope it works. And don't worry. I know how you feel. I was stuck at installing OpenCV for almost a week, and only one guy's youtube video saved me. I needed to edit some header files. But it's a different problem from yours. Good luck and hope my method work.
EDIT3: Hopefully this solve your problem, try these.
1) If you are using the "band-aid" method, which means having to copy paste the dll files every time, my suspicion would be that your PATH variables is wrong. Just double check it.
the equivalent for yours would be something like(the path of where you copied the dll files from/the path of the library directories you added inside the property page. But instead of lib at the end, you use the bin folder):
C:\OpenCV2.3\build\x86\vc10\bin
More details on this : Setting window path
If you have done this, just check that you have separated them with a semi-colon.
2) Not sure if this is really the solution for missing .dll file, if I remember correctly, it's more for linking errors. But give it a shot if step 1 doesn't work, or if step one works and you face another error. At the most, you can just undo it.
For each header files, for instance the core.hpp file, add the following lines:
#pragma comment(lib,"opencv_core248.lib")
#pragma comment(lib,"opencv_core248d.lib")
This need to be done for all the header files you use. Where to place it? I place mine here:
This goes the same for highgui.hpp, etc, but you change the name, so #pragma comment(lib,"opencv_core248.lib") becomes #pragma comment(lib,"opencv_highgui248.lib", etc...
Hope all goes well. I think if the path variable, but if not and 2nd method doesn't work, I have no clues anymore.

Link two seperate cocoa touch projects

i have this problem for a while now. I have iPhone project which was built with non ARC. And now somehow i need to add another smaller project to it, but that project was built with ARC. I have tried to copy files one by one, but ass soon as i was done, i got lots of ARC errors and some with Security.framework... Can someone help me? Or give me some ideas how should i proceed?
I have tried this but it didnt solvet issius with ARC...
ARC is done at compile time. ARC-enabled source code files need to be compiled with ARC, non-ARC source files need to be compiled without. It is a s simple as that. ARC is nothing but syntactic sugar injected by the compiler.
I have had this problem with some third parties not entirely migrated to ARC. Just create a static library around these files.
You could also try to change the per-file compiler options (see this question: How to disable ARC for a single file in Xcode 5?), but I would recommend against it since it will just become a maintenance burden in the end.
And of course, if it is your source code and not some third party: Migrate it to ARC. It is worth it.

Does OpenCV need to be compiled before using?

I'm trying to install OpenCV on Windows. Following are how I installed it:
Download OpenCV 2.4.2.exe from sourceforge.
unarchived it.
open Eclipse CDT.
Add C:/opencv/include/opencv to "Includes"
Add opencv_highgui, opencv_core, opencv_ml... to "Libraries"
Create a small project and compiled it.
The compiler complained about "opencv2/core/core_c.h:No such file or directory"...
I remember that when I install OpenCV on Ubuntu, I did compiled the project (it took quite a bit of time). Do I have to do the same thing on Windows? Or is any other thing causing this error?
Thanks.
You should add correct directories to includes.
Since you added C:/opencv/include/opencv, there is no way for compiler to find C:/opencv/include/opencv2/core/core.h.
I believe you should enter C:/opencv/include/ to includes directories as well.

How do I get XCode4 to find libgcov.a

I've been building a static library to share between multiple iOS projects, and I want to use gcov (or any code coverage analysis tool) to tell me where I'm missing my tests. However, when I enable gcov by following these directions: http://supermegaultragroovy.com/blog/2005/11/03/unit-testing-and-code-coverage-with-xcode/
I get this error from Libtool:
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: can't locate file for: -lgcov
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/libtool: file: -lgcov is not an object file (not allowed in a library)
For some reason XCode4 can't find the libgcov.a file. It is in many places on my system but for some reason it can't be found. I'm fairly new to XCode, and gcc based programming in general, so I'm not sure how I can fix this, my guess is that I just have to tell it specifically where to find libgcov.a but I'm not sure how to go about that.
Looks like I found a solution. Crazy XCode seems to treat static libraries completely different when invoking gcc. And I thought MSBuild was a build system from hell... it's a snap and at least there are books about it.
Anyway, here's how you do it:
Add $(PLATFORM_DEVELOPER_USR_DIR)/lib to your "Library Search Paths" build setting for your static library and tick the "Recursive" check box.
Works for me, let me know if it works for you.
This may help in solving your issue, have a look in to it
GTM

Resources