Skip to main content
GameDev.net gamedev.net
🔒 Locked

TinyPTC/Visual C++ 6 Linking Probs..

Started by Doomrat May 26, 2002 at 4:12 AM 6 replies 500+ views
Original Post
Doomrat
Doomrat
So, I add all the tinyptc source files to my project, along with the headers, and link the mmx object file which I compiled seperately. All well and good, until I try to call ptc_open from main. main.obj : error LNK2001: unresolved external symbol "int __cdecl ptc_open(char *,int,int)" (?ptc_open@@YAHPADHH@Z) That makes no sense to me - I''m staring right at the function in ddraw.c and I''ve double checked the #defines in tinyptc.h to make sure that I''m not asking the compiler to skip the function. If somebody could point out my silly mistake, I''d be grateful - thanks.
Alimonster
Alimonster
Have you added the files to your project? I got that message so I copied over the files convert.c/h, ddraw.c, tinyptc.h/c and added them to the project. I linked to the compiled mmx thing and it worked okay after that for the test program.
Doomrat
Doomrat
Yeah, they''re all added.

I''m going to compile them all into object files and link them by hand - not that I''m expecting it to work.
Alimonster
Alimonster
Are you using VC++? If you are then I''ll mail you a test project that works (17K)...
Alimonster
Alimonster
I've uploaded the test project here if you are interested (for VC++ 6).

EDIT: You might want to play around with the compiler and linker settings - it's set as the default (i.e. in Debug mode).

[edited by - Alimonster on May 26, 2002 6:35:20 AM]
Doomrat
Doomrat
Thanks, I actually have that project though - there are a lot of settings in it which I don''t like, and I''d rather start with a clean project than have to fish around in the options changing everything I don''t like.


I think I need my project to treat my object files with C generated functions rather than C++. Somehow.
Doomrat
Doomrat
Heh..


..my project compiles as a Release project.

Problem solved, thanks for your time
Alimonster
Alimonster
quote:
Original post by Doomrat
Thanks, I actually have that project though - there are a lot of settings in it which I don't like, and I'd rather start with a clean project than have to fish around in the options changing everything I don't like.

The file I uploaded is a bare-bones test. I started an empty win32 app and added one file at a time until I got the desired result. The only thing you'd need to change is the main function itself.

quote:
I think I need my project to treat my object files with C generated functions rather than C++. Somehow.

Hmm, don't know much about that, I'm afraid. Try wrapping some of your functions using extern "C" { /* your code here */ }.

EDIT: Doh! Disregard then

[edited by - Alimonster on May 26, 2002 6:39:07 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.