New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

PvApi prosilica camera for mac os X


Post Reply New Thread Subscribe

 
Thread Tools
phdstudent

 
Member Since: Mar 25, 2014
Posts: 7
phdstudent is on a distinguished road

phdstudent is offline
Hello,

I am using prosilica camera http://www.alliedvisiontec.com/us/ne...k-upda te.html on Mac os x 10.8.5. I downloaded the SDK for Mac OS X.
I try to execute the examples on the SDK but always I got this errors.
Code:
> make sample
    g++-4.2   -O3  -mmacosx-version-min=10.5 -I/usr/bin-pc/x64 -lPvAPI
    make: g++-4.2: No such file or directory
    make: *** [sample] Error 1
But when i run g++ -v on terminal I got:
Code:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
    Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
    Target: x86_64-apple-darwin12.5.0
    Thread model: posix
And I installed the command line of Xcode and so on ?

What is the error ? could help me please ?
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,436
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
Welcome to Mac-Forums..

What do the following commands say?
Code:
which g++
g++ --version
You might want to take a look at the Makefile for the SDK and see what default values is being used to compile it. For starters, it looks like the value of CC or whatever is being set to "g++-4.2" while you likely only want "g++".

You can usually override the value by doing something like "make same CC=g++" or something depending on what the variable is, assuming it's a variable to begin with not hardcoded..

--
Regards
...Ashwin



Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks
phdstudent

 
Member Since: Mar 25, 2014
Posts: 7
phdstudent is on a distinguished road

phdstudent is offline
Code:
>which g++
/usr/bin/g++
>which gcc
/usr/bin/gcc
>g++ --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 5.1 (clang-503.0.38) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin12.5.0
Thread model: posix
In the SDK, there is an ARCH FILE that contains all configurations.
-------------------------------------
ARCH file:
Code:
# Global ARCHitecture settings for the Sample code
#
# this file should be adapted to your platform

# Target CPU
#CPU	= x86
CPU	    = x64

# Target OS
OS	    = OSX
OS_DIR  = OSX

# OS-X version
OSXV	= -mmacosx-version-min=10.5
# architecture flags
#ARCH	= -m32

# compilation flags
OPT	= -O3 $(ARCH) $(OSXV)

# compiler version
CVER    = 4.2
# compiler
CC      =g++-$(CVER)
# linker
LD      = ld
AR      = ar
SP      = strip

# some flags
DFLAGS	= -D_$(CPU) -D_$(OS)
#FLAGS   = -fno-strict-aliasing -fexceptions -I/usr/include $(DFLAGS)
FLAGS   = -I/usr/include $(DFLAGS)

## TIFF library
#LTIFF   = -ltiff

## few locations
INC_DIR	  = ../../inc-pc
BIN_DIR   = ../../bin-pc/$(CPU)
LIB_DIR   = ../../lib-pc/$(CPU)
OBJ_DIR	  = ./obj/$(CPU)
EXTRA_LIB = -lpthread -lz

## library
LJPEG   = -ljpeg

## libs (shared/static)
PVLIB   = -L$(BIN_DIR) -lPvAPI
SOLIB	= $(EXTRA_LIB) -Bdynamic -lm -lc
SALIB	= -Bstatic $(LIB_DIR)/$(CVER)/libPvAPI.a -framework CoreFoundation
IMLIB   = -Bstatic $(LIB_DIR)/$(CVER)/libImagelib.a -Bdynamic $(LTIFF)

## final compilation flags
CFLAGS	= $(OPT) $(FLAGS) -Wall -I$(INC_DIR) -D_REENTRANT $(EXTRA)
this is the make file for my sample code:
----------------------------------------------------------------

Code:
# makefile of GigE SDK Sample code
#

include ../ARCH

## Executable
EXE	= ListCameras

$(OBJ_DIR)/%.o : %.cpp
	$(CC) $(CFLAGS) $(VERSION) -c $< -o $@

clean: 
	rm $(EXE)

sample : $(EXE).cpp
	$(CC) $(RPATH) $(TARGET) $(CFLAGS) $(EXE).cpp -o $(EXE) $(SOLIB) $(PVLIB)

sample-static : $(EXE).cpp
	$(CC) $(RPATH) $(TARGET) $(CFLAGS) $(EXE).cpp $(SALIB) -o $(EXE) $(SOLIB)
	
install:
	cp -f $(EXE) $(BIN_DIR)
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,436
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
OK, So CC is being set to g++-$(CVER) and CVER is 4.2, thus the messed up name.

Just pass "CC=g++" at the command line and it should build fine..

--
Regards
...Ashwin



Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks
phdstudent

 
Member Since: Mar 25, 2014
Posts: 7
phdstudent is on a distinguished road

phdstudent is offline
thanks a lot! it is working.

But now, I need to do my own code using the sdk. So, where i have to put the inc files, the bin files and the lib files to be recognized in QT. Thanks
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,436
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
Depends on what you are using to write your program really. If you are going to use g++ to compile your code, you can just pass in the include directory with the "-i" argument, the library folder with the "-L" argument..

Read up on the g++ man page or documentation online on what this means..

You, ideally, want to use a Makefile that will manage this for so that you can just use the "make" command to build everything..

--
Regards
...Ashwin



Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks
phdstudent

 
Member Since: Mar 25, 2014
Posts: 7
phdstudent is on a distinguished road

phdstudent is offline
Hello,

I am using Qt. Now, I am trying to copy an example ()ListCameras.cpp code from as example sdk in QT. I put PvApi.h in /opt/local/include/ and I try to execute my the code but I get a lot of error. Why it was fine when I compiled it online ?

the ListCameras.pro is

Code:
#-------------------------------------------------
#-------------------------------------------------
#
# Project created by QtCreator 2014-03-25T21:43:24
#
#-------------------------------------------------

QT       += core

QT       -= gui

TARGET = ListCameras
CONFIG   += console
CONFIG   -= app_bundle

TEMPLATE = app


SOURCES += main.cpp
INCLUDEPATH+=/opt/local/include/
LIBS+=-L/opt/local/lib/
LIBS+= -llibPvAPI
LIBS+= -llibPvJNI
The erros are all in the PvApi.

Code:
In file included from ../ListCameras/main.cpp:55:
/opt/local/include/PvApi.h:97:26: error: Define PVDECL to be your compiler keyword for "standard call"
                        #error Define PVDECL to be your compiler keyword for "standard call"
                         ^
/opt/local/include/PvApi.h:271:22: error: expected ')'
typedef void (PVDECL *tPvLinkCallback)(void* Context,
                     ^
/opt/local/include/PvApi.h:271:14: note: to match this '('
typedef void (PVDECL *tPvLinkCallback)(void* Context,
             ^
/opt/local/include/PvApi.h:302:22: error: expected ')'
typedef void (PVDECL *tPvCameraEventCallback)(void* Context,
                     ^
/opt/local/include/PvApi.h:302:14: note: to match this '('
typedef void (PVDECL *tPvCameraEventCallback)(void* Context,
             ^
/opt/local/include/PvApi.h:302:15: error: typedef redefinition with different types ('void (void *, tPvHandle, const tPvCameraEvent *, unsigned long)' vs 'void (void *, tPvInterface, tPvLinkEvent, unsigned long)')
typedef void (PVDECL *tPvCameraEventCallback)(void* Context,
              ^
/opt/local/include/PvApi.h:271:15: note: previous definition is here
typedef void (PVDECL *tPvLinkCallback)(void* Context,
              ^
/opt/local/include/PvApi.h:412:22: error: expected ')'
typedef void (PVDECL *tPvFrameCallback)(tPvFrame* Frame);
                     ^
/opt/local/include/PvApi.h:412:14: note: to match this '('
typedef void (PVDECL *tPvFrameCallback)(tPvFrame* Frame);
             ^
/opt/local/include/PvApi.h:412:15: error: typedef redefinition with different types ('void (tPvFrame *)' vs 'void (void *, tPvInterface, tPvLinkEvent, unsigned long)')
typedef void (PVDECL *tPvFrameCallback)(tPvFrame* Frame);
              ^
/opt/local/include/PvApi.h:271:15: note: previous definition is here
typedef void (PVDECL *tPvLinkCallback)(void* Context,
              ^
/opt/local/include/PvApi.h:431:2: error: Define specific data types for your platform.
#error Define specific data types for your platform.
 ^
/opt/local/include/PvApi.h:508:6: error: variable has incomplete type 'void'
void PVDECL PvVersion(unsigned long* pMajor,unsigned long* pMinor);
     ^
/opt/local/include/PvApi.h:508:12: error: expected ';' after top level declarator
void PVDECL PvVersion(unsigned long* pMajor,unsigned long* pMinor);
           ^
           ;
/opt/local/include/PvApi.h:528:8: error: redefinition of 'PVDECL' as different kind of symbol
tPvErr PVDECL PvInitialize(void);
       ^
/opt/local/include/PvApi.h:271:15: note: previous definition is here
typedef void (PVDECL *tPvLinkCallback)(void* Context,
              ^
/opt/local/include/PvApi.h:528:14: error: expected ';' after top level declarator
tPvErr PVDECL PvInitialize(void);
             ^
             ;
/opt/local/include/PvApi.h:546:8: error: redefinition of 'PVDECL' as different kind of symbol
tPvErr PVDECL PvInitializeNoDiscovery(void);
       ^
/opt/local/include/PvApi.h:271:15: note: previous definition is here
typedef void (PVDECL *tPvLinkCallback)(void* Context,
              ^
/opt/local/include/PvApi.h:546:14: error: expected ';' after top level declarator
tPvErr PVDECL PvInitializeNoDiscovery(void);
             ^
             ;
/opt/local/include/PvApi.h:559:6: error: variable has incomplete type 'void'
void PVDECL PvUnInitialize(void);
     ^
/opt/local/include/PvApi.h:559:12: error: expected ';' after top level declarator
void PVDECL PvUnInitialize(void);
           ^
           ;
/opt/local/include/PvApi.h:593:8: error: redefinition of 'PVDECL' as different kind of symbol
tPvErr PVDECL PvLinkCallbackRegister(tPvLinkCallback Callback,
       ^
/opt/local/include/PvApi.h:271:15: note: previous definition is here
typedef void (PVDECL *tPvLinkCallback)(void* Context,
              ^
/opt/local/include/PvApi.h:593:14: error: expected ';' after top level declarator
tPvErr PVDECL PvLinkCallbackRegister(tPvLinkCallback Callback,
             ^
             ;
/opt/local/include/PvApi.h:616:8: error: redefinition of 'PVDECL' as different kind of symbol
tPvErr PVDECL PvLinkCallbackUnRegister(tPvLinkCallback Callback,
       ^
/opt/local/include/PvApi.h:271:15: note: previous definition is here
typedef void (PVDECL *tPvLinkCallback)(void* Context,
              ^
/opt/local/include/PvApi.h:616:14: error: expected ';' after top level declarator
tPvErr PVDECL PvLinkCallbackUnRegister(tPvLinkCallback Callback,
             ^
             ;
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [main.o] Error 1
22:12:10: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project ListCameras (kit: Desktop Qt 5.0.2 clang 64bit)
When executing step 'Make'

Last edited by phdstudent; 03-25-2014 at 10:34 PM.
QUOTE Thanks
pigoo3

 
pigoo3's Avatar
 
Member Since: May 20, 2008
Location: U.S.
Posts: 26,343
pigoo3 has a reputation beyond reputepigoo3 has a reputation beyond reputepigoo3 has a reputation beyond reputepigoo3 has a reputation beyond reputepigoo3 has a reputation beyond reputepigoo3 has a reputation beyond reputepigoo3 has a reputation beyond reputepigoo3 has a reputation beyond reputepigoo3 has a reputation beyond reputepigoo3 has a reputation beyond reputepigoo3 has a reputation beyond repute
Mac Specs: 13" MB 2.4ghz, 2gig ram, OS 10.7.5

pigoo3 is offline
If OP really is a "phdstudent"...maybe we shouldn't be helping too much with the homework!

- Nick

- Computer slow, too many "beachballs", read this: Beachballs
- Computer seems slower than it used to? Read this for some speedup tips: Speedup
- Almost full hard drive? Some solutions. Out of Space
- Apple Battery Info. Battery
QUOTE Thanks
Raz0rEdge

 
Raz0rEdge's Avatar
 
Member Since: Jul 17, 2009
Location: MA
Posts: 7,436
Raz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant futureRaz0rEdge has a brilliant future
Mac Specs: 27" i7 iMac, 24" iMac, 13" Macbook Air, iPhone 5 & 5S, iPod Nano 7th Gen, iPad 2 16GB WiFi, iPad 3

Raz0rEdge is offline
First, how much do you know about programming? You should make sure you are trying to take a bite out of something you can actually grasp..

All of the errors after the first one are expected because you have an #error pre-processor statement telling you the problem, if you read it, it says that you have to define PVDECL to something real and then only with the #error not be hit and the code will begin to compile.

Read the instructions that came along with the SDK to understand what you have to do to set it up properly..

--
Regards
...Ashwin



Be sure to read the Community Guidelines | The more information you provide, the better answers you get, remember GIGO.
QUOTE Thanks

Post Reply New Thread Subscribe


« Brew, rsync and command line errors . . . | ../configure: Permission denied error on mac os x »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
5th gen iPod touch camera specs? Chris H. iPod Hardware and Accessories 1 03-21-2014 11:43 PM

All times are GMT -4. The time now is 08:38 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?