Advertisement

A DX question, and a linker error...

Started by January 18, 2000 08:34 AM
2 comments, last by Geradian 24 years, 11 months ago
I am currently developing a tile based engine in C++ using DirectX, and I wondered which the best way to implement light effects is? I also have a problem with Visual C++. I have a little socket file. In the cpp file that I want to use it I have declared (for example): extern int CreateDgramSocket(int); But when I try to use it I got a link error saying that it cannot find the "external symbol". Anyone having a clue what I am doing wrong? It works well using the functions from the other files in my project... Sorry if there is something wrong in my message... I am pretty pissed off because of the error!
Don''t use extern for function declarations.

Regards

Starfall
Advertisement
Your function prototypes probably shouldn''t have the extern keyword. The keyword extern used by itself is only used on storage classes, i.e. primitives. When declaring a function extern, you need to qualify the extern with a string literal that describes the linkage method. e.g. extern "C". Possibly the compiler is trying to interpret your extern CreateDGramSocket function as a weird function pointer.

Also are you sure you''re including the header files and linking the object file?
THANK YOU! THANK YOU!!!
I am now happy again!

It worked with the extern "C" CreateDgramSocket(int port)...
Again Thank you!

This topic is closed to new replies.

Advertisement