How to change executable to static library in Eclipse Helios - c++

I am using Eclipse Helios (version 3.6.1, Build id: M20100909-0800) on RHEL 6.9 and created several projects within a workspace that I specified as empty static libraries. After trying to compile each of the projects I got an error stating that it could find main.
I tried the suggestion at Changing Project Type from “Executable” to “Static Library” in Eclipse CDT but my Build Artifacts Artifact Type only included Executable and Shared Library. Unfortunately I can't used a shared library on some of my libraries because they end up loading more shared libraries (depending on installation location).
My problem is that I don't have an option for Static Library as an Artifact Type. Could this be some kind of configuration issue with Eclipse? Unfortunately, I don't have the ability to upgrade (easily - if at all), but I may be able to get someone to fix the installation if that is indeed the issue.

For those coming to this question after a recent install of RHEL 8 (in 2022) the solution is the same, upgrade Eclipse. I had the same problem which was solved when Eclipse was upgraded to 2021-12. This has to be done manually since the upgrade function in the Eclipse disto that comes with RHEL 8 doesn't work.

Related

MinGW c++ compiler zlib1.dll missing error?

I have just started to learn C++ for school, and I'm trying to download the compiler MinGW to compile my source code. However, every time I try to compile a program an error message shows up saying that zlib1.dll is missing.
This is the error message
the program can't start because zlib1.dll is missing from your computer
I have tried installing/re-installing with no luck. I don't know what's the problem here?
Can anyone please help me with this problem as I have some homework that I need to do but I can't without the compiler.
Thanks.
I had this same problem, but fixed it like this:
I ran the MinGW Installation Manager (e.g. C:\MinGW\libexec\mingw-get\guimain.exe).
I navigated to All Packages -> MinGW -> MinGW Libraries.
I checked the boxes next to mingw32-libz (dev & dll).
I went to Installation -> Apply Changes.
Now everything worked properly.
From the MinGW getting started; an automated GUI installer assistant, or use mingw-get, is available (installed as "MinGW Installation Manager") and can be used to install additional libraries and manage dependencies. For the missing zlib libraries, add the mingw32-libz libraries as required.
It seems to have been an issue previously here on super user. It seems you may be able to get them directly from the zlib website. Open Babel has some info on it being required to be copied afterwards (together with some other dlls).
Alternatives include using the mingw-w64 distros from nuwen or mingw-builds. I've never had any issue getting these up and going. They also support x64 builds.
Had same problem here, I've just used mingw-get install mingw32-libzat the cmd and it worked.

How do I set up OpenCV for MinGW project?

I regularly use Code::Blocks and MinGW for my C/C++ projects. I would like to be able to use OpenCV, since it has a nice library for computer vision projects. They have dropped support for MinGW. I have heard you can build it on your own somehow, but I have no experience doing this with 3rd party libraries. Can someone explain how to build it in a simple way for MinGW?
There is, or at least there was at least until 2.4.6, precompiled version of opencv that works out of the box with mingw as long as you use the dw2(standard) version of mingw.
since i needed sjlj support i had to build my own version of openCV 2.4.6
I did he following - i am pretty sure it will work for the current openCV version as well
Setup your preferred Mingw Environment - i would strongly recommend to use gcc 4.5 or newer
Intstall Msys
Intall Cmake - you can get a binary package
Start the Cmake GUI
Select the openCV source folder
Click Configure and select MSYS-Makfiles
Errors in the first run of Configure might be resolved if you run Configure again
Click Generate
use MSYS make to run the generated makefile
Copy all desired libraries and include files to your mingw-installation or your project

HDF5 Library error

I am using the follows
1) VS 2010 C++
2) Debug Win 32
3) The library from here
http://www.hdfgroup.org/HDF5/release/obtain5.html
Basically I downloaded Windows (32-bit) Compilers: CMake VS 2010 C, C++, IVF 12, RWDI and installed it. I tried to include a sample code in my C++ application and ran into the following
***HDF5 library version mismatched error***
The HDF5 header files used to compile this application do not match
the version used by the HDF5 library to which this application is linked.
Data corruption or segmentation faults may occur if the application continues.
This can happen when an application was compiled by one version of HDF5 but
linked with a different version of static or shared HDF5 library.
You should recompile the application or check your shared library related
settings such as 'LD_LIBRARY_PATH'.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting it to 2 or higher will suppress the warning messages totally.
Headers are 1.8.12, library is 1.8.11
SUMMARY OF THE HDF5 CONFIGURATION
=================================
General Information:
-------------------
HDF5 Version: 1.8.11
Configured on:
Configured by: Visual Studio 9 2008
Configure mode: CMAKE 2.8.11.2
Host system: Windows-6.1
Uname information: Windows
Byte sex: little-endian
Libraries:
Installation point: J:/dev/opt/hdf5-1.8.11
You either have two versions of HDF5 installed and you are compiling with one (1.8.12) but linking with the other (1.8.11 in J:/dev/opt/hdf5-1.8.11), or more likely you installed HDF5, compiled your program, then updated HDF5 later on and didn't clean some object files in your project…
First try to Clean All and Build your program again, it might be enough.
If this doesn't work, find out if you have two versions installed at the same time and remove one of them if this is the case, Clean All and Build your program.
If this doesn't work, remove all HDF5 stuff on your system and reinstall the HDF5 library, Clean All and Build your program.
I have the same problem and I solved the issue by using
conda install -c anaconda hdf5=1.8.12
I hope this will work with you too
This seems to show up for only when the application(using Theano+Keras+Anaconda) is run using PyCharm in Windows machine.
You can, at your own risk, disable this warning by setting the environment
variable 'HDF5_DISABLE_VERSION_CHECK' to a value of '1'.
Setting the HDF5_DISABLE_VERSION_CHECK=1 suppresses it.

How can I conditionally include two differently named libraries of the same version for a cross-compile project in Eclipse?

I have an Eclipse project that I want to compile on both Ubuntu and Windows.
I am using boost libraries (specifically asio) which require including the libboost_system...* library. I have compiled boost on both Windows and Ubuntu and ended up with libboost_system_mgw48-mt-1_55.a on Windows and libboost_system.a, libboost_system.so, libboost_system.so.1.55.0 on Ubuntu.
I'm not sure which Ubuntu library I need to include but the bigger issue is how to include both the Windows and Ubuntu library but only on the right OS.
I am using the MinGW toolchain on Windows which by my understanding is more or less GCC? I am then assuming that I should simply use GCC on Ubuntu to have the same compile process.
Windows boost build commands:
bootstrap.bat mingw
b2 toolset=gcc
Ubuntu boost build commands:
bootstrap.sh
b2
Can Eclipse get the OS in use on a per install basis that I can access via a globally recognizable variable?
How can I then, assuming yes, use that information to conditionally include only the right libraries?
The solution I came up with was to use two configurations: Debug-Win32 and Debug-Unix in the project properties. This keeps track of independent library & path configurations as well as different tool chains while still pulling from the same code base.

Eclipse Ganymede and MinGW in Windows

I'm trying to get eclipse to work with MinGW.
I've done the following:
Downloaded CDT for eclipse.
Installed MinGW.
Added C:\MinGW\bin to my path.
Opening a command prompt (CMD) and typing g++ or alike works fine.
I run eclipse, create a "New C++ Project", and only get the option saying "other toolchains".
There's a MILLION tutorials out there saying eclipse should identify MinGW on its own. It doesn't, and I don't know what to do. I've tried reinstalling everying in just about every order posible. Still no luck.
I've also noted some tutorials say something about creating a "Managed C++ Project". I've no such option, all I get is "C++ Project" and "C Project"
edit:
I have eclipse ganymede, windows x86_64, version 3.4.2
http://download.eclipse.org/eclipse/downloads/drops/R-3.4.2-200902111700/index.php
Running the "Eclipse IDE for C/C++ developers" fails, since there's no x64 version for windows. The x86 version requires x86 JAVA installed as well, and installing two versions of java, gave nothing but trouble in the past.
The instructions for setting up MinGW in Ganymede are located here.
The following are instructions and
links on how to install the current
version of MinGW. Note that these
links may become inaccurate over time
as new versions of MinGW components
are introduced. Please check the MinGW
File Release section for the latest
versions.
Download and run the MinGW setup program, MinGW-5.1.3.exe.
Select download and install the MinGW base tools and the g++ compiler.
You may select the Current or
Candidate version of these tools. You
may also install any of the other
available compilers as well.
Do not install the MinGW Make feature as the MSYS version of make
from step 5 is a more complete
implementation of make.
The MinGW setup program currently does not install the gdb
debugger. To install the debugger,
download the file from the following
location: gdb-6.6.tar.bz2
Extract the contents of the file gdb-6.6.tar.bz2 to the same location
where you installed MinGW.
If you want to use Makefile projects, download and run the setup
program from the following location:
MSYS-1.0.10.exe. MSYS provides an
implementation of make and related
command line tools. This is not
required for other types of projects
with the MinGW toolchain, which use
CDT's internal build tools to perform
the build.
Following this process resolved any problems I had.
I had the same exact problem with Eclipse Galileo and CDT 6.0.1. It turns out that CDT only recognized MinGW when it's located under c:\mingw. I had it in c:\msys\mingw so that was the problem. After I changed that everything worked fine.
The distinction between managed make projects and makefile project was removed in CDT 4.x, I think. Now there is only one type of project, but you can select different builders. CDT includes an internal builder which does not use makefiles and another one which does.
First, save yourself the effort of "reinstalling in every order possible". That is also known as trial-and-error, and will only make you more frustrated. Apply the normal problem-solving skills you have as a programmer.
Given that you have MinGW installed, what happens if you download "Eclipse IDE for C/C++ developers", start eclipse.exe, and try to create a C++-project with a MinGW toolchain?
EDIT: remember: the key in getting help with problems like these is to produce a minimal example which fails. Also, it would help if you provided URLs to the packages you installed (MinGW, Eclipse, etc.).
EDIT: I just installed CDT using the Ganymede update site, downloaded and installed MinGW from here, and restarted Eclipse, and everything worked fine. I know that doesn't help you, but it does prove that the toolchain detection isn't completely broken. Something is weird on your side.
You could try Wascana Desktop Developer. Its a distribution of Eclipse CDT configured specifically for developing on Windows.
I had the same problem (i.e. Eclipse not finding MinGW on the PATH) after I removed some of the unused files/folders from MinGW. It was ~600 MB and I was tasked to trim it down before adding to source control. I got it down to a workable ~200 MB. When I tried to re-create an Eclipse workspace afterwards, MinGW disappeared from available toolchains. It reappeared after I put the original MinGW install on the path.
HTH