Jump to content
Maintenance ×
×
×
  • Create New...
  • 0

Libjpeg error


Crystal™

Question

  • Premium

I upgraded vs version to my source ,after cryptopp and libjpeg and i had some errors like this

Spoiler

Error    C2872    'data': ambiguous symbol    eterlib    D:\DEV\METIN2CLIENT\Launcher 4 Inventare\Metin2Client\EterLib\JpegFile.cpp    216    

so i changed jpegfile.cpp & .h with a fixed version and i am getting now like these

Spoiler

Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK2019    unresolved external symbol "public: void __thiscall SpherePack::LostChild(class SpherePack *)" ([email protected]@@[email protected]@Z) referenced in function "public: void __thiscall SpherePack::Unlink(void)" ([email protected]@@QAEXXZ)    UserInterface    C:\Users\User\Desktop\work\Binary [source]32323\UserInterface\eterlib.lib(GrpObjectInstance.obj)    1    
Error    LNK2019    unresolved external symbol ___iob_func referenced in function _output_message    UserInterface    C:\Users\User\Desktop\work\Binary [source]32323\UserInterface\libjpeg-9aMT.lib(jerror.obj)    1    
Error    LNK1120    2 unresolved externals    UserInterface    C:\Users\User\Desktop\work\Binary [source]32323\bin\metin2client.exe    1    

 

 

Do anyone can help me?

 

  • Love 1
Link to comment
Share on other sites

14 answers to this question

Recommended Posts

  • 0
  • Premium
3 hours ago, TheGameDeveloper said:

now i get these errors

Spoiler

Severity    Code    Description    Project    File    Line    Suppression State
Error    LNK2019    unresolved external symbol ___iob_func referenced in function _output_message    UserInterface    C:\Users\User\Desktop\work\Binary [source]32323\UserInterface\libjpeg-9aMT.lib(jerror.obj)    1    
Error    LNK1120    1 unresolved externals    UserInterface    C:\Users\User\Desktop\work\Binary [source]32323\bin\metin2client.exe    1    

 

 

Link to comment
Share on other sites

  • 0
On 12/18/2018 at 6:01 PM, arves100 said:

If you are compiling your client in /MT (type of C++ runtime), switch to /MD or build libjpeg-turbo with /MT flag (rather than /MD).

Second fix faster to do but it's not really reccomanded, add this to UserInterface.cpp: #pragma comment(linker, "/NODEFAULTLIB: MSVCRT.lib") #pragma comment(linker, "/NODEFAULTLIB: MSVCRTD.lib").

 

For anyone having this error, please rebuild libjpeg or libjpeg-turbo with the toolset you're using, this fix everything.

Thanks for the insight, @arves100. What I did in the first place was following your tutorial:

so the problem seems to be at libjpeg-9c. After seeing your response I edited the CFLAGS of makefile.vc and I added -MT at the end just to be sure about the runtime. The libs were generated even tho I had an error in the end saying "cannot open file 'rdjpgcom.exe'" I tried to fix it by downloading it and pasting it into the folder (didn't work) but anw the libs were created so I copied them into the Extern folder and started compiling.

The result was the same as my image.

I also tried the 2nd solution you mentioned. The result was:

IRcd1CQ.jpg

Conclusion: C++ Runtime might not be as big of a deal as we thought. I'm suspecting the rdjpgcom.exe error has something to do with it but I'm not sure...

Link to comment
Share on other sites

  • 0
4 hours ago, arves100 said:

If it builded libjpeg.lib you don't have to worry, about that you can also add it to the Visual studio project under "Ignore default libraries" you put MSVCRT.lib and MSVCRTD.lib

OMG! That was it finally after a week I compiled the client! Thanks for everything @arves100 man you've helped me more than you realise ❤️

Link to comment
Share on other sites

  • 0
  • Honorable Member

this works for me

UserInterface.cpp find 

#include "WiseLogicXTrap.h"

add

//via https://stackoverflow.com/questions/30412951/unresolved-external-symbol-imp-fprintf-and-imp-iob-func-sdl2
#define stdin  (__acrt_iob_func(0))
#define stdout (__acrt_iob_func(1))
#define stderr (__acrt_iob_func(2))

FILE _iob[] = { *stdin, *stdout, *stderr };
extern "C" FILE * __cdecl __iob_func(void) { return _iob; }

 

  • Love 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.


  • Activity

    1. 4

      problem Dargon Soul Changre Attribute

    2. 41

      Global Chat

    3. 4

      problem Dargon Soul Changre Attribute

    4. 2

      Startup Loading Window Library

    5. 28

      Ludus2: metin2 fan project

    6. 44

      Inbuild GR2 Animation

    7. 6

      Minimap Mob proto

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.