• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

cant add socket to plugin.... warning C4005: 'AF_IPX': macro redefinition

Engaged ,
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

Hey

I've gone over it for 8h now. Whatever I try, however, I try to import my sockets, they always break. It's like there is some kind of black magic path to import the socket library on windows..

 

I tried all here > https://www.zachburlingame.com/2011/05/resolving-redefinition-errors-betwen-ws2def-h-and-winsock-h/

 

Predeclaring, above, below after etc. I'm on 10th class/file away from main, I want to import socket there and I keep getting these damn errors. 

my mainPlugin import stuff >

 

 

 

 

#include "SocketLib/SocketIncludes/socket.h"
#include "PluginLib/Utilities/PIUASZString.h"

#include "iostream"
#include "PluginLib/Helpers/DocumentHierarchy.h"
#include "PluginLib/BaseSystems/CommandHandler.h"
#include <PIDefines.h>
#include <SPBasic.h>
#include <SPInterf.h>

#include <PIActionsPlugin.h>

#ifndef WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
#endif


#include <assert.h>

#include <PIUSuites.cpp>
#include <PITerminology.h>

 

 

 

 

This is nuts, what do I do to just "Import a socket" here? Importing it like above "works" until I import it somewhere else in a header and it breaks. It's like I can't import it in a header at all. Only in CPP files.

 

Same goes with 

<PIUSuites.cpp>

Unless I import cpp in main, the plugin will not compile at all ;[

Regards

Dariusz

TOPICS
SDK , Windows

Views

705

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

Hi, is this well related to Photoshop?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

@PECourtejoie 

Photoshop SDK. There are so many... "flags" to get to even compile/run the code on that I have no idea what 50% of them do. It's a miracle it even compiles as-is. I ended up just doing void* for half the imports that break and doing a zillions of static_cast to make it run. I probably did something wrong. But I've no idea what 😕 

SDK can break even if I go from <PIUSuites.h> to "PIUSuites.h" by accident/auto-import etc etc. 

 

I'm gonna try and start to disable some of the flags PS sets to see if I Can make it run with fewer of them so its more "modern". 

 

I'm guessing not many people have tried running custom sockets/networks within photoshop & thus not being a big problem? Or they all found a workaround, or I simply did something very very very bad. 

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

I would strongly suggest to wait a little for an answer, and there are a few scripters that visit daily, but I'm not sure that people that compile plugins visit so often.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

All good, mostly just venting here with SDK, in hopes that maybe one-day Adobe would invest to refactor their SDK and modernise it... and extend with better support so we can extend photoshop core components.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

Pinging @Kerri Shotts @Erin F.  Hi, Kerri, or Erin can you assist, or ping the correct Photoshop engineer?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

Thanks for the heads up, @PECourtejoie, I'm asking around!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
May 24, 2022 May 24, 2022

Copy link to clipboard

Copied

Yes. Header file dependency and getting the correct order of includes is a huge pain. I would try this: 1) Get a winsock example that builds, 2) Modify it for your needs, 3) Wrap that in a DLL or LIB, 4) Load or link that in your plugin.

 

And this is why the SDK is documented for the specific tool chain version (Xcode or Visual Studio) so I can remove myself from this pain and suffering!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
May 26, 2022 May 26, 2022

Copy link to clipboard

Copied

LATEST

That's my experience too. It's like walking on glass sticks. 90% of explosion!

I managed to move vs solution to cmake & which made things A LOT easier. But still, the socket is a pain. Ended up predeclaring/using void* to handle it for now. 

 

Will try to move Xcode to cmake next, and see how that one... "explodes". Fun times!

 

In terms of sdk fun... do you also > 

#include <PIUSuites.cpp>

cpp in main? Seems like it has to be included in main so it can run properly, other classes appear to be happy with .h includes etc.

 

Regards

Dariusz

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines