problem with using ftgl bitmap

Started by
5 comments, last by jake_Ghost 19 years, 1 month ago
i can compile my project w/o using the ftgl fonts (with libs). But as soon as i declare a font, like this...

FTGLBitmapFont *font = new FTGLBitmapFont("C:/Windows/Fonts/Arial.ttf");


i get all these errors

Deleting intermediate files and output files for project 'Maia - Win32 Debug'.
--------------------Configuration: Maia - Win32 Debug--------------------
Compiling...
ARB_Multisample.cpp
BMP.cpp
cUI.cpp
DrawScene.cpp
IsExtSupported.c
Maia.cpp
TGALoader.cpp
Linking...
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strncpy already defined in LIBCD.lib(strncpy.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _malloc already defined in LIBCD.lib(dbgheap.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _realloc already defined in LIBCD.lib(dbgheap.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _free already defined in LIBCD.lib(dbgheap.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fclose already defined in LIBCD.lib(fclose.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fread already defined in LIBCD.lib(fread.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fseek already defined in LIBCD.lib(fseek.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _ftell already defined in LIBCD.lib(ftell.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _fopen already defined in LIBCD.lib(fopen.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _strncmp already defined in LIBC.lib(strncmp.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isdigit already defined in LIBCD.lib(_ctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _atol already defined in LIBCD.lib(atox.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _memmove already defined in LIBCD.lib(memmove.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _sprintf already defined in LIBCD.lib(sprintf.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isxdigit already defined in LIBCD.lib(_ctype.obj)
msvcrt.lib(MSVCRT.dll) : error LNK2005: _isalnum already defined in LIBCD.lib(_ctype.obj)
LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library
LIBCD.lib(crt0init.obj) : warning LNK4098: defaultlib "msvcrt.lib" conflicts with use of other libs; use /NODEFAULTLIB:library
LINK : warning LNK4049: locally defined symbol ""public: __thiscall FTGLBitmapFont::FTGLBitmapFont(char const *)" (??0FTGLBitmapFont@@QAE@PBD@Z)" imported
LINK : warning LNK4049: locally defined symbol ""public: virtual __thiscall FTGLBitmapFont::~FTGLBitmapFont(void)" (??1FTGLBitmapFont@@UAE@XZ)" imported
ftgl_static.lib(FTBitmapGlyph.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)
ftgl_static.lib(FTBitmapGlyph.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)
freetype219.lib(cff.obj) : error LNK2001: unresolved external symbol ___security_cookie
freetype219.lib(type1.obj) : error LNK2001: unresolved external symbol ___security_cookie
freetype219.lib(autohint.obj) : error LNK2001: unresolved external symbol ___security_cookie
freetype219.lib(ftbase.obj) : error LNK2001: unresolved external symbol ___security_cookie
freetype219.lib(psmodule.obj) : error LNK2001: unresolved external symbol ___security_cookie
freetype219.lib(bdf.obj) : error LNK2001: unresolved external symbol ___security_cookie
freetype219.lib(type1cid.obj) : error LNK2001: unresolved external symbol ___security_cookie
freetype219.lib(cff.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
freetype219.lib(type1.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
freetype219.lib(autohint.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
freetype219.lib(ftbase.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
freetype219.lib(psmodule.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
freetype219.lib(bdf.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
freetype219.lib(type1cid.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
Debug/Maia.exe : fatal error LNK1120: 4 unresolved externals
Error executing link.exe.

Maia.exe - 33 error(s), 4 warning(s)


i have no idea why it does this. Any help would be great thx jake
Advertisement
i am not really sure but try this :
1) delete all the files in your Debug floder.
2) link the libraries by this code
#pragma comment(lib, "library_name.lib")
in your code make sure the library you want to load it te be in the same floder
3)go to Project->Setting->Link->"Project Options" and put this line
/nodefaultlib:"LIBC"
this line used if you use multi-threading
that's all
i hope it works with you
ok i did what u said and i still get some crazy errors. And im not using multithreading (computer sux to much).

--------------------Configuration: Maia - Win32 Debug--------------------Compiling...cUI.cppLinking...LINK : warning LNK4049: locally defined symbol ""public: __thiscall FTGLBitmapFont::FTGLBitmapFont(char const *)" (??0FTGLBitmapFont@@QAE@PBD@Z)" importedLINK : warning LNK4049: locally defined symbol ""public: virtual __thiscall FTGLBitmapFont::~FTGLBitmapFont(void)" (??1FTGLBitmapFont@@UAE@XZ)" importedLINK : warning LNK4049: locally defined symbol "_strncpy" importedLINK : warning LNK4049: locally defined symbol "_malloc" importedLINK : warning LNK4049: locally defined symbol "_realloc" importedLINK : warning LNK4049: locally defined symbol "_free" importedLINK : warning LNK4049: locally defined symbol "_fclose" importedLINK : warning LNK4049: locally defined symbol "_fread" importedLINK : warning LNK4049: locally defined symbol "_fseek" importedLINK : warning LNK4049: locally defined symbol "_ftell" importedLINK : warning LNK4049: locally defined symbol "_fopen" importedLINK : warning LNK4049: locally defined symbol "_strncmp" importedLINK : warning LNK4049: locally defined symbol "_isdigit" importedLINK : warning LNK4049: locally defined symbol "_atol" importedLINK : warning LNK4049: locally defined symbol "_memmove" importedLINK : warning LNK4049: locally defined symbol "_sprintf" importedLINK : warning LNK4049: locally defined symbol "_isxdigit" importedLINK : warning LNK4049: locally defined symbol "_isalnum" importedftgl_static.lib(FTBitmapGlyph.obj) : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)ftgl_static.lib(FTBitmapGlyph.obj) : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)freetype219.lib(ftbase.obj) : error LNK2001: unresolved external symbol __imp__longjmpfreetype219.lib(smooth.obj) : error LNK2001: unresolved external symbol __imp__longjmpfreetype219.lib(ftbase.obj) : error LNK2001: unresolved external symbol __imp__strrchrfreetype219.lib(cff.obj) : error LNK2001: unresolved external symbol ___security_cookiefreetype219.lib(type1.obj) : error LNK2001: unresolved external symbol ___security_cookiefreetype219.lib(autohint.obj) : error LNK2001: unresolved external symbol ___security_cookiefreetype219.lib(ftbase.obj) : error LNK2001: unresolved external symbol ___security_cookiefreetype219.lib(psmodule.obj) : error LNK2001: unresolved external symbol ___security_cookiefreetype219.lib(bdf.obj) : error LNK2001: unresolved external symbol ___security_cookiefreetype219.lib(type1cid.obj) : error LNK2001: unresolved external symbol ___security_cookiefreetype219.lib(cff.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4freetype219.lib(type1.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4freetype219.lib(autohint.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4freetype219.lib(ftbase.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4freetype219.lib(psmodule.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4freetype219.lib(bdf.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4freetype219.lib(type1cid.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4freetype219.lib(bdf.obj) : error LNK2001: unresolved external symbol __imp__qsortfreetype219.lib(cff.obj) : error LNK2001: unresolved external symbol __imp__qsortfreetype219.lib(type1.obj) : error LNK2001: unresolved external symbol __imp__qsortfreetype219.lib(pfr.obj) : error LNK2001: unresolved external symbol __imp__qsortfreetype219.lib(sfnt.obj) : error LNK2001: unresolved external symbol __imp__qsortfreetype219.lib(psmodule.obj) : error LNK2001: unresolved external symbol __imp__qsortfreetype219.lib(psaux.obj) : error LNK2001: unresolved external symbol __imp__qsortDebug/Maia.exe : fatal error LNK1120: 7 unresolved externalsError executing link.exe.Maia.exe - 27 error(s), 18 warning(s)
After a little [google]ing
Be sure to read the thread linked in the second post. I'm not sure if that will get rid of the longjmp or qsort link errors, but give it a try.

I would also second Sinbad's (from that forum) suggestion and upgrade from VS6, they have a real crappy compiler.

EDIT: Make sure you are a linking to the single-threaded ftgl and freetype libs and that your run-time library setting is set to single-threaded (in VS.NET it's in project settings - c/c++ - code generation... it should be something similar to that in VS6).
well i dled the sp6 thing and it still dont work. I also have the .net disc somewhere in my house but i dont no much about .net? Is .net same language as just normal visual studio 6.0? If it is i guess ill try it then and see how it goes.
Quote:Original post by jake_Ghost
well i dled the sp6 thing and it still dont work. I also have the .net disc somewhere in my house but i dont no much about .net? Is .net same language as just normal visual studio 6.0? If it is i guess ill try it then and see how it goes.


Visual Studio is just an IDE. In my opinion VS.NET's IDE is more intuitive than VS6. It will take a little getting used to coming from VS6, but they are pretty similar. The language is C++ (using visual c++ that is, as opposed to visual basic for example), it has nothing to do with Microsoft or Visual Studio. Now, the compilers are a different story. VS6 came out around the time C++ was still being standardized, so it's compiler is not very standards compliant and doesn't optimize very well. VS.NET's compiler is 98% standards compliant (or so I've heard) and is much better at optimizing. VS6 isn't even being supported anymore.

So in short, run far, far away from VS6 and install VS.NET as quickly as possible.
k thx ill install it soon as i find my damn cd for it

This topic is closed to new replies.

Advertisement