Skip to main content



      Home
Home » Language IDEs » C / C++ IDE (CDT) » need to create a new eclipse project with existing code to use qt .pro file
need to create a new eclipse project with existing code to use qt .pro file [message #1819529] Thu, 16 January 2020 15:45 Go to next message
Eclipse UserFriend
Hello

I have a code base with a .pro file. My understanding is that I need to use qmake and this .pro file to create a make file. With c++, I have generally just written my own makefile but have never done that for a QT project. I have used eclipse for java but am new to using it with c++.

I have qt5 and qt5-devel installed. I also have qt4 installed, so I have access to both qmake-qt4 and qmake-qt5. I have qmake-qt5 with no arguments registered as an External Tool.

I am not sure how to set up the project to do this. Do I "Create a new Makefile Project in a directory containing existing code", do I "Create a new C++ project"?

Is there a procedure for creating the project and then running qmake to generate the makefile?

Thanks for the assistance,

LMHmedchem
Re: need to create a new eclipse project with existing code to use qt .pro file [message #1819596 is a reply to message #1819529] Fri, 17 January 2020 13:18 Go to previous messageGo to next message
Eclipse UserFriend
File --> Import --> Existing Code as a Makefile project
You still need to select a toolchain so that the compiler builtins can be discovered for the Indexer.
You need to run qmake manually either through a terminal or as an External Tool.

Re: need to create a new eclipse project with existing code to use qt .pro file [message #1820559 is a reply to message #1819596] Wed, 22 January 2020 15:52 Go to previous messageGo to next message
Eclipse UserFriend
Thanks,

I ran qmake-qt5 from the console inside the src directory and then set up an eclipse project for existing code and makefile to use the makefile that was generated by qmake. I was able to build the executable and run the program.

I am not sure which toolchain to use. I have Linux GCC as the current tool chain. What is the difference between Linux GCC and GNU Autotools toolchain?

LMHmedchem

[Updated on: Wed, 22 January 2020 16:52] by Moderator

Re: need to create a new eclipse project with existing code to use qt .pro file [message #1820564 is a reply to message #1820559] Wed, 22 January 2020 17:00 Go to previous messageGo to next message
Eclipse UserFriend
If you are using "Project" in the menu, the active window has to be associated with a project.
Meaning that, say the Console window is the active window in Eclipse, the "Properties" entry will be grayed out.
But when a project edit window is active, the "Properties" entry will be enabled.

You can also right click the project in the Project View and select "Properties" from the context menu.

[Updated on: Wed, 22 January 2020 17:02] by Moderator

Re: need to create a new eclipse project with existing code to use qt .pro file [message #1820565 is a reply to message #1820564] Wed, 22 January 2020 18:14 Go to previous messageGo to next message
Eclipse UserFriend
Thanks you, I was able to access the properties menu item for my project. I have Linux GCC as the current tool chain but I am not sure which toolchain to use. What is the difference between Linux GCC and GNU Autotools toolchain? I will likely be making manual edits to the makefile from now on.

I generally boot into a different OS if I need to compile for a different system, so I don't do cross compiling as a general rule. I have a bunch of different VMs for the different platforms I need to build on. The trunk directory for each project is on a shared partition that is mounted in each VM (or sometimes hardware install). The makefile creates a platform specific build directory in /trunk based on the local configuration of the OS that is running. Each build directory has the compiled object and linked binary files for the associated platform (OS, arch, compiler version, program version, etc).

I would guess that I should just stick to Linux GCC but I am interested in other opinions.

LMHmedchem

[Updated on: Wed, 22 January 2020 18:22] by Moderator

Re: need to create a new eclipse project with existing code to use qt .pro file [message #1820568 is a reply to message #1820565] Wed, 22 January 2020 22:05 Go to previous messageGo to next message
Eclipse UserFriend
The toolchain in a Makefile project is used to get the compiler builtins for the Indexer.

It should match the one used in the Makefile.
Re: need to create a new eclipse project with existing code to use qt .pro file [message #1820613 is a reply to message #1820568] Thu, 23 January 2020 16:33 Go to previous message
Eclipse UserFriend
Thanks,

I think for my case that the basic Linux GCC is what I need because the makefile is just calling g++ to compile and link with.

CXX= g++
CXXFLAGS= -pipe -O2 -g -Wal -std=gnu++11
INCPATH       = -I. -I../../../../../../Include
Main.o: Main.cpp Main.h $(CXX) -c $(CXXFLAGS) $(INCPATH) -o Main.o Main.cpp

LMHmedchem

[Updated on: Thu, 23 January 2020 16:34] by Moderator

Previous Topic:Visual Studio C++ compiler under Eclipse
Next Topic:method for setting up separate src and build directories
Goto Forum:
  


Current Time: Thu Jun 19 23:49:46 EDT 2025

Powered by FUDForum. Page generated in 0.04966 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top