I need to generate a pdf from a c++ application. I am using Xcode and I would like to stick to that. Possibly the solution needs to be opensource. I already tried a few, but ecountered issues:
I tried podofo but I had some issues when building it - it seems that does not work on OS X.
I wanted to use ClibPDF, but that is no more available for download.
When including PDFlib oder PDFlib Lite in my projects that does not work either, I get some strange memory errors on runtime.
Has anyone an idea what could be used with C++/XCode for pdfs? Thanks in advance!
To create a podfo Xcode project use the following in Terminal:
cmake -G "Xcode" -DWANT_FONTCONFIG:BOOL=YES -DCMAKE_INSTALL_PREFIX=/opt/podofo -DCMAKE_INCLUDE_PATH=/opt/local/include -DCMAKE_LIBRARY_PATH=/opt/local/lib ../podofoSrcDir
The Mac OS X drawing library, Quartz, supports PDF natively.
Related
I have a C++ module on windows which I want to compile such that I get a dynamic library for linux *.so.
Does a cross-compiler exist that can help me out?
Several comments mentioned using Windows Subsystem for Linux. I would personally recommend this as it is far easier than trying to use a cross-compiler. It also comes with the added benefit that you can test your code in the same environment in which you compile it.
https://learn.microsoft.com/en-us/windows/wsl/about is a great resource for getting started with WSL.
I've downloaded wxWidgets - wxwidgets.org
I ran the configure file using terminal.
How can I use this framework with Xcode C++ project?
Thanks!
Please take a look at the following documentation, or consider pin pointing down a more specific question about using the framework (ie, what problems you may have run into).
http://wiki.wxwidgets.org/Development:_wxMac
http://wiki.wxwidgets.org/Guides_%26_Tutorials#Mac_OS
http://wiki.wxwidgets.org/Creating_Xcode_projects_for_wxWidgets_applications (Out of date, but may still help you. As someone who used wxWidgets in the past, I can tell you that the code is correct).
A group of students and I are making a C++ game, but they have Windows and I have a Mac is there something we can use to share code between the systems?
I know Eclipse will work but I get Unresolved conclusion: <iostream> as an error. If anyone can help with that it would be great.
If you want something to actually "share the code" with, I would recommend git using github as the remote location. Its free and easy to use.
If your question is about the code not working, make sure you have X11 configured properly, and have the Eclipse C++ plugin installed.
And I would also recommend using XCode as your editor instead of Eclipse. It has a much better environment for C++, IMHO.
Hope this helps.
Personally I'd recommend setting up a cross-platform build process using something like CMake (http://www.cmake.org). CMake in particular will generate platform-specific project files for you -- so your friends could be working in Visual Studio and you could be working in Eclipse or XCode, with no problems at all (of course, you'd have to write portable code... :))
As far as sharing code and version control goes, I agree with Jon that something like git is ideal.
We build our Windows+Mac+Linux apps using Qt, which includes a nice build system (qmake) and cross-platform APIs (so the same code will run on all OS's) and an IDE (which I haven't used but I hear is okay).
With multiple developers you'll definitely want some sort of source-code-management system as well, git and svn are both good choices there.
I have recently started learning C++, but I require a compiler. I have tried the one packaged with Code::Blocks, but I have been told it is out of date.
I have tried reading the instructions on the website, but I simply don't know which files to download and un-zip. Is there a list of files to download? (latest version) and a folder structure I need?
I was the person that pointed you at the more up-to-date version at Twilight Dragon. The file you want there is http://sourceforge.net/projects/tdm-gcc/files/TDM-MinGW%20Installer/1.908.0/tdm-mingw-1.908.0-4.4.1-2.exe/download which is a Windows binary installer - you just run it. Note that you don't actually need to do this - the version that comes with Code::Blocks will work OK for someone starting to learn C++.
I recommend using a pre-packaged MinGW that includes some common APIs like Boost, SDL etc: http://nuwen.net/mingw.html
If I remember correctly, the only thing you must do to get it working is to modify Windows's PATH environment variable.
edit: OpenAL is not included in this package.
Here are some instructions to have a MinGW setup that I used to build Octave modules.
I have switched to using the build environment for msysgit. Just download the netinstall file and it will setup GCC, Make, etc. along with Git.
More out of interest than anything else, but can you compile a DirectX app under linux?
Obviously there's no official SDK, but I was thinking it might be possible with wine.
Presumably wine has an implementation of the DirectX interface in order to run games? Is it possible to link against that? (edit: This is called winelib)
Failing that, maybe a mingw cross compiler with the app running under wine.
Half answered my own question here, but wondered if anyone had heard of anything like this being done?
I've had some luck with this. I've managed to compile this simple Direct3D example.
I used winelib for this (wine-dev package on Ubuntu). Thanks to alastair for pointing me to winelib.
I modified the source slightly to convert the wchars to chars (1 on line 52, 2 on line 55, by removing the L before the string literals). There may be a way around this, but this got it up and running.
I then compiled the source with the following:
wineg++ -ld3d9 -ld3dx9 triangle.cpp
This generates an a.out.exe.so binary, as well as an a.out script to run it under wine.
If this is not about porting but creating, you should really consider OpenGL as this API is as powerful as DirectX and much easier to port to Mac or Linux.
I don't know your requirements so better mention it.
You can't link against wine as it's essentially a call interdictor/translator rather than a set of libraries you can hook into. If linux is important go OpenGL/SDL/OpenAL.
I believe(I've never tried this) you can can compile Linux binarys against winelib. So it works just like a Linux executable, but with the windows libraries.
http://www.winehq.org/site/docs/winelib-guide/index
go to the directory with the source and type in:
winemaker --lower-uppercase -icomdlg32 -ishell32 -ishlwapi -iuser32 -igdi32 -iadvapi32 -ld3d9 .
make
wine yourexecutable.exe.so
If you get this Error:
main.c:95:5: error: ‘struct IDirect3D9’ has no member named ‘CreateDevice’
make sure you have named your file main.cpp and not main.c.
There is currently no way to compile DirectX code to directly target Linux. You would build your application like you normally would, then run it using a compatibility layer like Wine/Cedega.
you can compile a directx apps in linux, but not launching it straight away.
if you use a crosscompilator that makes windows exe and point to the windows sdk and directx sdk.
Although this question is dated, I decided to updated on it, because it keeps popping up for me as the first suggestion for this particular problem.
As the previous answers already suggested you can compile against winelib. However, there are yet another two solutions.
The first solution would be either to use the MinGW provided for your distributions. MinGW is a 'cross-compiler', that compiles either from macOS or linux to windows and has support for DirectX. Note, that C++ libraries compiled with MinGW are not compatible with the MSVC compiler's ABI, thus cannot be consumed. However, the resulting binaries can be executed using Wine.
The second solution would be to use clang as a cross compiler. Clang usually includes the Compiler and Linker needed for Windows out of the box. However, it'll require you to include provide the headers and libraries yourself. On the other hand, libraries compiled this way are compatible with MSVC and, thus, can be consumed by it.
Side note:
Latter allows you to setup an CI server using linux (I did so on a raspberry pi), which creates compatible binaries for end users.
Wine is the only way to run DirectX in Linux