scipopt / scip

SCIP - Solving Constraint Integer Programs
Other
406 stars 67 forks source link

Including scip headers under windows (MSVC) fails #62

Closed SanPen closed 1 year ago

SanPen commented 1 year ago

Hi,

I included the scip 8.0.3 headers in a c++ program I'm making. Under ubuntu gcc all compiles fine, but under windows I'm getting some errors pointing at the scip headers that I have no idea what to make of:

...\8.0.3\include\scip/pub_message.h(137): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(137): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(138): error C2146: syntax error: missing ';' before identifier 'SCIP_RETCODE'
...\8.0.3\include\scip/pub_message.h(151): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(151): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(151): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(152): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(157): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(157): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(157): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(158): error C2146: syntax error: missing ';' before identifier 'SCIP_RETCODE'
...\8.0.3\include\scip/pub_message.h(163): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(163): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(163): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(164): error C2146: syntax error: missing ';' before identifier 'SCIP_RETCODE'
...\8.0.3\include\scip/pub_message.h(170): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(170): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(170): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(171): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(177): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(177): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(177): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(178): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(187): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(187): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(187): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(188): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(195): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(195): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(195): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(196): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(206): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(206): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(206): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(207): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(215): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(215): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(215): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(216): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(227): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(227): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(227): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(228): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(235): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(235): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(235): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(236): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(246): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(246): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(246): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(247): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(254): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(254): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(254): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(255): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(265): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(265): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(265): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(266): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(273): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(273): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(273): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(274): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(284): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(284): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(284): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(285): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(293): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(293): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(293): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(294): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(305): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(305): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(305): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(306): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(315): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(315): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(315): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(316): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(328): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(328): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(328): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(329): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(339): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(339): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(339): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(340): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(350): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(350): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(350): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(351): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(360): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(360): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(360): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(361): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(367): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(367): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(367): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(368): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(377): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(377): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(377): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(378): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(387): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(387): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(387): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(388): error C2062: type 'void' unexpected
...\8.0.3\include\scip/pub_message.h(394): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(394): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(394): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(395): error C2146: syntax error: missing ';' before identifier 'SCIP_MESSAGEHDLRDATA'
...\8.0.3\include\scip/pub_message.h(400): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(400): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(400): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(401): error C2146: syntax error: missing ';' before identifier 'FILE'
...\8.0.3\include\scip/pub_message.h(406): error C3861: 'visibility': identifier not found
...\8.0.3\include\scip/pub_message.h(406): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\scip/pub_message.h(406): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\scip/pub_message.h(407): error C2062: type 'unsigned int' unexpected
...\8.0.3\include\blockmemshell/memory.h(167): error C3861: 'visibility': identifier not found
...\8.0.3\include\blockmemshell/memory.h(167): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\blockmemshell/memory.h(167): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\blockmemshell/memory.h(168): error C2062: type 'void' unexpected
...\8.0.3\include\blockmemshell/memory.h(176): error C3861: 'visibility': identifier not found
...\8.0.3\include\blockmemshell/memory.h(176): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\blockmemshell/memory.h(176): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\blockmemshell/memory.h(177): error C2062: type 'void' unexpected
...\8.0.3\include\blockmemshell/memory.h(184): error C3861: 'visibility': identifier not found
...\8.0.3\include\blockmemshell/memory.h(184): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\blockmemshell/memory.h(184): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\blockmemshell/memory.h(185): error C2062: type 'void' unexpected
...\8.0.3\include\blockmemshell/memory.h(193): error C3861: 'visibility': identifier not found
...\8.0.3\include\blockmemshell/memory.h(193): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
...\8.0.3\include\blockmemshell/memory.h(193): error C2374: '__attribute__': redefinition; multiple initialization
...\8.0.3\include\scip/pub_message.h(137): note: see declaration of '__attribute__'
...\8.0.3\include\blockmemshell/memory.h(194): error C2062: type 'void' unexpected
...\8.0.3\include\blockmemshell/memory.h(194): fatal error C1003: error count exceeds 100; stopping compilation

This happens when compiling under windows 10, MSVC 2022.

Maybe I am missing something here.

svigerske commented 1 year ago

SCIP_EXPORT seems to get defined wrongly. It should be defined to __declspec(dllexport) when using MSVC, but somehow you get the GCC/clang variant __attribute__((__visibility__("default"))).

The place where SCIP_EXPORT gets defined depends a bit on your SCIP installation. You might want to look into that.

SanPen commented 1 year ago

Hi!,

I see SCIP_EXPORT being exported in def.h

I'm including #include "scip/scip.h"

¿Do you have an idea of what can be going on?

As far as I know I have not messed with SCIP_EXPORT.

svigerske commented 1 year ago

It gets defined in def.h if it hasn't been defined already. Maybe you could just look at the code after the C preprocessor has been running (there should be some flag for MSVC to output this; it's -E with gcc). That should show more clearly where SCIP_EXPORT gets defined to which value.

My guess is that you have an installation of SCIP that was build via cmake on Linux. In the case, there is a scip/scip_export.h somewhere which defines SCIP_EXPORT to be __attribute__((visibility("default"))), which will not work with MS compilers. But there is not enough information given here to say for sure what is happening.

SanPen commented 1 year ago

Indeed I have the file scip/scip_export.h.

So this file should not be there for windows?

THe content of the file is:


#ifndef SCIP_EXPORT_H
#define SCIP_EXPORT_H

#ifdef SCIP_STATIC_DEFINE
#  define SCIP_EXPORT
#  define SCIP_NO_EXPORT
#else
#  ifndef SCIP_EXPORT
#    ifdef libscip_EXPORTS
        /* We are building this library */
#      define SCIP_EXPORT __attribute__((visibility("default")))
#    else
        /* We are using this library */
#      define SCIP_EXPORT __attribute__((visibility("default")))
#    endif
#  endif

#  ifndef SCIP_NO_EXPORT
#    define SCIP_NO_EXPORT __attribute__((visibility("hidden")))
#  endif
#endif

#ifndef SCIP_DEPRECATED
#  define SCIP_DEPRECATED __attribute__ ((__deprecated__))
#endif

#ifndef SCIP_DEPRECATED_EXPORT
#  define SCIP_DEPRECATED_EXPORT SCIP_EXPORT SCIP_DEPRECATED
#endif

#ifndef SCIP_DEPRECATED_NO_EXPORT
#  define SCIP_DEPRECATED_NO_EXPORT SCIP_NO_EXPORT SCIP_DEPRECATED
#endif

#if 0 /* DEFINE_NO_DEPRECATED */
#  ifndef SCIP_NO_DEPRECATED
#    define SCIP_NO_DEPRECATED
#  endif
#endif

#endif /* SCIP_EXPORT_H */

Do you believe that it is ok to modify this to handle the OS config?

svigerske commented 1 year ago

You can try whether changing the content to

#ifndef SCIP_EXPORT
#define SCIP_EXPORT __declspec(dllimport)
#endif

works better, assuming your want to link to a SCIP DLL later.

SanPen commented 1 year ago

That gets fixed, but I get the same issue with SCIP_DEPRECATED.

What should be the windows version for that one?

Thanks

SanPen commented 1 year ago

Well this is scip_export.hnow:


#ifndef SCIP_EXPORT_H
#define SCIP_EXPORT_H

#ifdef SCIP_STATIC_DEFINE
//#  define SCIP_EXPORT

#       if defined(_WIN32) || defined(_WIN64)
#           define SCIP_EXPORT __declspec(dllexport)
#       elif defined(__APPLE__) || defined(LINUX) || defined(linux)
#           define SCIP_EXPORT __attribute__((visibility("default")))
#       endif

#  define SCIP_NO_EXPORT
#else
#  ifndef SCIP_EXPORT
#    ifdef libscip_EXPORTS
        /* We are building this library */
#       if defined(_WIN32) || defined(_WIN64)
#           define SCIP_EXPORT __declspec(dllexport)
#       elif defined(__APPLE__) || defined(LINUX) || defined(linux)
#           define SCIP_EXPORT __attribute__((visibility("default")))
#       endif
#    else
        /* We are using this library */

#       if defined(_WIN32) || defined(_WIN64)
#           define SCIP_EXPORT __declspec(dllexport)
#       elif defined(__APPLE__) || defined(LINUX) || defined(linux)
#           define SCIP_EXPORT __attribute__((visibility("default")))
#       endif

#    endif
#  endif

#ifndef SCIP_EXPORT
#   if defined(_WIN32) || defined(_WIN64)
#      define SCIP_EXPORT __declspec(dllimport)
#   elif defined(__APPLE__) || defined(LINUX) || defined(linux)
#      define SCIP_EXPORT __attribute__((visibility("default")))
#   endif
#endif

#  ifndef SCIP_NO_EXPORT
#    define SCIP_NO_EXPORT __attribute__((visibility("hidden")))
#  endif
#endif

#ifndef SCIP_DEPRECATED
#   if defined(_WIN32) || defined(_WIN64)
#      define SCIP_DEPRECATED __declspec(deprecated)
#   elif defined(__APPLE__) || defined(LINUX) || defined(linux)
#      define SCIP_DEPRECATED __attribute__ ((__deprecated__))
#   endif
#endif

#ifndef SCIP_DEPRECATED_EXPORT
#  define SCIP_DEPRECATED_EXPORT SCIP_EXPORT SCIP_DEPRECATED
#endif

#ifndef SCIP_DEPRECATED_NO_EXPORT
#  define SCIP_DEPRECATED_NO_EXPORT SCIP_NO_EXPORT SCIP_DEPRECATED
#endif

#if 0 /* DEFINE_NO_DEPRECATED */
#  ifndef SCIP_NO_DEPRECATED
#    define SCIP_NO_DEPRECATED
#  endif
#endif

#endif /* SCIP_EXPORT_H */

It works as horrific it may be...

matbesancon commented 1 year ago

@svigerske is that a change we should also do upstream?

svigerske commented 1 year ago

No, this looks like a user doing something wrong, but not telling enough to find the source of the problem. I gave my guess and instructions to investigate, but that seemed to have been ignored. Since the user found a workaround, this can be closed.

The scip_export.h is autogenerated during the build if using cmake. So you won't need one that works for both worlds (MSVC and GCC). Also, the scip_export.h in https://www.scipopt.org/download.php?fname=SCIPOptSuite-8.0.4-win64-VS15.exe looks correct:

#ifndef SCIP_EXPORT_H
#define SCIP_EXPORT_H

#ifdef SCIP_STATIC_DEFINE
#  define SCIP_EXPORT
#  define SCIP_NO_EXPORT
#else
#  ifndef SCIP_EXPORT
#    ifdef libscip_EXPORTS
        /* We are building this library */
#      define SCIP_EXPORT __declspec(dllexport)
#    else
        /* We are using this library */
#      define SCIP_EXPORT __declspec(dllimport)
#    endif
#  endif

#  ifndef SCIP_NO_EXPORT
#    define SCIP_NO_EXPORT 
#  endif
#endif

#ifndef SCIP_DEPRECATED
#  define SCIP_DEPRECATED __declspec(deprecated)
#endif

#ifndef SCIP_DEPRECATED_EXPORT
#  define SCIP_DEPRECATED_EXPORT SCIP_EXPORT SCIP_DEPRECATED
#endif

#ifndef SCIP_DEPRECATED_NO_EXPORT
#  define SCIP_DEPRECATED_NO_EXPORT SCIP_NO_EXPORT SCIP_DEPRECATED
#endif

#if 0 /* DEFINE_NO_DEPRECATED */
#  ifndef SCIP_NO_DEPRECATED
#    define SCIP_NO_DEPRECATED
#  endif
#endif

#endif /* SCIP_EXPORT_H */

(MSVC-style __declspec instead of GCC-style __attribute__)

SanPen commented 1 year ago

Just to provide a bit of context.

What I am doing is to copy the headers in a folder called ThridParty/solvers/scip/8.0.3 because later I dynamically search and load the .dll/.so file. This is being done with other libraries with zero issues.

Why?

Because I want to be able to compile binaries with all the functionality without having to rely on the machine. I know a common practice is to use cmake to download the dependencies. But that has not worked great in the past and I need to provide a compilable source code to several environments with minimal dependencies (cmake, gcc/msvc and that's it)

I see from the comments, that what I should have is two sets of scip header; one for windows and one for unix. I really believe this is overkill, given that the only difference is a file.

Just my 2 cents.