How can i set what version of a product I'm in Eclipse? - windows

I've created, debugged, and revised a project that I've been working on, but now I want to be able to specify what version of the binary I'm on. I'm using Eclispe-CDT with MinGW to make this project on my local system, so there is no versioning software involved. Does anyone know how to specify this for both Windows and Linux platforms?

On Windows, the idea is to produce a COFF file with the relevant information.
That is done by adding a step to the build, using windres (found also here).
See this thread as an example.
you could add windres via the project properties/Builders as an additional builder and add the generated object file in the C/C++ Build/GCC C++ Linker/Miscellaneous/Other Objects.
Then you
- a) could do a clean build if the resource is changed or
- b) could change the build options (if you have patience) to change to do a clean build every time you save the project.
On Unix, this doesn't seem to be supported in a similar fashion.

Related

Is it possible to add/modify system include path without modifying cmake in clion?

I'm working on a cross-platform project which requires dependencies which are not available on my machine. I basically use a cross-platform tool-chain in docker to build everything. Using buildroot I build a whole Linux system for an ARM platform.
So, I was wondering if there is an option to let Clion know or pick another path for system include header files? Then at least clion can help with code completion etc.

Code::Blocks & WxWidgets Matching Release configuration

I am attempting to start a new project in Code:: Blocks (v17.12) using WxWidgets (v3.1.3) on Windows (10).
(For context, I am new to compiling- I'm a script coder trying to branch out. So... don't be afraid to talk to me like I'm an idiot. I'm prepared to accept that possibility.)
I downloaded the official 3.1.3 source, expanded it to "D:\code\wxw"
I successfully compiled it using mingw32-make that came with Code::Blocks-- there is a directory "D:\code\wxw\build\msw\gcc_mswudll" and "D:\code\wxw\lib\gcc_dll", the latter containing .dll files.
So I go into code blocks, and I:
Create New Project -> wxWidgets Project
Select wxWidgets 3.1.x
Project Title "HelloWorld", under D:\code\C++\tinker-- everything else autofilled.
Project details-- my info.
Preferred GUI Builder - None. Application Type - Dialog.
wxWidgets' location: D:\code\wxw
Compiler: GNU GCC
Selected "Create Release Configuration" because that's how it was compiled.
It provides an Output dir of "bin\Release\" and an Objects output dir of "obj\Release\", which I do not change.
Selected use DLL, built as monolithic, and enable Unicode-- the latter matching my compile settings.
When I click next, it tells me "A Matching Release configuration cannot be found in the wxWidgets directory you specified. This means that the Release target of your project will not build."
I've found multiple hits searching on this error message, but they all devolve into discussions of monolithic vs polylithic compiling and critique of other compiler settings and not actually addressing the problem.
EDIT:
Based on http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef
I used the following settings for compiling. I set them in config.gcc
BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport
The most important page of the wizard is the 8th page. Based on the settings you gave above, it should look exactly like this:
Also, instead of giving the path on the 6th page, I would define a global variable named wx in codeblocks like this:
Then on the 6th page, you would enter $(#wx) instead of the actual path. This will make using your projects much easier if you ever upgrade the wxWidgets library. You'll only need to change the location in the global variable settings.

How to enter custom GCC compiler option in Build Options

There seem to a variety of questions like this one without any clear solution that is true for Xcode 7 (or even other versions of Xcode).
I have a version of GCC that I'd like Xcode to use when it compiles. It is not the standard GCC but customized for a different platform. I can specify and use this compiler fine in Eclipse, but would rather use Xcode. The Build Options only list LLVM and nothing else. When I try to add via "other" in that section, all I get is this empty popup:
What goes in this box? I would think that it should be no big deal for Xcode to simply use a GCC that I have available at a specific path on my system, but this appears to be quite complex.
Update: Apparently there is a supported mechanism for installing externally-provided tool chains in Xcode that I wasn't aware of. For example, one can download packages from swift.org that install alternative tool chain packages into /Library/Developer/Toolchains or ~/Library/Developer/Toolchains. Once one of those is installed, Xcode has a GUI option to switch the active tool chain.
There was a recent change to the Swift sources to include a script for building one's own custom tool chain from them.
If you view the Quick Help for that build setting (View > Utilities > Show Quick Help Inspector) or configure the build settings view to show setting names instead of titles (Editor > Show Setting Names), you'll see that that setting is GCC_VERSION.
If you look that up in the Build Settings Reference, you find:
GCC_VERSION
Description:
Numeric identifier. Identifies the GCC version to be used to compile
the target’s source files. When the target’s “System C rule” is set to
GCC System Version (instead of a specific version number), this build
setting is not available in Run Script build phases.
Values:
2.95.2
3.1
3.3
4.0
Default value:
GCC system version.
Specified in:
Project Info > Rules > “System C rule.”
Target Info > Rules > “System C rule.”
Affects:
GCC_VERSION_IDENTIFIER.
That's actually a bit out of date. It says it's specified by fiddling with a build rule (not setting) called the "System C rule". You used to change the version there but now there's a direct build setting for it.
Anyway, this probably doesn't help you do what you want to do. I doubt there's any value you could put in there that would do something useful, let alone use a third-party compiler.
However, the explanation does have a hint. It mentions the System C build rule. You could modify the build rules on the Build Rules tab of the target configuration screen. You can find the System C rule and press the button to copy it to your target, which will let you specify a custom script to process C files (including Objective-C and C++).
Implementing such a script is non-trivial. The inputs, expected outputs, and required behavior of the script are not well documented. There are various environment variables available for the use of such a script. Some are the build settings. You'll need to translate the relevant settings into compiler options. For example, translate the CLANG_WARN_BOOL_CONVERSION setting into the corresponding -Wbool-conversion option.
Some of the other environment variables indicate which file you should operate on, such as INPUT_FILE_PATH, INPUT_FILE_NAME, etc.
You need to tell Xcode what file(s) your rule outputs. These can be based on the input environment variables/settings, such as $(OBJECT_FILE_DIR)-$(CURRENT_VARIANT)/$(CURRENT_ARCH)/$(INPUT_FILE_BASE).o.
In general, this is just not something that Xcode makes easy.
Someone wrote a plugin that will allow you to use gcc from Xcode.
http://hamelot.io/programming/add-gcc-compiler-to-xcode-6/
If you have a custom gcc then you would need to change the paths around etc but the plugin should work.

How to install and use open source library on Windows?

I'd like to use open source library on Windows. (ex:Aquila, following http://aquila-dsp.org/articles/iteration-over-wave-file-data-revisited/) But I can't understand anything about "Build System"... Everyone just say like, "Unzip the tar, do configure, make, make file" at Linux, but I want to use them for Windows. There are some several questions.
i) Why do I have to "Install" for just source code? Why can't I use these header files by copying them to the working directory and throw #include ".\aquila\global.h" ??
ii) What are Configuration and Make/Make Install? I can't understand them. I just know that configuration open source with Windows need "CMake", and it is configuration tool... But what it actually does??
iii) Though I've done : cmake, mingw32-make, mingw32-make install... My compiler said "undefined references to ...". What this means and what should I do with them?
You don't need to install for sources. You do need to install for the libraries that get built from that source code and that your code is going to use.
configure is the standard name for the script that does build configuration for the software about to be built. The usual way it is run (and how you will see it mentioned) is ./configure.
make is a build management tool (as the tag here on SO will tell you). One of the most common mechanisms for building code on linux (etc.) is to use the autotools suite which uses the aforementioned configure script to generate build configuration information for use by generated makefiles which make then uses to build the software. make is also the way to run the default build target defined in a makefile (which is often the all target and which usually builds the appropriate library/binary/etc.).
make install is a specific, secondary, invocation of the make tool on the install target which (generally) installs the (in this case previously) built code into an appropriate location (in the autotools/configure universe the default location is generally under /usr/local).
cmake is, again as the SO tag says, a build system that generates configuration files for other build tools (make, VS, etc.). This allows the developers to create the build configuration once and build on multiple platforms/etc. (at least in theory).
If running cmake worked correctly then it should have generated the correct information for whatever target system you told it to use (make or VS or whatever). Assuming that was make that should have allowed mingw32-make to build the software correctly (assuming additionally that mingw32-make is not a distinct cmake target than make). If that is not working correctly then something is still missing from your system (and cmake probably should have caught that).
But to give any more detail you will need to give more detail about what errors you are actually getting and from what command.
(Oh, and on Windows, and especially if you plan on building your software with VS (or some other non-mingw32-make tool) the chances of you needing to run mingw32-make install are incredibly small).
For Windows use cmake or latest ninja.
The process is not simple or straight, but achievable. You need to write CMake configuration.
Building process is not simple and straight, that's why there exists language like Java(that's another thing though)
Rely on CMake build the library, and you will get the Open-Source library for Windows.
You can distribute this as library for Windows systems, distribute and integrate with your own software, include the Open Source library, in either cases, you would have to build it for Windows.
Writing CMake helps, it would be helpful to build for other platforms as well.
Now Question comes: Is there any other way except CMake for Windows Build
Would you love the flavor of writing directly Assembly?
If obviously answer is no, you would have to write CMake and generate sln for MSVC and other compilers.
Just fix some of the errors comes, read the FAQ, Documentation before building an Open Source library. And fix the errors as they lurk through.
It is like handling burning iron, but it pays if you're working on something meaningful. Most of the server libraries are Open Source(e.g. age old Apache httpd). So, think before what you're doing.
There are also not many useful Open Source libraries which you could use in your project, but it's the way to Use the Open Source libraries.

Working with openFrameworks in Qt-Creator

How can I use OF within Qt Creator environment?
I fact , how should I build the lib and add it in my .pro file and all.
I have successfully done a porting of open frameworks project in creator loading plain Makefile projects.
You can add the includes directory in the file projectName.includes to have auto-completition and file navigation (just do it with a find shell command against OF_PATH/libs) and it is very handy.
Moreover config.make and addons.make let you use the builtin project-creation tools and workflow provided by the official community project management system, and also add external binary/libraries/shared components with the standard gcc command (-I for example).
In this way you can use QtCreator and do not care about .pro/.pri files and use the makefile projects (I have tested it both on linux and mac/osx) and I think there will be no problem also with arch compiling.
Also no problem with C++11 (even if I haven't tested all new features of the language).
See this post in the official forum.
Check out this github repository: https://github.com/procedural/ofqmake There is a qmake project file (.pro) if you want to build openFrameworks using qtcreator as well as a qmake include file (.pri) if you want to use oF in your own projects.
This is exactly what you want to do. Get the openFrameworks.pri file and include it in your .pro file by adding include(openFrameworks.pri).
Qt itself provide an open-framework called Qt-Complex. Go through it and you can find how to add a framework to your project there.
To update this topic again, since OF9.0, QT Creator is now officially supported (and even the default recommended IDE!).
See this setup Guide: http://openframeworks.cc/setup/qtcreator/

Resources