Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Italian
  4. Importare progetto in Qt
Qt 6.11 is out! See what's new in the release blog

Importare progetto in Qt

Scheduled Pinned Locked Moved Unsolved Italian
2 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    GiGa91
    wrote on last edited by GiGa91
    #1

    Salve a tutti, mi ritrovo qui a chiedere aiuto a voi.

    Ho un problema con l'importazione di un progetto in Qt. Il progetto che vorrei importare è un file di esempio dell'sdk Sapera.
    Sono su Ubuntu 16.04 e se compilo con il file makefile del progetto originale non ho nessun problema.

    Praticamente il makefile è questo:

    CC= gcc
    # IROOT directory based on installed distribution tree (not archive/development tree). 
    # IROOT=../..
    IROOT=/usr/dalsa/GigeV
    
    #
    # Get the configured include defs file.
    # (It gets installed to the distribution tree).
    ifeq ($(shell if test -e archdefs.mk; then echo exists; fi), exists)
    	include archdefs.mk
    else
    # Force an error
    $(error	archdefs.mk file not found. It gets configured on installation ***)
    endif
    
    INC_PATH = -I. -I$(IROOT)/include -I$(IROOT)/examples/common $(INC_GENICAM)
                              
    DEBUGFLAGS = -g 
    
    CXX_COMPILE_OPTIONS = -c $(DEBUGFLAGS) -DPOSIX_HOSTPC -D_REENTRANT -fno-for-scope \
    			-Wall -Wno-parentheses -Wno-missing-braces -Wno-unused-but-set-variable \
    			-Wno-unknown-pragmas -Wno-cast-qual -Wno-unused-function -Wno-unused-label
    
    C_COMPILE_OPTIONS= $(DEBUGFLAGS) -fhosted -Wall -Wno-parentheses -Wno-missing-braces \
    		   	-Wno-unknown-pragmas -Wno-cast-qual -Wno-unused-function -Wno-unused-label -Wno-unused-but-set-variable
    
    
    LCLLIBS=  -L$(ARCHLIBDIR) -lpthread -lXext -lX11 -L/usr/local/lib -lGevApi -lCorW32
    
    VPATH= . : ../common
    
    %.o : %.cpp
    	$(CC) -I. $(INC_PATH) $(CXX_COMPILE_OPTIONS) $(ARCH_OPTIONS) -c $< -o $@
    
    %.o : %.c
    	$(CC) -I. $(INC_PATH) $(C_COMPILE_OPTIONS) $(ARCH_OPTIONS) -c $< -o $@
    
    OBJS= genicam_cpp_demo.o \
          GevUtils.o \
          X_Display_utils.o
    
    genicam_cpp_demo : $(OBJS)
    	$(CC) -g $(ARCH_LINK_OPTIONS) -o genicam_cpp_demo $(OBJS) $(LCLLIBS) $(GENICAM_LIBS) -L$(ARCHLIBDIR) -lstdc++
    
    clean:
    	rm *.o genicam_cpp_demo 
    

    Aggiungendo le directory nel file .pro ottengo questo:

    QT -= gui
    
    CONFIG += c++11 console
    CONFIG -= app_bundle
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    SOURCES += \
        main.cpp
    
    HEADERS += \
        ../DALSA/GigeV/examples/genicam_cpp_demo/corenv.h
    
    INCLUDEPATH += /usr/dalsa/GigeV/examples/common/ \
                   /usr/dalsa/GigeV/include/ \
                  /opt/genicam_v3_0/library/CPP/include/
    
    
    LIBS += -L/usr/lib -L/usr/local/lib -lpthread -lXext -lX11 -lGevApi -lCorW32
    
    

    Effettivamente dopo aver inserito le tre directory dell'INCLUDEPATH mi trova tutti i file *.h se provo a compilare ottengo quest'errore:

    :-1: error: main.o: undefined reference to symbol '_ZNK11GenICam_3_016GenericException17GetSourceFileNameEv'
    /opt/genicam_v3_0/bin/Linux64_x64/libGCBase_gcc421_v3_0.so:-1: error: error adding symbols: DSO missing from command line
    :-1: error: collect2: error: ld returned 1 exit status
    

    Altra cosa che non mi è chiara è questo file archdefs.mk

    #-----------------------------------------------------------------------------
    # archdefs.mk               						
    #
    # Description: 
    #       Architecture specific definitions for compiling and linking
    #		programs using GigE-V Framework API and GenICam libraries.
    #		For i86/x86_64  
    #
    #-----------------------------------------------------------------------------#
    # Architecture-dependent definitions.
    # (GenICam libraries have different paths and names depending on the architecture)
    #
    # Architecture specific environment defs for self-hosted environment 
    #
    ifndef ARCH
      ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/x86_64/x86_64/ -e s/armv5.*/armv5/ -e s/armv6.*/armv6/ -e s/armv7.*/armv7/)
    endif
    
    ifeq  ($(ARCH), x86_64)
    	ARCHNAME=x86_64
    	ARCH_GENICAM_BIN=Linux64_x64
    	ARCH_OPTIONS= -Dx86_64 -D_REENTRANT
    	ARCH_GCCVER=421
    else
    ifeq  ($(ARCH), i386)
    	ARCHNAME=i386
    	ARCH_GENICAM_BIN=Linux32_i86
    	ARCH_OPTIONS= -D__i386__ -D_REENTRANT
    	ARCH_GCCVER=421
    else
    # Not supported
    $(error Architecture $(ARCH) not configured for this installation.)
    endif
    endif
    
    ARCHLIBDIR=/usr/lib
    
    #
    # Arch dependent GenICam library specification
    #
    GENICAM_PATH_VERSION=v3_0
    GENICAM_PATH:=$(GENICAM_ROOT_V3_0)
    INC_GENICAM=-I$(GENICAM_PATH)/library/CPP/include
    GENICAM_LIBS=-L$(GENICAM_PATH)/bin/$(ARCH_GENICAM_BIN)\
    					-lGenApi_gcc$(ARCH_GCCVER)_$(GENICAM_PATH_VERSION)\
    					-lGCBase_gcc$(ARCH_GCCVER)_$(GENICAM_PATH_VERSION)			
    					
    

    Sapreste aiutarmi o indirizzarmi verso qualcosa da controllare ?

    ps Il progetto è composto da due soli file (un file .cpp e un file .h)

    ps ps: Sono riuscito a importare il progetto facendo new project -> import existing project ma non è quello che volevo.. io volevo riusciore (lasciatemel passare) "convertire il file makefile in .pro"

    Aggiorno il post. Sono riuscito ad andare avanti ma riscontro problemi con le librerie X11 per la gestione delle finestre di ubuntu. Se commento le righe di codice che usano queste librerie il programma funziona ma avviamente non mi fa vedere la finestra.
    Facendo alcune prove sembra che i problemi siano dovuti dal fatto che Qt usi g++ mentre nel make uso gcc

    1 Reply Last reply
    0
    • mrdebugM Offline
      mrdebugM Offline
      mrdebug
      wrote on last edited by
      #2

      Ciao, a prima vista vedo che si tratta di un problema di link. Vedo infatti che nel progetto vuoi incamerare i file oggetto

      genicam_cpp_demo.o
      GevUtils.o
      X_Display_utils.o

      E' corretto?
      Questi file con che macchina sono stati compilati? Con la tua?
      Perché se non è così credo che il problema sia semplicemente che loro vogliono materiale che nel tuo pc non c'è o non è della versione giusta.

      Need programmers to hire?
      www.labcsp.com
      www.denisgottardello.it
      GMT+1
      Skype: mrdebug

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved