Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

These are my stdafx.h file content

pragma once

include "targetver.h"

define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

// Windows Header Files: // C RunTime Header Files

include <stdlib.h>

include <malloc malloc.h="">

include <memory.h>

include <tchar.h>

Content of targetver.h

pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

include <sdkddkver.h>

How can I make these to Mac eclipse ??? what I should provide instaed of these windows header files ?? what this tchar.h file ???

click to hide/show revision 2
None

updated 2018-05-10 04:34:31 -0500

berak gravatar image

convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

These are my stdafx.h file content

pragma once

#pragma once
 #include "targetver.h"
 

include "targetver.h"

define #define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers

headers // Windows Header Files: // C RunTime Header Files

Files #include <stdlib.h> #include <malloc/malloc.h> #include <memory.h> #include <tchar.h>

include <stdlib.h>

include <malloc malloc.h="">

include <memory.h>

include <tchar.h>

Content of targetver.h

targetver.h #pragma once

pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and // set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

SDKDDKVer.h.

include <sdkddkver.h>

#include <SDKDDKVer.h>

How can I make these to Mac eclipse ??? what I should provide instaed of these windows header files ?? what this tchar.h file ??? ???

convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

These are my stdafx.h file content

#pragma once

#include "targetver.h"

#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
// C RunTime Header Files
#include <stdlib.h>
#include <malloc/malloc.h>
#include <memory.h>
#include <tchar.h>

Content of targetver.h targetver.h

#pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

#include <SDKDDKVer.h>

How can I make these to Mac eclipse ??? what I should provide instaed of these windows header files ?? what this tchar.h file ???

convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

16:15:19 These are my stdafx.h * Incremental Build of configuration Release for project DisplayImage * make all

Building file: ../Main.cpp

Invoking: GCC C++ Compiler

g++ -I/usr/local/Cellar/opencv/3.4.1_4/include -O3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"Main.d" -MT"Main.o" -o "Main.o" "../Main.cpp"

In file contentincluded from ../Main.cpp:1:

../WaterFill.h:11:13: warning: extra tokens at end of #pragma once directive [-Wextra-tokens] #pragma once;

../Main.cpp:46:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary]

#pragma once

#include "targetver.h"

#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
// C RunTime Header Files
#include <stdlib.h>
#include <malloc/malloc.h>
#include <memory.h>
#include <tchar.h>
    IplImage* pp = &IplImage(inputcopy);

Content of targetver.h

#pragma once

// Including SDKDDKVer.h defines ../Main.cpp:39:9: warning: unused variable 'm_prev_seq' [-Wunused-variable]
        CvSeq m_prev_seq = NULL;
                  ^
../Main.cpp:86:17: error: taking the highest available Windows platform.

// If you wish to build your application for address of a previous Windows platform, include WinSDKVer.h and
// set temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary]
        IplImage pp = &IplImage(inputcopy);

../Main.cpp:79:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq *m_prev_seq = NULL;

../Main.cpp:210:18: error: taking the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. #include <SDKDDKVer.h>

address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage* ppp = &IplImage(Img);

3 warnings and 3 errors generated. make: * [Main.o] Error 1

16:15:21 Build Finished (took 2s.181ms)

How can I make resolve these to Mac eclipse ??? what I should provide instaed of these windows header files ?? what this tchar.h file ???errors ??

convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

16:15:19 * Incremental Build of configuration Release for project DisplayImage * make all

Building file: ../Main.cpp

Invoking: GCC C++ Compiler

g++ -I/usr/local/Cellar/opencv/3.4.1_4/include -O3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"Main.d" -MT"Main.o" -o "Main.o" "../Main.cpp"

In file included from ../Main.cpp:1:

../WaterFill.h:11:13: warning: extra tokens at end of #pragma once directive [-Wextra-tokens] #pragma once;

../Main.cpp:46:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary]

    IplImage* pp = &IplImage(inputcopy);

../Main.cpp:39:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq m_prev_seq = NULL; ^ ../Main.cpp:86:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage pp = &IplImage(inputcopy);

../Main.cpp:79:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq *m_prev_seq = NULL;

../Main.cpp:210:18: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage* ppp = &IplImage(Img);

3 warnings and 3 errors generated. make: * [Main.o] Error 1

16:15:21 Build Finished (took 2s.181ms)

How can I resolve these errors ??

My code snippet is shown below :

Mat CWaterFill::GetHead_Min(Mat Img, vector<rect>* detectBox) { CvMemStorage* m_storage; m_storage = cvCreateMemStorage(0);

CvSeq *m_first_seq = NULL;
CvSeq *m_prev_seq = NULL;
CvSeq *m_seq = NULL;

CvPoint pt1, pt2;

Mat inputcopy;
Img.copyTo(inputcopy);
IplImage* pp = &IplImage(inputcopy);

cvClearMemStorage(m_storage);
cvFindContours(pp, m_storage, &m_first_seq, sizeof(CvContour), CV_RETR_LIST);
cv::Mat mpp = cv::cvarrToMat(pp);
for (m_seq = m_first_seq; m_seq; m_seq = m_seq->h_next)
{
    CvContour* cnt = (CvContour*)m_seq;
    pt1.x = (cnt->rect.x) * 2;
    pt1.y = (cnt->rect.y) * 2;
    pt2.x = (cnt->rect.x + cnt->rect.width) * 2;
    pt2.y = (cnt->rect.y + cnt->rect.height) * 2;
    rectangle(mpp, pt1, pt2, CV_RGB(255, 255, 255), -1);


    Rect head;
    head.x = pt1.x;
    head.y = pt2.x;
    head.width = pt1.y;
    head.height = pt2.y;
    detectBox->push_back(head);
}
return mpp;
cvReleaseMemStorage(&m_storage);

}

convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

16:15:19 * Incremental Build of configuration Release for project DisplayImage * make all

Building file: ../Main.cpp

Invoking: GCC C++ Compiler

g++ -I/usr/local/Cellar/opencv/3.4.1_4/include -O3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"Main.d" -MT"Main.o" -o "Main.o" "../Main.cpp"

In file included from ../Main.cpp:1:

../WaterFill.h:11:13: warning: extra tokens at end of #pragma once directive [-Wextra-tokens] #pragma once;

../Main.cpp:46:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary]

    IplImage* pp = &IplImage(inputcopy);

../Main.cpp:39:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq m_prev_seq = NULL; ^ ../Main.cpp:86:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage pp = &IplImage(inputcopy);

../Main.cpp:79:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq *m_prev_seq = NULL;

../Main.cpp:210:18: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage* ppp = &IplImage(Img);

3 warnings and 3 errors generated. make: * [Main.o] Error 1

16:15:21 Build Finished (took 2s.181ms)

How can I resolve these errors ??

My code snippet is shown below :

Mat CWaterFill::GetHead_Min(Mat Img, vector<rect>* detectBox) { detectBox)

{
CvMemStorage* m_storage; m_storage = cvCreateMemStorage(0);

CvSeq *m_first_seq = NULL;
CvSeq *m_prev_seq = NULL;
CvSeq *m_seq = NULL;

CvPoint pt1, pt2;

Mat inputcopy;
Img.copyTo(inputcopy);
IplImage* pp = &IplImage(inputcopy);

cvClearMemStorage(m_storage);
cvFindContours(pp, m_storage, &m_first_seq, sizeof(CvContour), CV_RETR_LIST);
cv::Mat mpp = cv::cvarrToMat(pp);
for (m_seq = m_first_seq; m_seq; m_seq = m_seq->h_next)
{
    CvContour* cnt = (CvContour*)m_seq;
    pt1.x = (cnt->rect.x) * 2;
    pt1.y = (cnt->rect.y) * 2;
    pt2.x = (cnt->rect.x + cnt->rect.width) * 2;
    pt2.y = (cnt->rect.y + cnt->rect.height) * 2;
    rectangle(mpp, pt1, pt2, CV_RGB(255, 255, 255), -1);


    Rect head;
    head.x = pt1.x;
    head.y = pt2.x;
    head.width = pt1.y;
    head.height = pt2.y;
    detectBox->push_back(head);
}
return mpp;
cvReleaseMemStorage(&m_storage);

}

convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

16:15:19 * Incremental Build of configuration Release for project DisplayImage * make all

Building file: ../Main.cpp

Invoking: GCC C++ Compiler

g++ -I/usr/local/Cellar/opencv/3.4.1_4/include -O3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"Main.d" -MT"Main.o" -o "Main.o" "../Main.cpp"

In file included from ../Main.cpp:1:

../WaterFill.h:11:13: warning: extra tokens at end of #pragma once directive [-Wextra-tokens] #pragma once;

../Main.cpp:46:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary]

    IplImage* pp = &IplImage(inputcopy);

../Main.cpp:39:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq m_prev_seq = NULL; ^ ../Main.cpp:86:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage pp = &IplImage(inputcopy);

../Main.cpp:79:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq *m_prev_seq = NULL;

../Main.cpp:210:18: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage* ppp = &IplImage(Img);

3 warnings and 3 errors generated. make: * [Main.o] Error 1

16:15:21 Build Finished (took 2s.181ms)

How can I resolve these errors ??

My code snippet is shown below :

Mat CWaterFill::GetHead_Min(Mat Img, vector<rect>* detectBox)

{

    CvMemStorage* m_storage;
 m_storage = cvCreateMemStorage(0);

cvCreateMemStorage(0);


    CvSeq *m_first_seq = NULL;
CvSeq *m_prev_seq = NULL;
CvSeq *m_seq = NULL;

CvPoint pt1, pt2;

Mat inputcopy;
Img.copyTo(inputcopy);
IplImage* pp = &IplImage(inputcopy);

cvClearMemStorage(m_storage);
cvFindContours(pp, m_storage, &m_first_seq, sizeof(CvContour), CV_RETR_LIST);
cv::Mat mpp = cv::cvarrToMat(pp);
for (m_seq = m_first_seq; m_seq; m_seq = m_seq->h_next)
{
    CvContour* cnt = (CvContour*)m_seq;
    pt1.x = (cnt->rect.x) * 2;
    pt1.y = (cnt->rect.y) * 2;
    pt2.x = (cnt->rect.x + cnt->rect.width) * 2;
    pt2.y = (cnt->rect.y + cnt->rect.height) * 2;
    rectangle(mpp, pt1, pt2, CV_RGB(255, 255, 255), -1);


    Rect head;
    head.x = pt1.x;
    head.y = pt2.x;
    head.width = pt1.y;
    head.height = pt2.y;
    detectBox->push_back(head);
}
return mpp;
cvReleaseMemStorage(&m_storage);

}

click to hide/show revision 8
None

updated 2018-05-11 14:43:21 -0500

berak gravatar image

convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. Mac. The following issues I am facing,

These are my stdafx.h file content

#pragma once
 #include "targetver.h"

include "targetver.h"

define #define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers


headers
// Windows Header Files:
// C RunTime Header Files
Files
#include <stdlib.h>
#include <malloc/malloc.h>
#include <memory.h>
#include <tchar.h>

include <stdlib.h>

include <malloc malloc.h="">

include <memory.h>

include <tchar.h>

Content of targetver.h targetver.h

 #pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.


// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.
SDKDDKVer.h.

include <sdkddkver.h>
#include <SDKDDKVer.h>

How can I make these to Mac eclipse ??? what I should provide instaed of these windows header files ?? what this tchar.h file ??? ??? click to hide/show revision 3
None edit

updated 33 hours ago convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

These are my stdafx.h file content

#pragma once

#include "targetver.h"

#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
// C RunTime Header Files
#include <stdlib.h>
#include <malloc/malloc.h>
#include <memory.h>
#include <tchar.h>

Content of targetver.h targetver.h

#pragma once

// Including SDKDDKVer.h defines the highest available Windows platform.

// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and
// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

#include <SDKDDKVer.h>

How can I make these to Mac eclipse ??? what I should provide instaed of these windows header files ?? what this tchar.h file ??? click to hide/show revision 4
None edit

updated 27 hours ago convert Visual Studio (windows) to Eclipse (Mac)

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

16:15:19 These are my stdafx.h * Incremental Build of configuration Release for project DisplayImage * * make all all

Building file: ../Main.cpp

Invoking: GCC C++ Compiler

g++ -I/usr/local/Cellar/opencv/3.4.1_4/include -O3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"Main.d" -MT"Main.o" -o "Main.o" "../Main.cpp"

In file contentincluded from ../Main.cpp:1:

../WaterFill.h:11:13: warning: extra tokens at end of #pragma once directive [-Wextra-tokens] #pragma once;

../Main.cpp:46:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary]

#pragma once

#include "targetver.h"

#define WIN32_LEAN_AND_MEAN             // Exclude rarely-used stuff from Windows headers
// Windows Header Files:
// C RunTime Header Files
#include <stdlib.h>
#include <malloc/malloc.h>
#include <memory.h>
#include <tchar.h>
    IplImage* pp = &IplImage(inputcopy);

Content of targetver.h

#pragma once

// Including SDKDDKVer.h defines ../Main.cpp:39:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq m_prev_seq = NULL; ^ ../Main.cpp:86:17: error: taking the highest available Windows platform.

// If you wish to build your application for address of a previous Windows platform, include WinSDKVer.h and // set temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage pp = &IplImage(inputcopy);

../Main.cpp:79:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq *m_prev_seq = NULL;

../Main.cpp:210:18: error: taking the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h.

include <sdkddkver.h>

address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage* ppp = &IplImage(Img);

3 warnings and 3 errors generated. make: * [Main.o] Error 1

16:15:21 Build Finished (took 2s.181ms)

How can I make resolve these to Mac eclipse ??? what I should provide instaed of these windows header files ?? what this tchar.h file ???errors ??

[update]

I am trying to convert a visual studio 2015 (windows) OpenCV project to Eclipse in Mac. The following issues I am facing,

16:15:19 * Incremental Build of configuration Release for project DisplayImage * make all

Building file: ../Main.cpp

Invoking: GCC C++ Compiler

g++ -I/usr/local/Cellar/opencv/3.4.1_4/include -O3 -Wall -c -fmessage-length=0 -std=c++11 -MMD -MP -MF"Main.d" -MT"Main.o" -o "Main.o" "../Main.cpp"

In file included from ../Main.cpp:1:

../WaterFill.h:11:13: warning: extra tokens at end of #pragma once directive [-Wextra-tokens] #pragma once;

../Main.cpp:46:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary]

    IplImage* pp = &IplImage(inputcopy);

../Main.cpp:39:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq m_prev_seq = NULL; ^ ../Main.cpp:86:17: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage pp = &IplImage(inputcopy);

../Main.cpp:79:9: warning: unused variable 'm_prev_seq' [-Wunused-variable] CvSeq *m_prev_seq = NULL;

../Main.cpp:210:18: error: taking the address of a temporary object of type 'IplImage' (aka '_IplImage') [-Waddress-of-temporary] IplImage* ppp = &IplImage(Img);

3 warnings and 3 errors generated. make: * [Main.o] Error 1

16:15:21 Build Finished (took 2s.181ms)

How can I resolve these errors ??

My code snippet is shown below :

Mat CWaterFill::GetHead_Min(Mat Img, vector<rect>* detectBox)

{

    CvMemStorage* m_storage;
m_storage = cvCreateMemStorage(0);


    CvSeq *m_first_seq = NULL;
CvSeq *m_prev_seq = NULL;
CvSeq *m_seq = NULL;

CvPoint pt1, pt2;

Mat inputcopy;
Img.copyTo(inputcopy);
IplImage* pp = &IplImage(inputcopy);

cvClearMemStorage(m_storage);
cvFindContours(pp, m_storage, &m_first_seq, sizeof(CvContour), CV_RETR_LIST);
cv::Mat mpp = cv::cvarrToMat(pp);
for (m_seq = m_first_seq; m_seq; m_seq = m_seq->h_next)
{
    CvContour* cnt = (CvContour*)m_seq;
    pt1.x = (cnt->rect.x) * 2;
    pt1.y = (cnt->rect.y) * 2;
    pt2.x = (cnt->rect.x + cnt->rect.width) * 2;
    pt2.y = (cnt->rect.y + cnt->rect.height) * 2;
    rectangle(mpp, pt1, pt2, CV_RGB(255, 255, 255), -1);


    Rect head;
    head.x = pt1.x;
    head.y = pt2.x;
    head.width = pt1.y;
    head.height = pt2.y;
    detectBox->push_back(head);
}
return mpp;
cvReleaseMemStorage(&m_storage);

}