develop vtk in codeblocks - c++

I installed vtk in debian6.0.6 successfully, I build a static lib. I run the examples and everything is ok.
But I want to develop in codeblocks. So I created a project in codeblocks, copy the code "cone.cxx" into my project, I set the include path and linkers. But there are compile errors like "undefined reference to...", I guess that is because it can not find the interfaces in the static lib.
I guess I need some #defines before compile my project. I can see the pre_defines in visual studio2008, but I can not get it in codeblocks because the codeblocks project use its makefile defaultly. Can I get a solution if I don't want to write a makefile?

Related

Integrating wxWidgets into Existing XCode Project

There are many tutorials about setting up a new XCode project for use with wxWidgets, but I need to integrate it with a large existing XCode C++ project.
The wxWidgets setup process is unclear to me. I built wxWidgets in XCode with the included wxcocoa.xcodeproj file. But when I include all the header files and the libwx_osx_cocoa.dylib library to my existing XCode project, I get all these errors within the wxWidgets header files like Use of undeclared identifier 'wxApp' and No matching constructor for initialization of 'wxEvent' as if it's missing files, but I've included all the header files and compiled library. I tried building wxWidgets in the terminal and get the same errors. I tried make install to actually install wxWidgets on my system. I tried running this command wx-config --cxxflags --libs all in the terminal. I tried adding wx-config --cxxflags and wx-config --libs all to the compiler and linker flags in my XCode project. None of these had any effect.
The irony is that I'm trying to use wxWidgets library to make the GUI process easier, but instead I've spent two days pulling my hair out trying to get my C++ XCode project to compile. Does anyone know what I'm doing wrong?
EDIT: The problem seems to be XCode. I've downloaded the wxWidgets Hello World sample program at the bottom of this page. I can build this program without issue in the terminal, but when I put it into a new XCode project, it won't build. How can I get XCode to build this simple program?
cx-config output:
XCode project settings:
EDIT 2: I exported the Build Log out of XCode and saw that the actual build command uses clang. When I successfully compile Hello World in the terminal, I use clang++. When I try the same command with clang, it doesn't work. Perhaps this is the issue, since clang only links C libraries and the errors XCode is giving me relate to not being able to find standard C++ functions.
EDIT 3: Wow I hate XCode. I got my Hello World program to compile by accident. The solution was putting the wxWidgets compiler flags in the Targets Build Settings, whereas before, I had it in the Project Build Settings. I assumed the Targets would inherit the Project settings, but I guess not!
EDIT 4: I got my complicated XCode project to compile with the wxWidgets libraries by taking all the search paths & flags and moving them from the Project Build Settings to the Targets Build Settings. What a nightmare! Glad it's over
#WaddleDee72
,
I suggest doing following:
Delete wxWidgets directory.
Unpack wxWidgets into i.e. ~/wxWidgets.
Open Terminal.
In the Terminal
4a. cd ~/wxWidgets
4b. mkdir buildOSX
4c. cd buildOSX
4d. ../configure --enable-debug
4e. make -j5
After successful build
wx-config --cxxflags
wx-config --libs
Use the output of 2 commands above and put the values where they belong in XCode project.
If you get any issues - let us know.
Thank you.

After installing LLVM, how do I compile and run a small project?

After having installed LLVM, I try following the Kaleidoscope tutorial on how to build a small language.
However, trying to compile with clang++, I get several errors.
First, the IDE cannot find the include files. However, I fixed this by pointing the IDE to the include directory inside the LLVM build directory.
Next, the linker says it cannot find object files.
I am using Visual Studio 2015 and running Windows 10.
Can someone write a foolproof step-by-step guide on how to build a small app with some of the include files? This includes making clang++ aware on how to find the necessary files.
Thanks.

How to compile a Qt program without installing sdk

Can someone tell me if it's possible to compile a project that works with Qt but without installing the entire sdk ? I mean, something like recompile Qt source code and link the libraries or something like this.
I know my problem is weird but I work in special conditions : I am on a linux machine and I have to work on a windows project therefore I use a distant server on windows to compile but I can't install anything on this serveur. I need an idea to have a fully portable folder with Qt who can compile without installing anything.
I hope I was clear in my explications.
Thank you for your help.
I has combined comments in answer.
You need to install compiler (e.g minGW) and Qt Library (as needed version).
You should add into environment variable 'PATH' your path to qmake and compiler.
Start terminal and move to directory with your source code of Qt project.
Run qmake and then exec make (e.g. It, for minGW, is mingw32-make).
For your case, you may choosen 2 way:
Build static Qt Library from source code and use static linking with your project.
Install Qt Library and copy libraries near your project with dynamic linking (recomended).

Compiling Visual C++ Project on Linux

I am tring to port this code to Linux
I believe OpenCV uses cmake to compile a VC++ code base in Linux, you create a dir, in that dir do cmake..., and a Makefile is generated. But I guess I would need a VC++ makefile first. My request is, at the very least, a VC++ makefile for the project above, and show it compiles the project with g++. If you can think of a general way, a tool that compile VC++, I'd like to hear about it.
CMake generates Makefile or VC++ project depending on your platform, so you'll end with a Makefile after running CMake.
However the code you mention isn't using neither OpenCV nor CMake, so I may be missing something...
There is some old tool called dsp2make for converting VC++6 to Makefile, but I doubt it'll be no-brainer. Better start with a CMakeLists.txt and list the cpp files you want to compile.

Compiling libpng and using it with netbeans and mingw

I have only previously used visual studio for developing c++ but I've just moved to netbeans and am having some issues.
I got mingw installed so that my projects will compile but I dont know how to add external libraries to that. I want to use a static library, not a dll.
The library I specifically am looking at is libpng
I hope this isn't too IDE specific, I'm also looking to know how to prepare the library.
Windows OS.
I figured it out more or less. I used the cmake gui, configured for msys make and mingw g++ and gcc, on the zlib source directory and then ran msys make and make install on the output directory. After that I did the same on libpng, but I had to add some variables to point to the zlib include and library directories within cmake.
Then in netbeans, I right clicked>>properties on my project and added include and lib location for each of the two libraries. I also could have copied the files into my mingw directories.
Now I'm just stuck with this issue.