convert Visual Studio (windows) to Eclipse (Mac)

asked 2018-05-10 04:32:38 -0500

Nimya gravatar image

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

berak gravatar image

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"

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

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 ... (more)

edit retag flag offensive close merge delete

Comments

1

and how on earth is this related to opencv ?

berak gravatar imageberak ( 2018-05-10 04:35:29 -0500 )edit

it's an OpenCV Project only but issue is within c++ part :-(

Nimya gravatar imageNimya ( 2018-05-10 04:40:25 -0500 )edit

a typical opencv project would not need this. if your program really needs any of it, it won't be portable.

try to remove the #include <stdafx.h> , and fix resulting errors. then try again on eclipse.

and again, none of your problems are related to opencv.

berak gravatar imageberak ( 2018-05-10 05:17:20 -0500 )edit

please use opencv's c++ api (cv::Mat), NOT IplImage* or anything from the deprecated and no more maintained c-api !

seriously, if the project you're trying to port contains IplImage, that means, it's like 8 years old, and you might be better off, looking for a better maintained / more up-to-date solution.

berak gravatar imageberak ( 2018-05-10 10:27:28 -0500 )edit

please have a look at current tutorials and use the code from there, not the outdated c crap, you're trying with now.

berak gravatar imageberak ( 2018-05-11 01:54:25 -0500 )edit

@nimjya, you're clearly having a problem with outdated stuff,

but please do not erase previous history of your question, else it gets too confusing.

berak gravatar imageberak ( 2018-05-11 14:45:10 -0500 )edit
1

You need to learn how to create a blank project and add files to it, so you don't get all that Microsoft header stuff.

sjhalayka gravatar imagesjhalayka ( 2018-05-11 15:03:46 -0500 )edit
1

^^ which i could upvote that 4 times ;)

berak gravatar imageberak ( 2018-05-11 15:16:20 -0500 )edit