Note that there are some explanatory texts on larger screens.

plurals
  1. POMy C++ class is having trouble linking to a function in another .cpp file
    primarykey
    data
    text
    <p>I asked the same question yesterday and the answer was not applicable.</p> <p><a href="https://stackoverflow.com/questions/6194578/breaking-up-class-functions-into-multiple-cpp-files">https://stackoverflow.com/questions/6194578/breaking-up-class-functions-into-multiple-cpp-files</a></p> <p>If I go into the class header, right click on the function and click "Go to Definition" and it takes me right to my function in my other .CPP file. It sees it, can link to it and still I get errors that indicate I cannot see it.</p> <p>Anyone have any suggestions? I'll try anything.</p> <p>Here is the error again.</p> <blockquote> <p>zdll.lib(d000050.o) : warning LNK4078: multiple <code>'.text'</code> sections found with different attributes (E0300020)</p> <p>WLD.obj : error LNK2019: unresolved external symbol <code>"public: void __thiscall WLD::fragment_03(unsigned char *,int)" (?fragment_03@WLD@@QAEXPAEH@Z)</code> referenced in function <code>"public: bool __thiscall WLD::init(unsigned char *)" (?init@WLD@@QAE_NPAE@Z)</code></p> </blockquote> <p><strong>Edit</strong>: Also, I am using MSVC++. Should I try creating a new solution and importing the files? May help as I feel I am out of options...</p> <p><strong>Edit</strong>: Here is the code:</p> <pre><code>#include "WLD.h" inline void WLD::fragment_03(uchar* location, int frag_num) { // Read the struct into memory and create a temporary pointer struct_frag03 temp03; memcpy(&amp;temp03, location, sizeof(struct_frag03)); uchar* temp_p = location; // Advance the pointer to the encoded bytes (filename) temp_p += sizeof(long) + sizeof(short); // Grab the encoded filename and decode it uchar* f_filename = new uchar [sizeof(temp03.nameLen + 1)]; memcpy(f_filename, temp_p, temp03.nameLen + 1); decode(f_filename, temp03.nameLen); // Add the details about this bitmap to the array bmp_array[current_bmp].filename = f_filename; bmp_array[current_bmp].nameLength = temp03.nameLen; bmp_array[current_bmp].reference03 = frag_num; // 0x03 Debug //errorLog.OutputSuccess("0x03 Filename: %s", bmp_array[current_bmp].filename); //errorLog.OutputSuccess("0x03 Name length: %i",bmp_array[current_bmp].nameLength); //errorLog.OutputSuccess("0x03 Reference: %i", bmp_array[current_bmp].reference03); // Add the bitmap to the count current_bmp++; } </code></pre> <p>And here is where the code is called in the WLD class: </p> <pre><code>case 0x03: fragment_03(wld + file_pos + sizeof(struct_wld_basic_frag), i); break; </code></pre> <p>Here is the header file declaration: in (WLD.h):</p> <pre><code>public: inline void fragment_03(uchar* location, int frag_num); </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload